50 HAL_GPIO_TRIG_NONE = GPIO_NONE,
60 HAL_GPIO_TRIG_LOW = GPIO_LOW,
64 HAL_GPIO_TRIG_HIGH = GPIO_HIGH
@ GPIO_OUT
select GPIO MASK as output
@ GPIO_IN
select GPIO MASK as input
Low-level GPIO peripheral driver interface definitions.
void gpio_toggle(gpio_t pin)
Toggle the value of the given pin.
void(* gpio_cb_t)(void *arg)
Signature of event callback functions triggered from interrupts.
void gpio_write(gpio_t pin, bool value)
Set the given pin to the given value.
int gpio_init_int(gpio_t pin, gpio_mode_t mode, gpio_flank_t flank, gpio_cb_t cb, void *arg)
Initialize a GPIO pin for external interrupt usage.
void gpio_irq_disable(gpio_t pin)
Disable the pin interrupt if configured as interrupt source.
void gpio_irq_enable(gpio_t pin)
Enable pin interrupt if configured as interrupt source.
bool gpio_read(gpio_t pin)
Get the current value of the given pin.
int gpio_init(gpio_t pin, gpio_mode_t mode)
Initialize the given pin as general purpose input or output.
@ HAL_GPIO_PULL_NONE
Pull-up/down not enabled.
@ HAL_GPIO_PULL_DOWN
Pull-down enabled.
@ HAL_GPIO_PULL_UP
Pull-up enabled.
static int hal_gpio_init_in(gpio_t pin, hal_gpio_pull_t pull)
Initializes the specified pin as an input.
static int hal_gpio_irq_init(gpio_t pin, hal_gpio_irq_handler_t handler, void *arg, hal_gpio_irq_trig_t trig, hal_gpio_pull_t pull)
Initialize a given pin to trigger a GPIO IRQ callback.
static void hal_gpio_irq_enable(gpio_t pin)
Enable IRQs on the passed pin.
static void hal_gpio_irq_release(gpio_t pin)
Release a pin from being configured to trigger IRQ on state change.
static int hal_gpio_read(gpio_t pin)
Reads the specified pin.
gpio_cb_t hal_gpio_irq_handler_t
Function proto for GPIO irq handler functions.
static void hal_gpio_write(gpio_t pin, int val)
Write a value (either high or low) to the specified pin.
gpio_flank_t hal_gpio_irq_trig_t
hal_gpio_irq_trig type
static int hal_gpio_toggle(gpio_t pin)
Toggles the specified pin.
static int hal_gpio_init_out(gpio_t pin, int val)
Initialize the specified pin as an output, setting the pin to the specified value.
@ HAL_GPIO_TRIG_FALLING
IRQ occurs on falling edge.
@ HAL_GPIO_TRIG_RISING
IRQ occurs on rising edge.
@ HAL_GPIO_TRIG_BOTH
IRQ occurs on either edge.
static void hal_gpio_irq_disable(gpio_t pin)
Disable IRQs on the passed pin.
gpio_mode_t hal_gpio_pull_t
hal_gpio_pull type
gpio_mode_t
Available pin modes.