PebbleOS
Loading...
Searching...
No Matches
nPM1300 GPIO

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

Data Structures

struct  pbl_npm1300_gpio
 nPM1300 GPIO port. More...
 

Macros

#define NPM1300_GPIO_NUM_PINS   5U
 Number of GPIOs.
 
#define PBL_NPM1300_GPIO_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_npm1300_gpio

struct pbl_npm1300_gpio

nPM1300 GPIO port.

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

Macro Definition Documentation

◆ NPM1300_GPIO_NUM_PINS

#define NPM1300_GPIO_NUM_PINS   5U

Number of GPIOs.

◆ PBL_NPM1300_GPIO_DEFINE

#define PBL_NPM1300_GPIO_DEFINE (   sym,
  _pmic 
)
Value:
static struct pbl_npm1300_gpio_state sym##_npm1300_gpio_state; \
const struct pbl_npm1300_gpio sym = { \
.port = PBL_GPIO_PORT_INIT(sym, "npm1300_gpio", nullptr, &(_pmic)->dev, &pbl_npm1300_gpio_ops, \
NPM1300_GPIO_NUM_PINS, nullptr), \
.state = &sym##_npm1300_gpio_state, \
}; \
PBL_DEVICE_REGISTER(sym, &sym.port.dev)
#define PBL_DEVICE_STATE_DEFINE(sym)
Define the runtime state of device instance sym.
Definition device.h:109
struct pbl_gpio_port port
GPIO port, child of the core.
Definition npm1300.h:33
nPM1300 GPIO port.
Definition npm1300.h:31
#define NPM1300_GPIO_NUM_PINS
Number of GPIOs.
Definition npm1300.h:22
struct pbl_device dev
Device.
Definition gpio.h:103
#define PBL_GPIO_PORT_INIT(sym, _name, _init, _parent, _ops, _num_pins, _intc)
Initializer for a struct pbl_gpio_port.
Definition gpio.h:123

Define the GPIO port.

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

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