[][src]Trait embedded_hal::blocking::i2c::Read

pub trait Read<A: AddressMode = SevenBitAddress> {
    type Error;
    fn try_read(
        &mut self,
        address: A,
        buffer: &mut [u8]
    ) -> Result<(), Self::Error>; }

Blocking read

Associated Types

type Error

Error type

Loading content...

Required methods

fn try_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
Loading content...

Implementors

impl<A, E, S> Read<A> for S where
    A: AddressMode,
    S: Default<A> + Transactional<A, Error = E>, 
[src]

type Error = E

Loading content...