pub trait ReadData: Sealed {
    type Error;

    // Required methods
    fn read_register(&mut self, register: u8) -> Result<u8, Self::Error>;
    fn read_data(&mut self, payload: &mut [u8]) -> Result<(), Self::Error>;
}
Expand description

Read data

Required Associated Types§

source

type Error

Error type

Required Methods§

source

fn read_register(&mut self, register: u8) -> Result<u8, Self::Error>

Read an u8 register

source

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

Read some data. The first element corresponds to the starting address.

Implementors§

source§

impl<I2C, E> ReadData for I2cInterface<I2C>where I2C: WriteRead<Error = E>,

§

type Error = Error<E, ()>

source§

impl<SPI, CS, CommE, PinE> ReadData for SpiInterface<SPI, CS>where SPI: Transfer<u8, Error = CommE>, CS: OutputPin<Error = PinE>,

§

type Error = Error<CommE, PinE>