Struct embedded_hal_bus::i2c::MutexDevice
source · pub struct MutexDevice<'a, T> { /* private fields */ }
Expand description
std
Mutex
-based shared bus I2c
implementation.
Sharing is implemented with an std
Mutex
. It allows a single bus across multiple threads,
with finer-grained locking than CriticalSectionDevice
. The downside is that
it is only available in std
targets.
Implementations§
Trait Implementations§
source§impl<'a, T> ErrorType for MutexDevice<'a, T>where
T: I2c,
impl<'a, T> ErrorType for MutexDevice<'a, T>where
T: I2c,
source§impl<'a, T> I2c for MutexDevice<'a, T>where
T: I2c,
impl<'a, T> I2c for MutexDevice<'a, T>where
T: I2c,
source§fn write(&mut self, address: u8, write: &[u8]) -> Result<(), Self::Error>
fn write(&mut self, address: u8, write: &[u8]) -> Result<(), Self::Error>
Writes bytes to slave with address
address
. Read moreAuto Trait Implementations§
impl<'a, T> RefUnwindSafe for MutexDevice<'a, T>
impl<'a, T> Send for MutexDevice<'a, T>where
T: Send,
impl<'a, T> Sync for MutexDevice<'a, T>where
T: Send,
impl<'a, T> Unpin for MutexDevice<'a, T>
impl<'a, T> UnwindSafe for MutexDevice<'a, T>
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