Trait ReadWrite

Source
pub trait ReadWrite: Master {
    // Required methods
    fn i2c_read(&mut self, value: &mut [u8]) -> Result<usize, Self::Error>;
    fn i2c_write(&mut self, value: &[u8]) -> Result<(), Self::Error>;
}
Expand description

An I2C master that can communicate using the standard Read/Write traits.

The i2c_read/i2c_write methods are only provided to expose the original error type, and should otherwise be identical to read/write.

Required Methods§

Source

fn i2c_read(&mut self, value: &mut [u8]) -> Result<usize, Self::Error>

Initiate an isolated read transfer on the I2C bus, followed by a STOP.

Source

fn i2c_write(&mut self, value: &[u8]) -> Result<(), Self::Error>

Initiate an isolated write transfer on the I2C bus, followed by a STOP.

Implementors§