GPIO abstraction layer RIOT adaption.
More...
Go to the source code of this file.
◆ 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 31 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 47 of file hal_gpio.h.
◆ hal_gpio_init_in()
Initializes the specified pin as an input.
- Parameters
-
| pin | Pin number to set as input |
| pull | pull type |
- Returns
- int 0: no error; -1 otherwise.
Definition at line 84 of file hal_gpio.h.
◆ hal_gpio_init_out()
| static int hal_gpio_init_out |
( |
gpio_t |
pin, |
|
|
int |
val |
|
) |
| |
|
inlinestatic |
Initialize the specified pin as an output, setting the pin to the specified value.
- Parameters
-
| pin | Pin number to set as output |
| val | Value to set pin |
- Returns
- int 0: no error; -1 otherwise.
Definition at line 98 of file hal_gpio.h.
◆ hal_gpio_irq_disable()
| static void hal_gpio_irq_disable |
( |
gpio_t |
pin | ) |
|
|
inlinestatic |
Disable IRQs on the passed pin.
- Parameters
-
| pin | The pin to disable IRQs on |
Definition at line 187 of file hal_gpio.h.
◆ hal_gpio_irq_enable()
| static void hal_gpio_irq_enable |
( |
gpio_t |
pin | ) |
|
|
inlinestatic |
Enable IRQs on the passed pin.
- Parameters
-
| pin | The pin to enable IRQs on |
Definition at line 177 of file hal_gpio.h.
◆ hal_gpio_irq_init()
Initialize a given pin to trigger a GPIO IRQ callback.
- Parameters
-
| 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) |
- Returns
- 0 on success, non-zero error code on failure.
Definition at line 152 of file hal_gpio.h.
◆ hal_gpio_irq_release()
| static void hal_gpio_irq_release |
( |
gpio_t |
pin | ) |
|
|
inlinestatic |
Release a pin from being configured to trigger IRQ on state change.
- Parameters
-
Definition at line 166 of file hal_gpio.h.
◆ hal_gpio_read()
| static int hal_gpio_read |
( |
gpio_t |
pin | ) |
|
|
inlinestatic |
Reads the specified pin.
- Parameters
-
- Returns
- int 0: low, 1: high
Definition at line 123 of file hal_gpio.h.
◆ hal_gpio_toggle()
| static int hal_gpio_toggle |
( |
gpio_t |
pin | ) |
|
|
inlinestatic |
Toggles the specified pin.
- Parameters
-
- Returns
- current gpio state int 0: low, 1: high
Definition at line 135 of file hal_gpio.h.
◆ hal_gpio_write()
| static void hal_gpio_write |
( |
gpio_t |
pin, |
|
|
int |
val |
|
) |
| |
|
inlinestatic |
Write a value (either high or low) to the specified pin.
- Parameters
-
| pin | Pin to set |
| val | Value to set pin (0:low 1:high) |
Definition at line 111 of file hal_gpio.h.