![]() |
EVE 1.0
|
#include <io-expander-pca9535a.h>
Data Fields | |
const struct i2c_t * | I2c |
I2C port I2C0 or I2C1. | |
uint8_t | SlaveAddress |
I2C slave address 0x20 to 0x27. | |
struct io_expander_state_t * | State |
IO expander run-time state. | |
uint8_t | Reserved |
Reserved and not used. | |
uint16_t | OutInit |
Initialize value for output port pins (0 = low output, 1 = high output) | |
uint16_t | InInvert |
Invertion of inputs port pins (0 = no invert, 1 = invert) | |
uint16_t | Direction |
Sets the direction of port pins (0 = output, 1 = input) | |
uint16_t | PullEnable |
Enables pull resistors for port pins (0 = disable, 1 = enable) | |
uint16_t | PullSelect |
Selects pullup or polldown resistors port pins (0 = 100k pulldown, 1 = 100k pullup) | |
This driver supports the I2C-based IO expander type NXP PCA9535A. The IO expander has 2 8-bits IO ports, 1 open drain interrupt output and 3 address lines. The I2C address range is 0x20 - 0x27. Max baudrate is 400 kbit/s. The port bits could be set to inputs or outputs individually, and there are no pullups when used as inputs.
Both initialization, writing to one or both ports and reading from one or both ports are supported.
The selected I2C port must be initialized before using the driver. io_expander_t structure holds I2C port and slave address to be used, and the initial data for PORT0 and PORT1 for the IO expander.
io_expander_t structure holds I2C port and slave address to be used, and the initial data for the ports.
Definition at line 67 of file io-expander-pca9535a.h.