|
Firmware SDK
|
Driver for TCA9534A I/O expander. More...
Data Structures | |
| struct | twr_tca9534a_t |
| Pin state. More... | |
Enumerations | |
| enum | twr_tca9534a_pin_t { TWR_TCA9534A_PIN_P0 = 0 , TWR_TCA9534A_PIN_P1 = 1 , TWR_TCA9534A_PIN_P2 = 2 , TWR_TCA9534A_PIN_P3 = 3 , TWR_TCA9534A_PIN_P4 = 4 , TWR_TCA9534A_PIN_P5 = 5 , TWR_TCA9534A_PIN_P6 = 6 , TWR_TCA9534A_PIN_P7 = 7 } |
| Individual pin names. | |
| enum | twr_tca9534a_pin_direction_t { TWR_TCA9534A_PIN_DIRECTION_OUTPUT = 0 , TWR_TCA9534A_PIN_DIRECTION_INPUT = 1 } |
| Pin direction. | |
Driver for TCA9534A I/O expander.
| bool twr_tca9534a_get_pin_direction | ( | twr_tca9534a_t * | self, |
| twr_tca9534a_pin_t | pin, | ||
| twr_tca9534a_pin_direction_t * | direction | ||
| ) |
Get pin direction.
| [in] | self | Instance |
| [in] | pin | Pin name |
| [out] | direction | Pointer to variable where direction of pin will be stored |
Definition at line 99 of file twr_tca9534a.c.
| bool twr_tca9534a_get_port_direction | ( | twr_tca9534a_t * | self, |
| uint8_t * | direction | ||
| ) |
Get direction of all pins.
| [in] | self | Instance |
| [out] | direction | Pointer to variable where direction of all pins will be stored |
Definition at line 80 of file twr_tca9534a.c.
| bool twr_tca9534a_init | ( | twr_tca9534a_t * | self, |
| twr_i2c_channel_t | i2c_channel, | ||
| uint8_t | i2c_address | ||
| ) |
Initialize TCA9534A.
| [in] | self | Instance |
| [in] | i2c_channel | I2C channel |
| [in] | i2c_address | I2C device address |
Definition at line 8 of file twr_tca9534a.c.
Referenced by twr_module_gps_init(), twr_module_sensor_init(), and twr_module_x1_init().


| bool twr_tca9534a_read_pin | ( | twr_tca9534a_t * | self, |
| twr_tca9534a_pin_t | pin, | ||
| int * | state | ||
| ) |
Read pin state.
| [in] | self | Instance |
| [in] | pin | Pin name |
| [out] | state | Pointer to variable where state of pin will be stored |
Definition at line 47 of file twr_tca9534a.c.

| bool twr_tca9534a_read_port | ( | twr_tca9534a_t * | self, |
| uint8_t * | state | ||
| ) |
Read state of all pins.
| [in] | self | Instance |
| [out] | state | Pointer to variable where state of all pins will be stored |
Definition at line 30 of file twr_tca9534a.c.
Referenced by twr_tca9534a_read_pin().


| bool twr_tca9534a_set_pin_direction | ( | twr_tca9534a_t * | self, |
| twr_tca9534a_pin_t | pin, | ||
| twr_tca9534a_pin_direction_t | direction | ||
| ) |
Set pin direction.
| [in] | self | Instance |
| [in] | pin | Pin name |
| [in] | direction | Desired pin direction |
Definition at line 113 of file twr_tca9534a.c.
Referenced by twr_module_sensor_get_revision().

| bool twr_tca9534a_set_port_direction | ( | twr_tca9534a_t * | self, |
| uint8_t | direction | ||
| ) |
Set direction of all pins.
| [in] | self | Instance |
| [in] | direction | Desired direction of all pins |
Definition at line 87 of file twr_tca9534a.c.
Referenced by twr_module_gps_init(), twr_module_sensor_init(), and twr_module_x1_init().


| bool twr_tca9534a_write_pin | ( | twr_tca9534a_t * | self, |
| twr_tca9534a_pin_t | pin, | ||
| int | state | ||
| ) |
Write pin state.
| [in] | self | Instance |
| [in] | pin | Pin name |
| [in] | state | Desired state of pin |
Definition at line 61 of file twr_tca9534a.c.
Referenced by twr_module_gps_init(), twr_module_lcd_off(), and twr_module_lcd_on().


| bool twr_tca9534a_write_port | ( | twr_tca9534a_t * | self, |
| uint8_t | state | ||
| ) |
Write state to all pins.
| [in] | self | Instance |
| [in] | state | Desired state of all pins |
Definition at line 35 of file twr_tca9534a.c.
Referenced by twr_module_gps_init(), twr_module_sensor_init(), twr_module_sensor_set_pull(), twr_module_sensor_set_vdd(), twr_module_x1_init(), and twr_tca9534a_write_pin().

