pub fn read_words_with_crc<I2c: i2c::Read + i2c::Write>(
    i2c: &mut I2c,
    addr: u8,
    data: &mut [u8],
) -> Result<(), Error<I2c, I2c>> {
    assert!(
        data.len() % 3 == 0,
        "Buffer must hold a multiple of 3 bytes"
    );
    i2c.read(addr, data).map_err(Error::I2cRead)?;
    crc8::validate(data)?;
    Ok(())
}
/// Read data into the provided buffer and validate the CRC8 checksum.
///
/// If the checksum is wrong, return `Error::Crc`.
///
/// # Panics
///
/// This method will consider every third byte a checksum byte. If the buffer size is not a
/// multiple of 3, then it will panic.
Read data into the provided buffer and validate the CRC8 checksum.
If the checksum is wrong, return `Error::Crc`.
Read data into the provided buffer and validate the CRC8 checksum . If the checksum is wrong return ` Error :: Crc ` .
pub fn read_words_with_crc<I2c: i2c::Read + i2c::Write>(
    i2c: &mut I2c,
    addr: u8,
    data: &mut [u8],
) -> Result<(), Error<I2c, I2c>> {
    assert!(
        data.len() % 3 == 0,
        "Buffer must hold a multiple of 3 bytes"
    );
    i2c.read(addr, data).map_err(Error::I2cRead)?;
    crc8::validate(data)?;
    Ok(())
}
pub fn read_words_with_crc < I2c : i2c :: Read + i2c :: Write > ( i2c : & mut I2c , addr : u8 , data : & mut [ u8 ] , ) -> Result < ( ) , Error < I2c , I2c > > { assert ! ( data len ( ) 3 0 " " ) ; i2c . read ( addr , data ) . map_err ( Error :: I2cRead ) ? ; crc8 :: validate ( data ) ? ; Ok ( ( ) ) }
Read data into the provided buffer and validate the CRC8 checksum.
Read data into the provided buffer and validate the CRC8 checksum .
i2c
&mut I2c
addr
u8
data
&mut [u8]
i2c
&mut I2c
addr
u8
data
&mut [u8]
panics
This method will consider every third byte a checksum byte. If the buffer size is not a
multiple of 3, then it will panic.
This method will consider every third byte a checksum byte . If the buffer size is not a multiple of 3 then it will panic .