pub struct LpI2c { /* private fields */ }
Expand description
LP-I2C driver
Implementations§
Source§impl LpI2c
impl LpI2c
Sourcepub fn write(&mut self, address: u8, bytes: &[u8]) -> Result<(), Error>
pub fn write(&mut self, address: u8, bytes: &[u8]) -> Result<(), Error>
Writes bytes to slave with given address
Sourcepub fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Error>
pub fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Error>
Reads enough bytes from slave with given address
to fill buffer
Sourcepub fn write_read(
&mut self,
address: u8,
bytes: &[u8],
buffer: &mut [u8],
) -> Result<(), Error>
pub fn write_read( &mut self, address: u8, bytes: &[u8], buffer: &mut [u8], ) -> Result<(), Error>
Writes bytes to slave with given address
and then reads enough bytes
to fill buffer
in a single transaction