PebbleOS v4.47.0-888-g9fa910d13
Loading...
Searching...
No Matches
TCA6408

GPIO port over the eight pins of a TI TCA6408 I2C expander. More...

Data Structures

struct  pbl_tca6408
 TCA6408 port. More...
 

Macros

#define TCA6408_NUM_PINS   8U
 Number of pins.
 
#define PBL_TCA6408_DEFINE(sym, _bus, _addr)
 Define a TCA6408.
 

Detailed Description

GPIO port over the eight pins of a TI TCA6408 I2C expander.

Pins are push-pull, without pulls.


Data Structure Documentation

◆ pbl_tca6408

struct pbl_tca6408

TCA6408 port.

Data Fields
struct pbl_i2c_dev i2c I2C device.
struct pbl_gpio_port port GPIO port, child of the I2C bus.
struct pbl_tca6408_state * state Runtime state.

Macro Definition Documentation

◆ PBL_TCA6408_DEFINE

#define PBL_TCA6408_DEFINE (   sym,
  _bus,
  _addr 
)
Value:
static struct pbl_tca6408_state sym##_tca6408_state; \
PBL_DEVICE_INSTANCE(sym, struct pbl_tca6408, struct pbl_gpio_port, port) { \
.port = PBL_GPIO_PORT_INIT(sym, "tca6408", pbl_tca6408_init, &(_bus)->dev, &pbl_tca6408_ops, \
TCA6408_NUM_PINS, nullptr), \
.i2c = PBL_I2C_DEV(_bus, _addr), .state = &sym##_tca6408_state, \
}
#define PBL_DEVICE_STATE_DEFINE(sym)
Define the runtime state of device instance sym.
Definition device.h:132
TCA6408 port.
Definition tca6408.h:33
#define TCA6408_NUM_PINS
Number of pins.
Definition tca6408.h:22
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
#define PBL_I2C_DEV(_bus, _addr)
Initializer for a struct pbl_i2c_dev.
Definition i2c.h:136

Define a TCA6408.

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

Parameters
symSymbol of the port.
_busI2C bus.
_addr7-bit I2C address.

◆ TCA6408_NUM_PINS

#define TCA6408_NUM_PINS   8U

Number of pins.