Expand description

Driver for the TCA9555/TCA9535 16-port I/O expander.

This crate currently only has byte-oriented operation implemented. Individual control of pins will be the subject of a future release.

Example

use embedded_hal::blocking::i2c::WriteRead;
use tca9555::{Tca9555, DeviceAddr};
fn read_ports<E>(i2c: impl WriteRead<Error = E>) -> Result<(), E> {
    let mut tca = Tca9555::new(i2c, DeviceAddr::default());
    let port0: u8 = tca.read_port_0()?;
    let port1: u8 = tca.read_port_1()?;
    let all_inputs: u16 = tca.read_all()?;
    Ok(())
}

Structs

TCA9555 device

Enums

Represents the address of a connected TCA9555

Type Definitions

Type alias for TCA9555. Both chips implement the same I2C commands so in theory are interchangeable here. Use with a TCA9535 has not been tested.