|
TB2026-YDS Firmware
|
I2C access to the 8 expander channels: per-pin output, input read. More...

Functions | |
| esp_err_t | gpio_expander_init (i2c_master_bus_handle_t bus) |
| Attach the expander to the shared I2C bus and set pin directions. | |
| esp_err_t | gpio_expander_set (uint8_t channel, bool level) |
| Drive one output channel (read-modify-write of the cached output port). | |
| esp_err_t | gpio_expander_get (uint8_t channel, bool *level) |
| Read one input channel's logic level. | |
| esp_err_t | gpio_expander_read_all (uint8_t *inputs) |
| Read all 8 input-port levels in one transaction. | |
I2C access to the 8 expander channels: per-pin output, input read.
| esp_err_t gpio_expander_get | ( | uint8_t | channel, |
| bool * | level ) |
Read one input channel's logic level.
| channel | EXP_* channel index (0..7). | |
| [out] | level | Receives the pin level. |
| esp_err_t gpio_expander_init | ( | i2c_master_bus_handle_t | bus | ) |
Attach the expander to the shared I2C bus and set pin directions.
Drives all outputs low, then configures IO0/IO1 as outputs and IO2..IO7 as inputs.
| bus | Master bus handle from i2c_bus_init(). |
| esp_err_t gpio_expander_read_all | ( | uint8_t * | inputs | ) |
Read all 8 input-port levels in one transaction.
| [out] | inputs | Receives the raw input port byte (bit n = channel n). |
| esp_err_t gpio_expander_set | ( | uint8_t | channel, |
| bool | level ) |
Drive one output channel (read-modify-write of the cached output port).
| channel | EXP_* channel index (0..7); must be configured as an output. |
| level | true = high, false = low. |