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

GPIO ports of the SF32LB SoCs. More...

Data Structures

struct  pbl_gpio_sf32lb
 SF32LB GPIO port. More...
 

Macros

#define PBL_GPIO_SF32LB52_DEFINE(sym, _name, _base, _irq, _clk, _num_pins, _aon, _pmuc)
 Define an SF32LB52 GPIO port and its interrupt controller, sym_intc.
 
#define PBL_GPIO_SF32LB57_DEFINE(sym, _name, _base, _irq, _clk, _num_pins, _pmuc)
 Define an SF32LB57 GPIO port and its interrupt controller, sym_intc.
 

Detailed Description

GPIO ports of the SF32LB SoCs.

Each port carries an Interrupt controller controller whose lines are the pins.


Data Structure Documentation

◆ pbl_gpio_sf32lb

struct pbl_gpio_sf32lb

SF32LB GPIO port.

Data Fields
uintptr_t aon HPSYS always-on block base address, where wakeup pins latch.
uintptr_t base Register base address.
struct pbl_clk clk Clock.
pbl_irq_t irq Interrupt line.
const struct pbl_gpio_sf32lb_pads * pads Pads of the series.
uintptr_t pmuc PMU base address, whose wake pins wake the SF32LB52 from hibernate.
struct pbl_gpio_port port GPIO port.
struct pbl_gpio_sf32lb_state * state Runtime state.

Macro Definition Documentation

◆ PBL_GPIO_SF32LB52_DEFINE

#define PBL_GPIO_SF32LB52_DEFINE (   sym,
  _name,
  _base,
  _irq,
  _clk,
  _num_pins,
  _aon,
  _pmuc 
)
Value:
extern const struct pbl_intc sym##_intc; \
static struct pbl_gpio_sf32lb_state sym##_sf32lb_state; \
PBL_DEVICE_STATE_DEFINE(sym); \
PBL_INTC_STATE_DEFINE(sym##_intc, _num_pins); \
PBL_DEVICE_INSTANCE(sym, struct pbl_gpio_sf32lb, struct pbl_gpio_port, port){ \
.port = PBL_GPIO_PORT_INIT(sym, _name, pbl_gpio_sf32lb_init, nullptr, \
&pbl_gpio_sf32lb_port_ops, _num_pins, &sym##_intc), \
.pads = &pbl_gpio_sf32lb52_pads, \
.base = (_base), \
.irq = (_irq), \
.clk = _clk, \
.aon = (_aon), \
.pmuc = (_pmuc), \
.state = &sym##_sf32lb_state, \
}; \
PBL_DEVICE_INSTANCE(sym##_intc, struct pbl_gpio_sf32lb_intc, struct pbl_intc, intc){ \
.intc = PBL_INTC_INIT(sym##_intc, _name "_intc", nullptr, &sym##_inst.port.dev, \
&pbl_gpio_sf32lb_intc_ops), \
.port = &sym##_inst, \
}; \
PBL_IRQ_CONNECT_NUM(_irq, CONFIG_GPIO_SF32LB_IRQ_PRIO, pbl_gpio_sf32lb_irq_handler, &sym##_inst, \
0)
SF32LB GPIO port.
Definition sf32lb.h:31
A GPIO controller.
Definition gpio.h:101
#define PBL_GPIO_PORT_INIT(sym, _name, _init, _parent, _ops, _num_pins, _intc)
Initializer for a struct pbl_gpio_port.
Definition gpio.h:123
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 an SF32LB52 GPIO port and its interrupt controller, sym_intc.

Parameters
symSymbol of the port, a struct pbl_gpio_port.
_nameName.
_baseRegisters.
_irqInterrupt line, a plain number.
_clkClock, from PBL_CLK().
_num_pinsNumber of pins.
_aonRegisters of the HPSYS always-on block, where the wake pins latch.
_pmucRegisters of the PMU, whose wake pins wake the SoC from hibernate.

◆ PBL_GPIO_SF32LB57_DEFINE

#define PBL_GPIO_SF32LB57_DEFINE (   sym,
  _name,
  _base,
  _irq,
  _clk,
  _num_pins,
  _pmuc 
)
Value:
extern const struct pbl_intc sym##_intc; \
static struct pbl_gpio_sf32lb_state sym##_sf32lb_state; \
PBL_DEVICE_STATE_DEFINE(sym); \
PBL_INTC_STATE_DEFINE(sym##_intc, _num_pins); \
PBL_DEVICE_INSTANCE(sym, struct pbl_gpio_sf32lb, struct pbl_gpio_port, port){ \
.port = PBL_GPIO_PORT_INIT(sym, _name, pbl_gpio_sf32lb_init, nullptr, \
&pbl_gpio_sf32lb_port_ops, _num_pins, &sym##_intc), \
.pads = &pbl_gpio_sf32lb57_pads, \
.base = (_base), \
.irq = (_irq), \
.clk = _clk, \
.aon = (0U), \
.pmuc = (_pmuc), \
.state = &sym##_sf32lb_state, \
}; \
PBL_DEVICE_INSTANCE(sym##_intc, struct pbl_gpio_sf32lb_intc, struct pbl_intc, intc){ \
.intc = PBL_INTC_INIT(sym##_intc, _name "_intc", nullptr, &sym##_inst.port.dev, \
&pbl_gpio_sf32lb_intc_ops), \
.port = &sym##_inst, \
}; \
PBL_IRQ_CONNECT_NUM(_irq, CONFIG_GPIO_SF32LB_IRQ_PRIO, pbl_gpio_sf32lb_irq_handler, &sym##_inst, \
0)

Define an SF32LB57 GPIO port and its interrupt controller, sym_intc.

Parameters
symSymbol of the port, a struct pbl_gpio_port.
_nameName.
_baseRegisters.
_irqInterrupt line, a plain number.
_clkClock, from PBL_CLK().
_num_pinsNumber of pins.
_pmucRegisters of the PMU, whose wake pins wake the SoC from hibernate.