pub trait SpiBusCyw43 {
// Required methods
async fn cmd_write(&mut self, write: &[u32]) -> u32;
async fn cmd_read(&mut self, write: u32, read: &mut [u32]) -> u32;
// Provided method
async fn wait_for_event(&mut self) { ... }
}
Expand description
Custom Spi Trait that only supports the bus operation of the cyw43 Implementors are expected to hold the CS pin low during an operation.
Required Methods§
Sourceasync fn cmd_write(&mut self, write: &[u32]) -> u32
async fn cmd_write(&mut self, write: &[u32]) -> u32
Issues a write command on the bus
First 32 bits of word
are expected to be a cmd word
Sourceasync fn cmd_read(&mut self, write: u32, read: &mut [u32]) -> u32
async fn cmd_read(&mut self, write: u32, read: &mut [u32]) -> u32
Issues a read command on the bus
write
is expected to be a 32 bit cmd word
read
will contain the response of the device
Backplane reads have a response delay that produces one extra unspecified word at the beginning of read
.
Callers that want to read n
word from the backplane, have to provide a slice that is n+1
words long.
Provided Methods§
Sourceasync fn wait_for_event(&mut self)
async fn wait_for_event(&mut self)
Wait for events from the Device. A typical implementation would wait for the IRQ pin to be high. The default implementation always reports ready, resulting in active polling of the device.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.