![]() |
SatNOGS-COMMS
4.1.0
A COMMS subsystem for CubeSats
|
GPIO device abstraction. More...
#include <gpio.hpp>
Public Types | |
| enum class | direction : uint8_t { INPUT = 0 , OUTPUT = 1 } |
Public Member Functions | |
| gpio (direction dir=direction::INPUT) | |
| Construct a new GPIO object. | |
| virtual void | toggle ()=0 |
| Toggles the GPIO pin if it is configured as output. Has no effect if it is conigured as input. | |
| virtual bool | get ()=0 |
| Gets the logical level of the GPIO pin. For example, if the pin has been configured as active low, and the input level is 0V, this method will return true. | |
| virtual bool | get_raw ()=0 |
| Gets the physical level of the GPIO pin. For example, if the input level is 0V, this method will return false. | |
| virtual void | set (bool s)=0 |
Sets the logical output of the pin. For example, if the pin has been configured as active low, setting s to true will set the output pin to 0V. | |
| virtual void | set_raw (bool s)=0 |
| Sets the physical output of the pin. | |
| virtual void | set_direction (direction dir)=0 |
| Set the direction of the GPIO. | |
GPIO device abstraction.
This class provides a generic GPIO (General-Purpose Input/Output) abstraction.
|
strong |
|
inline |
Construct a new GPIO object.
| dir | The direction of the pin (INPUT or OUTPUT). Default is direction::INPUT. |
|
pure virtual |
Gets the logical level of the GPIO pin. For example, if the pin has been configured as active low, and the input level is 0V, this method will return true.
Implemented in satnogs::comms::gpio_bsp, and satnogs::comms::lib::bsp::dummy_gpio.
|
pure virtual |
Gets the physical level of the GPIO pin. For example, if the input level is 0V, this method will return false.
Implemented in satnogs::comms::gpio_bsp, and satnogs::comms::lib::bsp::dummy_gpio.
|
pure virtual |
Sets the logical output of the pin. For example, if the pin has been configured as active low, setting s to true will set the output pin to 0V.
Has no effect if the pin is not configured as output.
| s | the logical level of the output pin |
Implemented in satnogs::comms::gpio_bsp, and satnogs::comms::lib::bsp::dummy_gpio.
|
pure virtual |
Set the direction of the GPIO.
| dir | the desired direction |
Implemented in satnogs::comms::gpio_bsp, and satnogs::comms::lib::bsp::dummy_gpio.
|
pure virtual |
Sets the physical output of the pin.
Has no effect if the pin is not configured as output.
| s | the physical level of the output pin |
Implemented in satnogs::comms::gpio_bsp, and satnogs::comms::lib::bsp::dummy_gpio.
|
pure virtual |
Toggles the GPIO pin if it is configured as output. Has no effect if it is conigured as input.
Implemented in satnogs::comms::gpio_bsp, and satnogs::comms::lib::bsp::dummy_gpio.