pub trait WriteData: Sealed {
    type Error;

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

Write data

Required Associated Types§

source

type Error

Error type

Required Methods§

source

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

Write to an u8 register

source

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

Write data. The first element corresponds to the starting address.

Implementors§

source§

impl<I2C, E> WriteData for I2cInterface<I2C>where I2C: Write<Error = E>,

§

type Error = Error<E, ()>

source§

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

§

type Error = Error<CommE, PinE>