PebbleOS v4.47.0-1075-g013613c8a
Loading...
Searching...
No Matches
nRF54L GPIO

GPIO ports of the nRF54L SoCs. More...

Data Structures

struct  pbl_gpio_nrf54l
 nRF54L GPIO port. More...
 

Macros

#define PBL_GPIO_NRF54L_GPIOTE_CHANNELS   8U
 Channels of a GPIOTE.
 
#define PBL_GPIO_NRF54L_DEFINE(sym, _name, _base, _index, _num_pins, ...)
 Define an nRF54L GPIO port, and its interrupt controller, sym_intc, with a GPIOTE.
 

Functions

static uint32_t pbl_gpio_nrf54l_psel (const struct pbl_gpio *gpio)
 Pin select value of a pin, as the peripherals take it.
 

Detailed Description

GPIO ports of the nRF54L SoCs.

A port with a GPIOTE in its power domain carries an Interrupt controller controller whose lines are the pins, backed by the IN channels of that GPIOTE. Lines are edge triggered only.


Data Structure Documentation

◆ pbl_gpio_nrf54l

struct pbl_gpio_nrf54l

nRF54L GPIO port.

Data Fields
uintptr_t base Register base address.
uintptr_t gpiote Registers of the GPIOTE, or 0 without one.
uint8_t index Port number.
pbl_irq_t irq Interrupt line of the GPIOTE.
uint8_t num_channels Number of channels of the GPIOTE.
struct pbl_gpio_port port GPIO port.
struct pbl_gpio_nrf54l_state * state Driver runtime state.

Macro Definition Documentation

◆ PBL_GPIO_NRF54L_DEFINE

#define PBL_GPIO_NRF54L_DEFINE (   sym,
  _name,
  _base,
  _index,
  _num_pins,
  ... 
)
Value:
__VA_OPT__(extern const struct pbl_intc sym##_intc;) \
static struct pbl_gpio_nrf54l_state sym##_nrf54l_state; \
PBL_DEVICE_INSTANCE(sym, struct pbl_gpio_nrf54l, struct pbl_gpio_port, port){ \
.port = \
PBL_GPIO_PORT_INIT(sym, _name, pbl_gpio_nrf54l_init, nullptr, &pbl_gpio_nrf54l_port_ops, \
_num_pins, PBL_GPIO_NRF54L__FIRST(__VA_OPT__(&sym##_intc, ) nullptr)), \
.state = &sym##_nrf54l_state, \
.base = (_base), \
.index = (_index), \
__VA_OPT__(.gpiote = PBL_GPIO_NRF54L__GPIOTE(__VA_ARGS__), \
.irq = PBL_GPIO_NRF54L__IRQ(__VA_ARGS__), \
.num_channels = PBL_GPIO_NRF54L__NCH(__VA_ARGS__), ) \
}; \
__VA_OPT__(PBL_INTC_STATE_DEFINE(sym##_intc, _num_pins); \
PBL_DEVICE_INSTANCE(sym##_intc, struct pbl_gpio_nrf54l_intc, struct pbl_intc, intc){ \
.intc = PBL_INTC_INIT(sym##_intc, _name "_intc", nullptr, &sym##_inst.port.dev, \
&pbl_gpio_nrf54l_intc_ops), \
.port = &sym##_inst, \
}; \
PBL_IRQ_CONNECT_NUM(PBL_GPIO_NRF54L__IRQ(__VA_ARGS__), CONFIG_GPIO_NRF54L_IRQ_PRIO, \
pbl_gpio_nrf54l_irq_handler, &sym##_inst, 0))
#define PBL_DEVICE_STATE_DEFINE(sym)
Define the runtime state of device instance sym.
Definition device.h:132
nRF54L GPIO port.
Definition nrf54l.h:36
A GPIO controller.
Definition gpio.h:101
An interrupt controller.
Definition intc.h:89
#define PBL_INTC_INIT(sym, _name, _init, _parent, _ops)
Initializer for the struct pbl_intc of controller sym.
Definition intc.h:123
#define PBL_INTC_STATE_DEFINE(sym, _num_irqs)
Define the class state of interrupt controller sym, for the driver's define macro.
Definition intc.h:108

Define an nRF54L GPIO port, and its interrupt controller, sym_intc, with a GPIOTE.

Parameters
symSymbol of the port, a struct pbl_gpio_port.
_nameName.
_baseRegisters.
_indexPort number.
_num_pinsNumber of pins.
...Registers, interrupt line and number of channels of the GPIOTE, if the port has one.

◆ PBL_GPIO_NRF54L_GPIOTE_CHANNELS

#define PBL_GPIO_NRF54L_GPIOTE_CHANNELS   8U

Channels of a GPIOTE.

Function Documentation

◆ pbl_gpio_nrf54l_psel()

static uint32_t pbl_gpio_nrf54l_psel ( const struct pbl_gpio *  gpio)
inlinestatic

Pin select value of a pin, as the peripherals take it.

Parameters
gpioPin on an nRF54L port.
Returns
Pin select value.

References PBL_CONTAINER_OF, pbl_gpio::pin, pbl_gpio::port, and pbl_gpio_nrf54l::port.