|
PebbleOS v4.47.0-1312-gf1984a001
|
GPIO tasks and events of the nRF5 SoCs. More...
Data Structures | |
| struct | pbl_gpio_nrf5_gpiote_channel |
| Owner of a GPIOTE channel. More... | |
| struct | pbl_gpio_nrf5_gpiote_state |
| GPIOTE state. More... | |
| struct | pbl_gpio_nrf5_gpiote |
| nRF5 GPIOTE. More... | |
Macros | |
| #define | PBL_GPIO_NRF5_GPIOTE_CHANNELS 8U |
| Number of GPIOTE channels. | |
| #define | PBL_GPIO_NRF5_GPIOTE_DEFINE(sym, _name, _base, _irq) |
| Define an nRF5 GPIOTE. | |
Functions | |
| int | pbl_gpio_nrf5_gpiote_alloc (const struct pbl_gpio_nrf5_gpiote *gpiote, uint8_t *channel) |
| Allocate a channel for the tasks of a driver. | |
| void | pbl_gpio_nrf5_gpiote_task_configure (const struct pbl_gpio_nrf5_gpiote *gpiote, uint8_t channel, uint32_t psel) |
| Drive a pin from the tasks of an allocated channel. | |
| void | pbl_gpio_nrf5_gpiote_task_trigger (const struct pbl_gpio_nrf5_gpiote *gpiote, uint8_t channel, bool high) |
| Drive the pin of a task channel high or low. | |
| uintptr_t | pbl_gpio_nrf5_gpiote_task_addr (const struct pbl_gpio_nrf5_gpiote *gpiote, uint8_t channel, bool high) |
| Address of the task driving the pin of a task channel high or low, for PPI. | |
| int | pbl_gpio_nrf5_gpiote_configure (const struct pbl_gpio_nrf5_gpiote *gpiote, const struct pbl_intc *intc, uint32_t hwirq, uint32_t psel, uint32_t type) |
| Bind a channel to a pin, for a line of an interrupt controller. | |
| int | pbl_gpio_nrf5_gpiote_enable (const struct pbl_gpio_nrf5_gpiote *gpiote, const struct pbl_intc *intc, uint32_t hwirq) |
| Raise the events of the channel of a line. | |
| int | pbl_gpio_nrf5_gpiote_disable (const struct pbl_gpio_nrf5_gpiote *gpiote, const struct pbl_intc *intc, uint32_t hwirq) |
| Stop the events of the channel of a line, leaving its input unsensed. | |
| void | pbl_gpio_nrf5_gpiote_free (const struct pbl_gpio_nrf5_gpiote *gpiote, const struct pbl_intc *intc, uint32_t hwirq) |
| Unbind the channel of a line, leaving it to others. | |
GPIO tasks and events of the nRF5 SoCs.
Its channels raise the interrupt lines of the GPIO ports' controllers, and drive pins from tasks for other drivers.
| struct pbl_gpio_nrf5_gpiote_channel |
Owner of a GPIOTE channel.
| Data Fields | ||
|---|---|---|
| uint8_t | hwirq | Line of the controller. |
| const struct pbl_intc * | intc | Controller of the line, nullptr when free or reserved. |
| bool | reserved | Whether a driver reserved the channel for its tasks. |
| struct pbl_gpio_nrf5_gpiote_state |
GPIOTE state.
| Data Fields | ||
|---|---|---|
| struct pbl_gpio_nrf5_gpiote_channel | channels[PBL_GPIO_NRF5_GPIOTE_CHANNELS] | Owner of each channel. |
| struct pbl_gpio_nrf5_gpiote |
nRF5 GPIOTE.
| Data Fields | ||
|---|---|---|
| uintptr_t | base | Registers. |
| struct pbl_device | dev | Device. |
| pbl_irq_t | irq | Interrupt. |
| struct pbl_gpio_nrf5_gpiote_state * | state | State. |
| #define PBL_GPIO_NRF5_GPIOTE_CHANNELS 8U |
Number of GPIOTE channels.
| #define PBL_GPIO_NRF5_GPIOTE_DEFINE | ( | sym, | |
| _name, | |||
| _base, | |||
| _irq | |||
| ) |
Define an nRF5 GPIOTE.
| sym | Symbol. |
| _name | Name. |
| _base | Registers. |
| _irq | Interrupt. |
| int pbl_gpio_nrf5_gpiote_alloc | ( | const struct pbl_gpio_nrf5_gpiote * | gpiote, |
| uint8_t * | channel | ||
| ) |
Allocate a channel for the tasks of a driver.
| gpiote | GPIOTE. | |
| [out] | channel | Allocated channel. |
-ENOMEM if all channels are in use. | int pbl_gpio_nrf5_gpiote_configure | ( | const struct pbl_gpio_nrf5_gpiote * | gpiote, |
| const struct pbl_intc * | intc, | ||
| uint32_t | hwirq, | ||
| uint32_t | psel, | ||
| uint32_t | type | ||
| ) |
Bind a channel to a pin, for a line of an interrupt controller.
The channel stays allocated to the line until it is freed.
| gpiote | GPIOTE. |
| intc | Controller of the line. |
| hwirq | Line. |
| psel | Absolute pin. |
| type | Edge, PBL_IRQ_TYPE_EDGE_*. |
-ENOTSUP for a level or -ENOMEM if all channels are in use. | int pbl_gpio_nrf5_gpiote_disable | ( | const struct pbl_gpio_nrf5_gpiote * | gpiote, |
| const struct pbl_intc * | intc, | ||
| uint32_t | hwirq | ||
| ) |
Stop the events of the channel of a line, leaving its input unsensed.
| gpiote | GPIOTE. |
| intc | Controller of the line. |
| hwirq | Line. |
-EINVAL if the line has no channel. | int pbl_gpio_nrf5_gpiote_enable | ( | const struct pbl_gpio_nrf5_gpiote * | gpiote, |
| const struct pbl_intc * | intc, | ||
| uint32_t | hwirq | ||
| ) |
Raise the events of the channel of a line.
| gpiote | GPIOTE. |
| intc | Controller of the line. |
| hwirq | Line. |
-EINVAL if the line has no channel. | void pbl_gpio_nrf5_gpiote_free | ( | const struct pbl_gpio_nrf5_gpiote * | gpiote, |
| const struct pbl_intc * | intc, | ||
| uint32_t | hwirq | ||
| ) |
Unbind the channel of a line, leaving it to others.
| gpiote | GPIOTE. |
| intc | Controller of the line. |
| hwirq | Line. |
| uintptr_t pbl_gpio_nrf5_gpiote_task_addr | ( | const struct pbl_gpio_nrf5_gpiote * | gpiote, |
| uint8_t | channel, | ||
| bool | high | ||
| ) |
Address of the task driving the pin of a task channel high or low, for PPI.
| gpiote | GPIOTE. |
| channel | Task channel. |
| high | Whether the task drives it high. |
| void pbl_gpio_nrf5_gpiote_task_configure | ( | const struct pbl_gpio_nrf5_gpiote * | gpiote, |
| uint8_t | channel, | ||
| uint32_t | psel | ||
| ) |
Drive a pin from the tasks of an allocated channel.
| gpiote | GPIOTE. |
| channel | Channel from pbl_gpio_nrf5_gpiote_alloc(). |
| psel | Absolute pin. |
| void pbl_gpio_nrf5_gpiote_task_trigger | ( | const struct pbl_gpio_nrf5_gpiote * | gpiote, |
| uint8_t | channel, | ||
| bool | high | ||
| ) |
Drive the pin of a task channel high or low.
| gpiote | GPIOTE. |
| channel | Task channel. |
| high | Whether to drive it high. |