PebbleOS v4.48.0-75-g7416f78a1
Loading...
Searching...
No Matches
nPM1300 GPIO

GPIO port over the five GPIOs of the nPM1300, a cell of nPM1300. More...

Data Structures

struct  pbl_gpio_npm1300
 nPM1300 GPIO port. More...
 

Macros

#define NPM1300_GPIO_NUM_PINS   5U
 Number of GPIOs.
 
#define PBL_GPIO_NPM1300_DEFINE(sym, _pmic)
 Define the GPIO port.
 

Detailed Description

GPIO port over the five GPIOs of the nPM1300, a cell of nPM1300.

A pin's pull-up is only enabled while it drives high.


Data Structure Documentation

◆ pbl_gpio_npm1300

struct pbl_gpio_npm1300

nPM1300 GPIO port.

Data Fields
struct pbl_gpio_port port GPIO port, child of the core.
struct pbl_gpio_npm1300_state * state Runtime state.

Macro Definition Documentation

◆ NPM1300_GPIO_NUM_PINS

#define NPM1300_GPIO_NUM_PINS   5U

Number of GPIOs.

◆ PBL_GPIO_NPM1300_DEFINE

#define PBL_GPIO_NPM1300_DEFINE (   sym,
  _pmic 
)
Value:
static struct pbl_gpio_npm1300_state sym##_npm1300_gpio_state; \
PBL_DEVICE_INSTANCE(sym, struct pbl_gpio_npm1300, struct pbl_gpio_port, port) { \
.port = PBL_GPIO_PORT_INIT(sym, "npm1300_gpio", nullptr, &(_pmic)->dev, &pbl_gpio_npm1300_ops, \
NPM1300_GPIO_NUM_PINS, nullptr), \
.state = &sym##_npm1300_gpio_state, \
}
#define PBL_DEVICE_STATE_DEFINE(sym)
Define the runtime state of device instance sym.
Definition device.h:131
#define PBL_GPIO_PORT_INIT(sym, _name, _init, _parent, _ops, _num_pins, _intc)
Initializer for a struct pbl_gpio_port.
Definition driver.h:70
nPM1300 GPIO port.
Definition npm1300.h:31
#define NPM1300_GPIO_NUM_PINS
Number of GPIOs.
Definition npm1300.h:22
A GPIO controller.
Definition driver.h:42

Define the GPIO port.

Pins are then referenced with PBL_GPIO(&sym.port, pin, flags).

Parameters
symSymbol of the port.
_pmicCore, a struct pbl_mfd_npm1300.