pub struct MutexDevice<'a, T> { /* private fields */ }
Available on crate feature
std
only.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<T> ErrorType for MutexDevice<'_, T>where
T: I2c,
impl<T> ErrorType for MutexDevice<'_, T>where
T: I2c,
Source§impl<T> I2c for MutexDevice<'_, T>where
T: I2c,
impl<T> I2c for MutexDevice<'_, 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> Freeze for MutexDevice<'a, T>
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