Bluenet
5.7.0
Bluenet, firmware for nRF52 smart home devices
|
#include <cs_Gpio.h>
Public Member Functions | |
void | init (const boards_config_t &board) |
Initialize (from cs_Crownstone as driver) More... | |
void | handleEvent (event_t &event) |
Handle incoming events. More... | |
void | registerEvent (pin_t pin) |
Register event (from event handler) More... | |
![]() | |
EventListener () | |
virtual | ~EventListener () |
unregisters the listener. More... | |
virtual void | handleEvent (event_t &event)=0 |
Handle events. More... | |
void | listen () |
Registers this with the EventDispatcher. More... | |
Static Public Member Functions | |
static Gpio & | getInstance () |
Get singleton instance. More... | |
Private Member Functions | |
Gpio () | |
Constructor. More... | |
Gpio (Gpio const &) | |
This class is a singleton, deny implementation. More... | |
void | operator= (Gpio const &) |
This class is a singleton, deny implementation. More... | |
void | tick () |
Get regular ticks to send events. More... | |
bool | pinExists (uint8_t pin_index) |
Return whether pin exists on board. More... | |
pin_t | getPin (uint8_t pin_index) |
Return physical pin from virtual pin index. More... | |
bool | isLedPin (uint8_t pin_index) |
Return whether pin is a LED. More... | |
cs_ret_code_t | configure (uint8_t pin_index, GpioDirection direction, GpioPullResistor pull, GpioPolarity polarity) |
Configure pin. More... | |
cs_ret_code_t | write (uint8_t pin_index, uint8_t *buf, uint8_t &length) |
Write to pin. More... | |
cs_ret_code_t | read (uint8_t pin_index, uint8_t *buf, uint8_t &length) |
Read from pin. More... | |
Private Attributes | |
pin_info_t | _pins [TOTAL_PIN_COUNT] |
Array of virtual pin info. More... | |
bool | _initialized |
Initialized flag. More... | |
const boards_config_t * | _boardConfig |
Board configuration. More... | |
|
private |
Constructor.
|
private |
This class is a singleton, deny implementation.
|
private |
Configure pin.
|
static |
Get singleton instance.
|
private |
Return physical pin from virtual pin index.
Returns PIN_NONE when it does not exist (for the configured board).
|
virtual |
Handle incoming events.
Implements EventListener.
void Gpio::init | ( | const boards_config_t & | board | ) |
Initialize (from cs_Crownstone as driver)
|
private |
Return whether pin is a LED.
|
private |
This class is a singleton, deny implementation.
|
private |
Return whether pin exists on board.
|
private |
Read from pin.
void Gpio::registerEvent | ( | pin_t | pin | ) |
Register event (from event handler)
|
private |
Get regular ticks to send events.
|
private |
Write to pin.
Write to pin. Assumes pin has been configured as output.
|
private |
Board configuration.
|
private |
Initialized flag.
|
private |
Array of virtual pin info.