1 #ifndef _TWR_TCA9534A_H
2 #define _TWR_TCA9534A_H
7 #define TWR_TCA9534A_PIN_STATE_LOW 0
8 #define TWR_TCA9534A_PIN_STATE_HIGH 1
18 TWR_TCA9534A_PIN_P0 = 0,
19 TWR_TCA9534A_PIN_P1 = 1,
20 TWR_TCA9534A_PIN_P2 = 2,
21 TWR_TCA9534A_PIN_P3 = 3,
22 TWR_TCA9534A_PIN_P4 = 4,
23 TWR_TCA9534A_PIN_P5 = 5,
24 TWR_TCA9534A_PIN_P6 = 6,
25 TWR_TCA9534A_PIN_P7 = 7
33 TWR_TCA9534A_PIN_DIRECTION_OUTPUT = 0,
34 TWR_TCA9534A_PIN_DIRECTION_INPUT = 1
twr_i2c_channel_t
I2C channels.
bool twr_tca9534a_read_port(twr_tca9534a_t *self, uint8_t *state)
Read state of all pins.
bool twr_tca9534a_get_port_direction(twr_tca9534a_t *self, uint8_t *direction)
Get direction of all pins.
bool twr_tca9534a_write_port(twr_tca9534a_t *self, uint8_t state)
Write state to all pins.
twr_tca9534a_pin_direction_t
Pin direction.
bool twr_tca9534a_get_pin_direction(twr_tca9534a_t *self, twr_tca9534a_pin_t pin, twr_tca9534a_pin_direction_t *direction)
Get pin direction.
bool twr_tca9534a_read_pin(twr_tca9534a_t *self, twr_tca9534a_pin_t pin, int *state)
Read pin state.
bool twr_tca9534a_set_pin_direction(twr_tca9534a_t *self, twr_tca9534a_pin_t pin, twr_tca9534a_pin_direction_t direction)
Set pin direction.
twr_tca9534a_pin_t
Individual pin names.
bool twr_tca9534a_init(twr_tca9534a_t *self, twr_i2c_channel_t i2c_channel, uint8_t i2c_address)
Initialize TCA9534A.
bool twr_tca9534a_set_port_direction(twr_tca9534a_t *self, uint8_t direction)
Set direction of all pins.
bool twr_tca9534a_write_pin(twr_tca9534a_t *self, twr_tca9534a_pin_t pin, int state)
Write pin state.