Struct shared_bus::SpiProxy [−][src]
pub struct SpiProxy<'a, M> { /* fields omitted */ }
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
impl<'a, M: BusMutex> Clone for SpiProxy<'a, M>
[src]
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a, M: Debug> Debug for SpiProxy<'a, M>
[src]
impl<'a, M: BusMutex> Transfer<u8> for SpiProxy<'a, M> where
M::Bus: Transfer<u8>,
[src]
M::Bus: Transfer<u8>,
type Error = <M::Bus as Transfer<u8>>::Error
Error type
fn transfer<'w>(&mut self, words: &'w mut [u8]) -> Result<&'w [u8], Self::Error>
[src]
impl<'a, M: BusMutex> Write<u8> for SpiProxy<'a, M> where
M::Bus: Write<u8>,
[src]
M::Bus: Write<u8>,
Auto Trait Implementations
impl<'a, M> RefUnwindSafe for SpiProxy<'a, M> where
M: RefUnwindSafe,
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,
M: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,