Skip to main content

I2cBackend

Trait I2cBackend 

Source
pub trait I2cBackend: Send {
    // Required method
    fn transfer(
        &mut self,
        write_data: &[u8],
        read_length: usize,
    ) -> Result<Vec<u8>, BackendError>;
}
Expand description

Hardware access abstraction for an I2C bus device.

Required Methods§

Source

fn transfer( &mut self, write_data: &[u8], read_length: usize, ) -> Result<Vec<u8>, BackendError>

Executes an I2C transfer with optional write and read phases.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§