Trait kernel::hil::i2c::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