pub trait _embedded_hal_blocking_i2c_Read<A = u8>
where A: AddressMode,
{ type Error; // Required method fn read(&mut self, address: A, buffer: &mut [u8]) -> Result<(), Self::Error>; }
Expand description

Blocking read

Required Associated Types§

source

type Error

Error type

Required Methods§

source

fn read(&mut self, address: A, buffer: &mut [u8]) -> Result<(), Self::Error>

Reads enough bytes from slave with address to fill buffer

§I2C Events (contract)
Master: ST SAD+R        MAK    MAK ...    NMAK SP
Slave:           SAK B0     B1     ... BN

Where

  • ST = start condition
  • SAD+R = slave address followed by bit 1 to indicate reading
  • SAK = slave acknowledge
  • Bi = ith byte of data
  • MAK = master acknowledge
  • NMAK = master no acknowledge
  • SP = stop condition

Implementations on Foreign Types§

source§

impl<H, I2C, SDA, SCL, CLOCK> Read for I2c<H, I2C, SDA, SCL, CLOCK>
where I2C: I2cOps<H, SDA, SCL>,

§

type Error = Error

source§

fn read( &mut self, address: u8, buffer: &mut [u8] ) -> Result<(), <I2c<H, I2C, SDA, SCL, CLOCK> as Read>::Error>

Implementors§