|
TB2026-YDS Firmware
|
Macros | |
| #define | EXPANDER_ADDR 0x38 |
| #define | EXP_I2C_TIMEOUT 100 /* ms; fail loud rather than block forever */ |
| #define | REG_INPUT 0x00 /* read-only */ |
| #define | REG_OUTPUT 0x01 |
| #define | REG_CONFIG 0x03 /* direction: 1 = input, 0 = output */ |
| #define | EXP_OUTPUTS ((1u << EXP_DAC_MUTE) | (1u << EXP_AMP_SHDN)) |
| #define | CONFIG_DIR ((uint8_t)~EXP_OUTPUTS) |
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. | |
| #define CONFIG_DIR ((uint8_t)~EXP_OUTPUTS) |
| #define EXP_I2C_TIMEOUT 100 /* ms; fail loud rather than block forever */ |
| #define EXP_OUTPUTS ((1u << EXP_DAC_MUTE) | (1u << EXP_AMP_SHDN)) |
| #define EXPANDER_ADDR 0x38 |
| #define REG_CONFIG 0x03 /* direction: 1 = input, 0 = output */ |
| #define REG_INPUT 0x00 /* read-only */ |
| #define REG_OUTPUT 0x01 |