Struct embassy_embedded_hal::shared_bus::asynch::i2c::I2cDevice
source · pub struct I2cDevice<'a, M: RawMutex, BUS> { /* private fields */ }
Expand description
I2C device on a shared bus.
Implementations§
Trait Implementations§
source§impl<'a, M: RawMutex, BUS> ErrorType for I2cDevice<'a, M, BUS>where
BUS: ErrorType,
impl<'a, M: RawMutex, BUS> ErrorType for I2cDevice<'a, M, BUS>where
BUS: ErrorType,
§type Error = I2cDeviceError<<BUS as ErrorType>::Error>
type Error = I2cDeviceError<<BUS as ErrorType>::Error>
Error type
source§impl<M, BUS> I2c for I2cDevice<'_, M, BUS>
impl<M, BUS> I2c for I2cDevice<'_, M, BUS>
source§async fn read(
&mut self,
address: u8,
read: &mut [u8]
) -> Result<(), I2cDeviceError<BUS::Error>>
async fn read( &mut self, address: u8, read: &mut [u8] ) -> Result<(), I2cDeviceError<BUS::Error>>
source§async fn write(
&mut self,
address: u8,
write: &[u8]
) -> Result<(), I2cDeviceError<BUS::Error>>
async fn write( &mut self, address: u8, write: &[u8] ) -> Result<(), I2cDeviceError<BUS::Error>>
Writes bytes to slave with address
address
. Read moresource§async fn write_read(
&mut self,
address: u8,
write: &[u8],
read: &mut [u8]
) -> Result<(), I2cDeviceError<BUS::Error>>
async fn write_read( &mut self, address: u8, write: &[u8], read: &mut [u8] ) -> Result<(), I2cDeviceError<BUS::Error>>
Writes bytes to slave with address
address
and then reads enough bytes to fill read
in a
single transaction. Read moresource§async fn transaction(
&mut self,
address: u8,
operations: &mut [Operation<'_>]
) -> Result<(), I2cDeviceError<BUS::Error>>
async fn transaction( &mut self, address: u8, operations: &mut [Operation<'_>] ) -> Result<(), I2cDeviceError<BUS::Error>>
Execute the provided operations on the I2C bus as a single transaction. Read more
Auto Trait Implementations§
impl<'a, M, BUS> Freeze for I2cDevice<'a, M, BUS>
impl<'a, M, BUS> !RefUnwindSafe for I2cDevice<'a, M, BUS>
impl<'a, M, BUS> Send for I2cDevice<'a, M, BUS>
impl<'a, M, BUS> Sync for I2cDevice<'a, M, BUS>
impl<'a, M, BUS> Unpin for I2cDevice<'a, M, BUS>
impl<'a, M, BUS> !UnwindSafe for I2cDevice<'a, M, BUS>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more