PebbleOS v4.47.0-1312-gf1984a001
Loading...
Searching...
No Matches
nRF54L GPIOTE

GPIO tasks and events of the nRF54L SoCs. More...

Data Structures

struct  pbl_gpio_nrf54l_gpiote_channel
 Owner of a GPIOTE channel. More...
 
struct  pbl_gpio_nrf54l_gpiote_state
 GPIOTE state. More...
 
struct  pbl_gpio_nrf54l_gpiote
 nRF54L GPIOTE. More...
 

Macros

#define PBL_GPIO_NRF54L_GPIOTE_CHANNELS   8U
 Most channels of a GPIOTE.
 
#define PBL_GPIO_NRF54L_GPIOTE_DEFINE(sym, _name, _base, _irq, _num_channels)
 Define an nRF54L GPIOTE.
 

Functions

int pbl_gpio_nrf54l_gpiote_configure (const struct pbl_gpio_nrf54l_gpiote *gpiote, const struct pbl_intc *intc, uint32_t hwirq, uint32_t port, uint32_t pin, uint32_t type)
 Bind a channel to a pin, for a line of an interrupt controller.
 
int pbl_gpio_nrf54l_gpiote_enable (const struct pbl_gpio_nrf54l_gpiote *gpiote, const struct pbl_intc *intc, uint32_t hwirq)
 Raise the events of the channel of a line.
 
int pbl_gpio_nrf54l_gpiote_disable (const struct pbl_gpio_nrf54l_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_nrf54l_gpiote_free (const struct pbl_gpio_nrf54l_gpiote *gpiote, const struct pbl_intc *intc, uint32_t hwirq)
 Unbind the channel of a line, leaving it to others.
 

Detailed Description

GPIO tasks and events of the nRF54L SoCs.

Its channels raise the interrupt lines of the controllers of the GPIO ports that refer to it.


Data Structure Documentation

◆ pbl_gpio_nrf54l_gpiote_channel

struct pbl_gpio_nrf54l_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.

◆ pbl_gpio_nrf54l_gpiote_state

struct pbl_gpio_nrf54l_gpiote_state

GPIOTE state.

Data Fields
struct pbl_gpio_nrf54l_gpiote_channel channels[PBL_GPIO_NRF54L_GPIOTE_CHANNELS] Owner of each channel.

◆ pbl_gpio_nrf54l_gpiote

struct pbl_gpio_nrf54l_gpiote

nRF54L GPIOTE.

Data Fields
uintptr_t base Registers.
struct pbl_device dev Device.
pbl_irq_t irq Interrupt.
uint8_t num_channels Number of channels.
struct pbl_gpio_nrf54l_gpiote_state * state State.

Macro Definition Documentation

◆ PBL_GPIO_NRF54L_GPIOTE_CHANNELS

#define PBL_GPIO_NRF54L_GPIOTE_CHANNELS   8U

Most channels of a GPIOTE.

◆ PBL_GPIO_NRF54L_GPIOTE_DEFINE

#define PBL_GPIO_NRF54L_GPIOTE_DEFINE (   sym,
  _name,
  _base,
  _irq,
  _num_channels 
)
Value:
static struct pbl_gpio_nrf54l_gpiote_state sym##_gpiote_state; \
const struct pbl_gpio_nrf54l_gpiote sym = { \
.dev = PBL_DEVICE_INIT(sym, _name, pbl_gpio_nrf54l_gpiote_init, nullptr), \
.state = &sym##_gpiote_state, \
.base = (_base), \
.irq = (_irq), \
.num_channels = (_num_channels), \
}; \
PBL_DEVICE_REGISTER(sym, &sym.dev); \
PBL_IRQ_CONNECT_NUM(_irq, CONFIG_GPIO_NRF54L_GPIOTE_IRQ_PRIO, \
pbl_gpio_nrf54l_gpiote_irq_handler, &sym, 0)
#define PBL_DEVICE_INIT(sym, _name, _init, _parent)
Initializer for the struct pbl_device of device instance sym.
Definition device.h:169
#define PBL_DEVICE_STATE_DEFINE(sym)
Define the runtime state of device instance sym.
Definition device.h:132
uintptr_t base
Registers.
Definition nrf54l_gpiote.h:45
struct pbl_device dev
Device.
Definition nrf54l_gpiote.h:41
pbl_irq_t irq
Interrupt.
Definition nrf54l_gpiote.h:47
GPIOTE state.
Definition nrf54l_gpiote.h:33
nRF54L GPIOTE.
Definition nrf54l_gpiote.h:39
struct pbl_device_state * state
Runtime state.
Definition device.h:102

Define an nRF54L GPIOTE.

Parameters
symSymbol.
_nameName.
_baseRegisters.
_irqInterrupt.
_num_channelsNumber of channels.

Function Documentation

◆ pbl_gpio_nrf54l_gpiote_configure()

int pbl_gpio_nrf54l_gpiote_configure ( const struct pbl_gpio_nrf54l_gpiote *  gpiote,
const struct pbl_intc *  intc,
uint32_t  hwirq,
uint32_t  port,
uint32_t  pin,
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.

Parameters
gpioteGPIOTE.
intcController of the line.
hwirqLine.
portPort number of the pin.
pinPin.
typeEdge, PBL_IRQ_TYPE_EDGE_*.
Returns
0, -ENOTSUP for a level or -ENOMEM if all channels are in use.

◆ pbl_gpio_nrf54l_gpiote_disable()

int pbl_gpio_nrf54l_gpiote_disable ( const struct pbl_gpio_nrf54l_gpiote *  gpiote,
const struct pbl_intc *  intc,
uint32_t  hwirq 
)

Stop the events of the channel of a line, leaving its input unsensed.

Parameters
gpioteGPIOTE.
intcController of the line.
hwirqLine.
Returns
0 or -EINVAL if the line has no channel.

◆ pbl_gpio_nrf54l_gpiote_enable()

int pbl_gpio_nrf54l_gpiote_enable ( const struct pbl_gpio_nrf54l_gpiote *  gpiote,
const struct pbl_intc *  intc,
uint32_t  hwirq 
)

Raise the events of the channel of a line.

Parameters
gpioteGPIOTE.
intcController of the line.
hwirqLine.
Returns
0 or -EINVAL if the line has no channel.

◆ pbl_gpio_nrf54l_gpiote_free()

void pbl_gpio_nrf54l_gpiote_free ( const struct pbl_gpio_nrf54l_gpiote *  gpiote,
const struct pbl_intc *  intc,
uint32_t  hwirq 
)

Unbind the channel of a line, leaving it to others.

Parameters
gpioteGPIOTE.
intcController of the line.
hwirqLine.