|
Flyby SDK v1.0.2
|
Interface for the GPIO pins. More...
#include <pins.h>

Public Types | |
| enum | PinType : uint8_t { IN , OUT , INOUT } |
| The type of pin can be IN, OUT, or INOUT. | |
| enum | PinValue : uint8_t { LOW , HIGH } |
| The value of the pin can be either high or low. | |
Public Member Functions | |
| void | set_high () const |
| Set the pin to HIGH. | |
| void | set_low () const |
| Set the pin to LOW. | |
| PinValue | get_value () const |
| Get the current value of the pin. | |
| std::shared_ptr< PinObservable > | subscribe () |
| Subscribe to the pin's state changes. | |
Static Public Member Functions | |
| static bool | initialize_pins () |
| Initializes the hardware to support pin operations. | |
| static void | release_pins () |
| Deallocates the pin resources. | |
Static Public Attributes | |
| static Pin | IN_0 |
| The GPIO input pin with index 0. | |
| static Pin | OUT_0 |
| The GPIO output pin with index 0. | |
| static Pin | OUT_1 |
| The GPIO output pin with index 1. | |
Interface for the GPIO pins.
Users should use the static pins, such as OUT_0, instead of constructing this object themselves.
|
nodiscard |
Get the current value of the pin.
|
static |
Initializes the hardware to support pin operations.
Must be called before using any of the pin library.
|
static |
Deallocates the pin resources.
Should be done to allow other applications or components to use the pins.
|
nodiscard |
Subscribe to the pin's state changes.