Struct shared_bus::SpiProxy
source · pub struct SpiProxy<'a, M> { /* private fields */ }
Expand description
Proxy type for SPI bus sharing.
The SpiProxy
implements all (blocking) SPI traits so it can be passed to drivers instead of
the bus instance. An SpiProxy
is created by calling BusManager::acquire_spi()
.
Note: The SpiProxy
can only be used for sharing withing a single task/thread. This
is due to drivers usually managing the chip-select pin manually which would be inherently racy
in a concurrent environment (because the mutex is locked only after asserting CS). To ensure
safe usage, a SpiProxy
can only be created when using BusManagerSimple
and is !Send
.
Trait Implementations§
Auto Trait Implementations§
impl<'a, M> RefUnwindSafe for SpiProxy<'a, M>where M: RefUnwindSafe,
impl<'a, M> !Send for SpiProxy<'a, M>
impl<'a, M> !Sync for SpiProxy<'a, M>
impl<'a, M> Unpin for SpiProxy<'a, M>
impl<'a, M> UnwindSafe for SpiProxy<'a, M>where M: RefUnwindSafe,
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