|
arduino-audio-driver
|
Driver for the TCA9555 I2C I/O expander (header-only). More...
#include <TCA9555.h>
Public Member Functions | |
| TCA9555 () | |
| Construct a new TCA9555 object with default I2C address 0x20. | |
| bool | begin (IDriverPins &pins) override |
| Initialize the TCA9555 and create the I2C bus. | |
| bool | digitalRead (int pin) override |
| Read the input state of a pin. | |
| bool | digitalWrite (int pin, bool value) override |
| Set the output state of a pin. | |
| void | end () override |
| Deinitialize the TCA9555 and delete the I2C bus. | |
| void | pinMode (int pin, int mode) override |
| Set the direction of a pin. | |
| void | setI2CAddress (uint8_t address) |
| Set the I2C address for the TCA9555. | |
Protected Member Functions | |
| bool | i2c_read (uint8_t addr, uint8_t reg, uint8_t *data, size_t len) |
| Helper to read bytes from the TCA9555 using the platform I2C abstraction. | |
| bool | i2c_write (uint8_t addr, uint8_t reg, uint8_t *data, size_t len) |
| Helper to write bytes to the TCA9555 using the platform I2C abstraction. | |
Protected Attributes | |
| i2c_bus_handle_t | bus = nullptr |
| uint8_t | i2c_default_address |
Driver for the TCA9555 I2C I/O expander (header-only).
Provides methods to configure pin direction, read and write pin states, and manage the I2C bus.
|
inlineoverridevirtual |
Initialize the TCA9555 and create the I2C bus.
| pins | DriverPins structure with SCL and SDA pin assignments. |
Implements API_GPIO.
|
inlineoverridevirtual |
Read the input state of a pin.
| pin | Pin number (0-15). |
Implements API_GPIO.
|
inlineoverridevirtual |
Set the output state of a pin.
| pin | Pin number (0-15). |
| value | true for HIGH, false for LOW. |
Implements API_GPIO.
|
inlineoverridevirtual |
|
inlineprotected |
Helper to read bytes from the TCA9555 using the platform I2C abstraction.
|
inlineprotected |
Helper to write bytes to the TCA9555 using the platform I2C abstraction.
|
inlineoverridevirtual |
Set the direction of a pin.
| pin | Pin number (0-15). |
| input | true for input, false for output. |
Implements API_GPIO.
|
inline |
Set the I2C address for the TCA9555.
| address | The new I2C address. |
|
protected |
|
protected |