[][src]Struct shared_bus::SpiProxy

pub struct SpiProxy<'a, M: BusMutex> { /* 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: Debug + BusMutex> Debug for SpiProxy<'a, M>[src]

impl<'a, M: BusMutex> Transfer<u8> for SpiProxy<'a, M> where
    M::Bus: Transfer<u8>, 
[src]

type Error = <M::Bus as Transfer<u8>>::Error

Error type

impl<'a, M: BusMutex> Write<u8> for SpiProxy<'a, M> where
    M::Bus: Write<u8>, 
[src]

type Error = <M::Bus as Write<u8>>::Error

Error type

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = <S as FullDuplex<W>>::Error

Error type

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<W, S> Write<W> for S where
    S: Default<W>,
    W: Clone
[src]

type Error = <S as FullDuplex<W>>::Error

Error type