|
Open Model Railroad Network (OpenMRN)
|
Defines a GPIO output pin. More...
#include <Esp32Gpio.hxx>
Public Member Functions | |
| void | write (Value new_state) const override |
| Sets the output state of the connected GPIO pin. | |
| Value | read () const override |
| Reads the current state of the connected GPIO pin. | |
| void | set () const override |
| Sets output to HIGH. | |
| void | clr () const override |
| Sets output to LOW. | |
| void | set_direction (Direction dir) const override |
| Sets the direction of the connected GPIO pin. | |
| Direction | direction () const override |
| Gets the GPIO direction. | |
Public Member Functions inherited from Gpio | |
| constexpr | Gpio () |
| Constructor. | |
| void | write (bool new_state) const |
| Writes a GPIO output pin (set or clear to a specific state). | |
| bool | is_set () const |
| Tests the GPIO input pin to see if it is set. | |
| bool | is_clr () const |
| Tests the GPIO input pin to see if it is clear. | |
Static Private Attributes | |
| static const Esp32Gpio | instance_ |
| Static instance variable that can be used for libraries expecting a generic Gpio pointer. | |
Friends | |
| template<class Defs , bool SAFE_VALUE, bool INVERT> | |
| struct | GpioOutputPin |
| template<class Defs , bool PUEN, bool PDEN> | |
| struct | GpioInputPin |
Additional Inherited Members | |
Public Types inherited from Gpio | |
| enum | Value : bool { CLR = false , SET = true , VLOW = CLR , VHIGH = SET } |
| Defines the options for GPIO level. More... | |
| enum class | Direction { DINPUT , DOUTPUT } |
| Defines the options for GPIO direction. More... | |
Defines a GPIO output pin.
Writes to this structure will change the output level of the pin. Reads will return the pin's current level.
The pin is set to output at initialization time, with the level defined by ‘SAFE_VALUE’.
Do not use this class directly. Use GPIO_PIN instead.
Definition at line 75 of file Esp32Gpio.hxx.
|
inlineoverridevirtual |
Gets the GPIO direction.
Implements Gpio.
Definition at line 183 of file Esp32Gpio.hxx.
|
inlineoverridevirtual |
Reads the current state of the connected GPIO pin.
Implements Gpio.
Definition at line 145 of file Esp32Gpio.hxx.
|
inlineoverridevirtual |
Sets the direction of the connected GPIO pin.
Implements Gpio.
Definition at line 163 of file Esp32Gpio.hxx.
|
inlineoverridevirtual |
Sets the output state of the connected GPIO pin.
| new_state | State to set the GPIO pin to. |
Implements Gpio.
Definition at line 127 of file Esp32Gpio.hxx.
|
friend |
Definition at line 193 of file Esp32Gpio.hxx.
|
friend |
Definition at line 192 of file Esp32Gpio.hxx.
|
staticprivate |
Static instance variable that can be used for libraries expecting a generic Gpio pointer.
Defines the linker symbol for the wrapped Gpio instance.
This instance variable will be initialized by the linker and (assuming the application developer initialized the hardware pins in hw_preinit) is accessible, including virtual methods at static constructor time.
Definition at line 199 of file Esp32Gpio.hxx.