pub enum Spi {
SPI1(SPI1),
SPI2(SPI2),
}
Available on crate feature
spi
only.Expand description
Peripheral-agnostic driver.
Variants§
Trait Implementations§
Source§impl SpiBus for Spi
impl SpiBus for Spi
Source§async fn read(&mut self, words: &mut [u8]) -> Result<(), Self::Error>
async fn read(&mut self, words: &mut [u8]) -> Result<(), Self::Error>
Read
words
from the slave. Read moreSource§async fn write(&mut self, data: &[u8]) -> Result<(), Self::Error>
async fn write(&mut self, data: &[u8]) -> Result<(), Self::Error>
Write
words
to the slave, ignoring all the incoming words. Read moreSource§async fn transfer(
&mut self,
rx: &mut [u8],
tx: &[u8],
) -> Result<(), Self::Error>
async fn transfer( &mut self, rx: &mut [u8], tx: &[u8], ) -> Result<(), Self::Error>
Write and read simultaneously.
write
is written to the slave on MOSI and
words received on MISO are stored in read
. Read moreAuto Trait Implementations§
impl Freeze for Spi
impl RefUnwindSafe for Spi
impl Send for Spi
impl Sync for Spi
impl Unpin for Spi
impl !UnwindSafe for Spi
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more