Gpio#
- group bsp_gpio
GPIO management.
- Author
Alexandre Abadie alexandre.abadie@inria.fr
- Copyright
Inria, 2022-2023
Defines
-
DB_GPIO_ENABLE(port, pin)#
Enable a pin as output.
Enable a pin as output, must be called once before using the other macros below
-
DB_GPIO_ON(port, pin)#
Turn on the pin.
-
DB_GPIO_OFF(port, pin)#
Turn off the pin.
-
DB_GPIO_TOGGLE(port, pin)#
Toggle the pin.
Typedefs
-
typedef void (*gpio_cb_t)(void *ctx)#
Callback function prototype, it is called on each gpio interrupt.
Enums
Functions
-
void db_gpio_init(const gpio_t *gpio, gpio_mode_t mode)#
Initialize a GPIO.
- Parameters:
gpio – [in] Pointer to the GPIO descriptor
mode – [in] GPIO mode (output, input, etc)
-
void db_gpio_init_irq(const gpio_t *gpio, gpio_mode_t mode, gpio_irq_edge_t edge, gpio_cb_t callback, void *ctx)#
Initialize a GPIO with IRQ.
- Parameters:
gpio – [in] Pointer to the GPIO descriptor
mode – [in] GPIO mode, should one flavor of input
edge – [in] Type of edge to trigger the IRQ (Falling, Rising or both)
callback – [in] Function pointer that is called from gpio ISR
ctx – [in] Pointer to some context passed as parameter to the callback
-
void db_gpio_set(const gpio_t *gpio)#
Set the GPIO output high.
- Parameters:
gpio – [in] Pointer to the GPIO descriptor
-
void db_gpio_clear(const gpio_t *gpio)#
Set the GPIO output low.
- Parameters:
gpio – [in] Pointer to the GPIO descriptor
Variables
-
static NRF_GPIO_Type *nrf_port[2] = {NRF_P0, NRF_P1}#
-
struct gpio_t#
GPIO instance.