GPIO abstraction layer RIOT adaption. More...
GPIO abstraction layer RIOT adaption.
Definition in file hal_gpio.h.
#include "periph/gpio.h"
Go to the source code of this file.
Typedefs | |
typedef gpio_mode_t | hal_gpio_pull_t |
hal_gpio_pull type | |
typedef gpio_flank_t | hal_gpio_irq_trig_t |
hal_gpio_irq_trig type | |
typedef gpio_cb_t | hal_gpio_irq_handler_t |
Function proto for GPIO irq handler functions. | |
Enumerations | |
enum | { HAL_GPIO_PULL_NONE = GPIO_IN , HAL_GPIO_PULL_UP = GPIO_IN_PU , HAL_GPIO_PULL_DOWN = GPIO_IN_PD } |
Map hal_gpio_pull_t enum types to gpio_mode_t enum types. More... | |
enum | { HAL_GPIO_TRIG_RISING = GPIO_RISING , HAL_GPIO_TRIG_FALLING = GPIO_FALLING , HAL_GPIO_TRIG_BOTH = GPIO_BOTH } |
Map hal_gpio_irq_trig_t enum types to gpio_flank_t enum types. More... | |
Functions | |
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_init_out (gpio_t pin, int val) |
Initialize the specified pin as an output, setting the pin to the specified value. | |
static void | hal_gpio_write (gpio_t pin, int val) |
Write a value (either high or low) to the specified pin. | |
static int | hal_gpio_read (gpio_t pin) |
Reads the specified pin. | |
static int | hal_gpio_toggle (gpio_t pin) |
Toggles the specified pin. | |
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_release (gpio_t pin) |
Release a pin from being configured to trigger IRQ on state change. | |
static void | hal_gpio_irq_enable (gpio_t pin) |
Enable IRQs on the passed pin. | |
static void | hal_gpio_irq_disable (gpio_t pin) |
Disable IRQs on the passed pin. | |
typedef gpio_cb_t hal_gpio_irq_handler_t |
Function proto for GPIO irq handler functions.
Definition at line 75 of file hal_gpio.h.
typedef gpio_flank_t hal_gpio_irq_trig_t |
hal_gpio_irq_trig type
Definition at line 70 of file hal_gpio.h.
typedef gpio_mode_t hal_gpio_pull_t |
hal_gpio_pull type
Definition at line 43 of file hal_gpio.h.
anonymous enum |
Map hal_gpio_pull_t enum types to gpio_mode_t enum types.
Enumerator | |
---|---|
HAL_GPIO_PULL_NONE | Pull-up/down not enabled. |
HAL_GPIO_PULL_UP | Pull-up enabled. |
HAL_GPIO_PULL_DOWN | Pull-down enabled. |
Definition at line 32 of file hal_gpio.h.
anonymous enum |
Map hal_gpio_irq_trig_t enum types to gpio_flank_t enum types.
Enumerator | |
---|---|
HAL_GPIO_TRIG_RISING | IRQ occurs on rising edge. |
HAL_GPIO_TRIG_FALLING | IRQ occurs on falling edge. |
HAL_GPIO_TRIG_BOTH | IRQ occurs on either edge. |
Definition at line 48 of file hal_gpio.h.
|
inlinestatic |
Initializes the specified pin as an input.
pin | Pin number to set as input |
pull | pull type |
Definition at line 85 of file hal_gpio.h.
|
inlinestatic |
Initialize the specified pin as an output, setting the pin to the specified value.
pin | Pin number to set as output |
val | Value to set pin |
Definition at line 99 of file hal_gpio.h.
|
inlinestatic |
Disable IRQs on the passed pin.
pin | The pin to disable IRQs on |
Definition at line 188 of file hal_gpio.h.
|
inlinestatic |
Enable IRQs on the passed pin.
pin | The pin to enable IRQs on |
Definition at line 178 of file hal_gpio.h.
|
inlinestatic |
Initialize a given pin to trigger a GPIO IRQ callback.
pin | The pin to trigger GPIO interrupt on |
handler | The handler function to call |
arg | The argument to provide to the IRQ handler |
trig | The trigger mode (e.g. rising, falling) |
pull | The mode of the pin (e.g. pullup, pulldown) |
Definition at line 153 of file hal_gpio.h.
|
inlinestatic |
Release a pin from being configured to trigger IRQ on state change.
pin | The pin to release |
Definition at line 167 of file hal_gpio.h.
|
inlinestatic |
Reads the specified pin.
pin | Pin number to read |
Definition at line 124 of file hal_gpio.h.
|
inlinestatic |
Toggles the specified pin.
pin | Pin number to toggle |
Definition at line 136 of file hal_gpio.h.
|
inlinestatic |
Write a value (either high or low) to the specified pin.
pin | Pin to set |
val | Value to set pin (0:low 1:high) |
Definition at line 112 of file hal_gpio.h.