16#define TOTAL_PIN_COUNT GPIO_INDEX_COUNT + BUTTON_COUNT + LED_COUNT
Event listener.
Definition: cs_EventListener.h:17
static Gpio & getInstance()
Get singleton instance.
void tick()
Get regular ticks to send events.
const boards_config_t * _boardConfig
Board configuration.
Definition: cs_Gpio.h:91
cs_ret_code_t read(uint8_t pin_index, uint8_t *buf, uint8_t &length)
Read from pin.
pin_t getPin(uint8_t pin_index)
Return physical pin from virtual pin index.
cs_ret_code_t configure(uint8_t pin_index, GpioDirection direction, GpioPullResistor pull, GpioPolarity polarity)
Configure pin.
cs_ret_code_t write(uint8_t pin_index, uint8_t *buf, uint8_t &length)
Write to pin.
void registerEvent(pin_t pin)
Register event (from event handler)
bool pinExists(uint8_t pin_index)
Return whether pin exists on board.
Gpio(Gpio const &)
This class is a singleton, deny implementation.
bool isLedPin(uint8_t pin_index)
Return whether pin is a LED.
void operator=(Gpio const &)
This class is a singleton, deny implementation.
pin_info_t _pins[TOTAL_PIN_COUNT]
Array of virtual pin info.
Definition: cs_Gpio.h:60
bool _initialized
Initialized flag.
Definition: cs_Gpio.h:88
void handleEvent(event_t &event)
Handle incoming events.
void init(const boards_config_t &board)
Initialize (from cs_Crownstone as driver)
Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: Oct 9,...
Definition: cs_Event.h:26
#define TOTAL_PIN_COUNT
Definition: cs_Gpio.h:16
GpioDirection
Definition: cs_Gpio.h:20
@ OUTPUT
Definition: cs_Gpio.h:20
@ SENSE
Definition: cs_Gpio.h:20
@ INPUT
Definition: cs_Gpio.h:20
GpioPolarity
Definition: cs_Gpio.h:24
@ TOGGLE
Definition: cs_Gpio.h:24
@ LOTOHI
Definition: cs_Gpio.h:24
@ HITOLO
Definition: cs_Gpio.h:24
GpioPullResistor
Definition: cs_Gpio.h:22
@ DOWN
Definition: cs_Gpio.h:22
@ UP
Definition: cs_Gpio.h:22
@ NONE
Definition: cs_Gpio.h:22
uint8_t pin_t
Definition: cs_Gpio.h:18
uint16_t cs_ret_code_t
Definition: cs_Typedefs.h:21
Board configuration.
Definition: cs_Boards.h:169
uint8_t direction
Definition: cs_Gpio.h:28
bool event
Definition: cs_Gpio.h:27