Library for interfacing NXP PCA6408A 8-bit I2C-bus I/O expander with interrupt output
The PCA6408A is a 8-bit general purpose I/O expander that provides remote I/O expansion for most microcontroller families via the I²C-bus interface. -) I2C interface with communication speed up to 400 kHz -) Two user selectable addresses (chosen by chip pin) -) Built-in level shiffter -) Interrupt output for indicating that an input state has changed
typical I2C clock speed to be used
Available PCA6408 I2C addresses
Initializes i2c communication with the PCA6408, sets the direction of the I/O pins and sets the outgoing logic levels of the pins defined as outputs
Helper macro to convert pin to a bitmask
Read PCA6408 register
The function reads from the specified register and returns the read value.
Writes the logic levels to be set for the outputs pins to the output port register of the PCA6408
Enable IRQ handling
Type of function: #callback func(pinstate);
Disable IRQ handling
absolute maximum I2C clock speed
Available commands/registers (Command | R/W | Default | Description
Performs raw PCA6408 read/write access. Data is first of all sent and data is then received.