Library for interfacing NXP PCA6416A 16-bit I2C-bus I/O expander with interrupt output
The PCA6416A is a 16-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 PCA6416 I2C addresses
Initializes i2c communication with the PCA6416, sets the direction of the I/O pins and sets the outgoing logic levels of the pins defined as outputs
Helper macro to convert port and pin to a bitmask
Read PCA6416 Inputs
Writes the logic levels to be set for the outputs pins to the output port register of the PCA6416
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 PCA6416 read/write access. Data is first of all sent and data is then received.