kernel::hil::i2c

Trait I2CDevice

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

Higher-level interface for I2C Master commands that wraps in the I2C address. It gives an interface for communicating with a specific I2C device.

Required Methods§

Source

fn enable(&self)

Source

fn disable(&self)

Source

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

Source

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

Source

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

Implementors§