36#ifndef _FREERTOS_DRIVERS_COMMON_GPIOWRAPPER_HXX_
37#define _FREERTOS_DRIVERS_COMMON_GPIOWRAPPER_HXX_
71 return PIN::get() ? VHIGH : VLOW;
78 if (dir == Direction::DOUTPUT)
92 return Direction::DOUTPUT;
96 return Direction::DINPUT;
115 static void hw_init() { PIN::hw_init(); }
116 static void hw_set_to_safe() { PIN::hw_set_to_safe(); }
118 static void set(
bool value) { PIN::set(!value); }
119 static bool get() {
return !PIN::get(); }
121 static void toggle() { PIN::toggle(); }
122 static bool is_output() {
return PIN::is_output(); }
123 static void set_output(
bool o) { PIN::set_output(o); }
Creates an implementation of an os-independent Gpio object from a hardware-specific static Gpio struc...
void write(Value new_state) const OVERRIDE
Writes a GPIO output pin (set or clear to a specific state).
void set() const OVERRIDE
Sets the GPIO output pin to high.
void clr() const OVERRIDE
Clears the GPIO output pin to low.
Value read() const OVERRIDE
Retrieves the current Value of a GPIO input pin.
void set_direction(Direction dir) const OVERRIDE
Sets the GPIO direction.
static const GpioWrapper instance_
Defines the linker symbol for the wrapped Gpio instance.
constexpr GpioWrapper()
This constructor is constexpr which ensures that the object can be initialized in the data section.
Direction direction() const OVERRIDE
Gets the GPIO direction.
static constexpr const Gpio * instance()
OS-independent abstraction for GPIO.
Value
Defines the options for GPIO level.
Direction
Defines the options for GPIO direction.
Creates a hardware GPIO adaptor that inverts the pin state.
static constexpr const Gpio * instance()
#define OVERRIDE
Function attribute for virtual functions declaring that this funciton is overriding a funciton that s...
#define HASSERT(x)
Checks that the value of expression x is true, else terminates the current process.