pub struct Spi2Bus { /* private fields */ }Expand description
The shared bus and which user the peripheral is configured for, under one mutex — so the record and the hardware always change together.
A set_config from outside marks the settings foreign: the display device
applies its own config per transaction, and the card restates its terms on
the next acquire.
Gated with its users: nothing constructs or reads this without display,
and an ungated definition is dead code in a bare board build.
Trait Implementations§
Source§impl SetConfig for Spi2Bus
Available on crate feature display only.Only with display: the impl exists to hook the display device’s
per-transaction config, and that device only exists with the feature.
impl SetConfig for Spi2Bus
display only.Only with display: the impl exists to hook the display device’s
per-transaction config, and that device only exists with the feature.
Source§fn set_config(&mut self, config: &Self::Config) -> Result<(), Self::ConfigError>
fn set_config(&mut self, config: &Self::Config) -> Result<(), Self::ConfigError>
Recorded here, not at the call site: this IS the moment the card’s settings become stale, so the two cannot drift apart.
Source§type ConfigError = ConfigError
type ConfigError = ConfigError
set_config fails.Source§impl SpiBus for Spi2Bus
Available on crate feature display only.Delegating, and spelled out: SpiDma has inherent BLOCKING methods of
the same names, so plain self.inner.read(..) silently picks those.
impl SpiBus for Spi2Bus
display only.Delegating, and spelled out: SpiDma has inherent BLOCKING methods of
the same names, so plain self.inner.read(..) silently picks those.
Source§async fn read(&mut self, words: &mut [u8]) -> Result<(), Self::Error>
async fn read(&mut self, words: &mut [u8]) -> Result<(), Self::Error>
words from the slave. Read moreSource§async fn write(&mut self, words: &[u8]) -> Result<(), Self::Error>
async fn write(&mut self, words: &[u8]) -> Result<(), Self::Error>
words to the slave, ignoring all the incoming words. Read moreSource§async fn transfer(
&mut self,
read: &mut [u8],
write: &[u8],
) -> Result<(), Self::Error>
async fn transfer( &mut self, read: &mut [u8], write: &[u8], ) -> Result<(), Self::Error>
write is written to the slave on MOSI and
words received on MISO are stored in read. Read moreSource§async fn transfer_in_place(
&mut self,
words: &mut [u8],
) -> Result<(), Self::Error>
async fn transfer_in_place( &mut self, words: &mut [u8], ) -> Result<(), Self::Error>
words are
written to the slave, and the received words are stored into the same
words buffer, overwriting it. Read more