kernel::hil::i2c

Trait I2CMaster

Source
pub trait I2CMaster<'a> {
    // Required methods
    fn set_master_client(&self, master_client: &'a dyn I2CHwMasterClient);
    fn enable(&self);
    fn disable(&self);
    fn write_read(
        &self,
        addr: u8,
        data: &'static mut [u8],
        write_len: usize,
        read_len: usize,
    ) -> Result<(), (Error, &'static mut [u8])>;
    fn write(
        &self,
        addr: u8,
        data: &'static mut [u8],
        len: usize,
    ) -> Result<(), (Error, &'static mut [u8])>;
    fn read(
        &self,
        addr: u8,
        buffer: &'static mut [u8],
        len: usize,
    ) -> Result<(), (Error, &'static mut [u8])>;
}
Expand description

Interface for an I2C Master hardware driver.

Required Methods§

Source

fn set_master_client(&self, master_client: &'a dyn I2CHwMasterClient)

Source

fn enable(&self)

Source

fn disable(&self)

Source

fn write_read( &self, addr: u8, data: &'static mut [u8], write_len: usize, read_len: usize, ) -> Result<(), (Error, &'static mut [u8])>

Source

fn write( &self, addr: u8, data: &'static mut [u8], len: usize, ) -> Result<(), (Error, &'static mut [u8])>

Source

fn read( &self, addr: u8, buffer: &'static mut [u8], len: usize, ) -> Result<(), (Error, &'static mut [u8])>

Implementors§

Source§

impl<'a> I2CMaster<'a> for NoSMBus