[−][src]Struct shared_bus::SpiProxy
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: Debug + BusMutex> 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,
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<W, S> Transfer<W> for S where
S: Default<W>,
W: Clone,
[src]
S: Default<W>,
W: Clone,
type Error = <S as FullDuplex<W>>::Error
Error type
fn transfer(
&mut self,
words: &'w mut [W]
) -> Result<&'w [W], <S as FullDuplex<W>>::Error>
[src]
&mut self,
words: &'w mut [W]
) -> Result<&'w [W], <S as FullDuplex<W>>::Error>
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<W, S> Write<W> for S where
S: Default<W>,
W: Clone,
[src]
S: Default<W>,
W: Clone,
type Error = <S as FullDuplex<W>>::Error
Error type