Trait hts221::device::I2C [] [src]

pub trait I2C {
    type Error;
    fn write(&mut self, dev_addr: u8, bytes: &[u8]) -> Result<(), Self::Error>;
fn write_read(
        &mut self,
        dev_addr: u8,
        bytes: &[u8],
        buffer: &mut [u8]
    ) -> Result<(), Self::Error>; }

I2C defines blocking functions that write and read data on the I2C bus. All device communication goes through a type that implements I2C.

Associated Types

Required Methods

Blocking write to I2C slave. Sends bytes to slave with address dev_addr.

Blocking write to, followed by blocking read from, I2C slave. Sends bytes to slave with address dev_addr and then reads enough bytes to fill buffer in a single transaction.

Implementors