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.