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

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Error type
Sends words to the slave. Returns the words received from the slave
Error type
Sends words to the slave, ignoring all the incoming words

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.