General Purpose I/O control.
Definition gpio.h:22
void DeInit()
Deinitializes the GPIO pin.
void Init(Pin p, const Config &cfg)
Initialize the GPIO with a Configuration struct, and explicit pin.
void Write(bool state)
Changes the state of the GPIO hardware when configured as an OUTPUT.
void Init(const Config &cfg)
Initialize the GPIO from a Config struct.
GPIO()
Definition gpio.h:74
bool Read()
Reads the state of the GPIO.
Pull
Configures whether an internal Pull up or Pull down resistor is used.
Definition gpio.h:42
Speed
Output speed controls the drive strength, and slew rate of the pin.
Definition gpio.h:50
void Init(Pin p, Mode m=Mode::INPUT, Pull pu=Pull::NOPULL, Speed sp=Speed::LOW)
Explicity initialize all configuration for the GPIO.
Config & GetConfig()
Definition gpio.h:118
void Toggle()
flips the current state of the GPIO. If it was HIGH, it will go LOW, and vice versa.
Mode
Mode of operation for the specified GPIO.
Definition gpio.h:26
Definition leddriver.h:33
void dsy_gpio_write(const dsy_gpio *p, uint8_t state)
dsy_gpio_mode
Definition gpio.h:157
void dsy_gpio_deinit(const dsy_gpio *p)
void dsy_gpio_init(const dsy_gpio *p)
uint8_t dsy_gpio_read(const dsy_gpio *p)
dsy_gpio_pull
Definition gpio.h:167
void dsy_gpio_toggle(const dsy_gpio *p)
@ DSY_GPIO_MODE_INPUT
Definition gpio.h:158
@ DSY_GPIO_MODE_ANALOG
Definition gpio.h:161
@ DSY_GPIO_MODE_OUTPUT_OD
Definition gpio.h:160
@ DSY_GPIO_MODE_LAST
Definition gpio.h:162
@ DSY_GPIO_MODE_OUTPUT_PP
Definition gpio.h:159
@ DSY_GPIO_PULLDOWN
Definition gpio.h:170
@ DSY_GPIO_PULLUP
Definition gpio.h:169
@ DSY_GPIO_NOPULL
Definition gpio.h:168
Hardware defines and helpers for daisy field platform.
Definition index.h:2
Configuration for a given GPIO.
Definition gpio.h:59
Pull pull
Definition gpio.h:62
Speed speed
Definition gpio.h:63
Mode mode
Definition gpio.h:61
Config()
Definition gpio.h:68
Pin pin
Definition gpio.h:60
representation of hardware port/pin combination
Definition daisy_core.h:261
Definition daisy_core.h:205
dsy_gpio_mode mode
Definition gpio.h:177
dsy_gpio_pin pin
Definition gpio.h:176
dsy_gpio_pull pull
Definition gpio.h:178