pub struct SpiBusDriver<'d, T>where
T: BorrowMut<SpiDriver<'d>>,{ /* private fields */ }
Implementations§
Source§impl<'d, T> SpiBusDriver<'d, T>where
T: BorrowMut<SpiDriver<'d>>,
impl<'d, T> SpiBusDriver<'d, T>where
T: BorrowMut<SpiDriver<'d>>,
pub fn new(driver: T, config: &Config) -> Result<Self, EspError>
pub fn read(&mut self, words: &mut [u8]) -> Result<(), EspError>
pub fn write(&mut self, words: &[u8]) -> Result<(), EspError>
pub fn transfer( &mut self, read: &mut [u8], write: &[u8], ) -> Result<(), EspError>
pub fn transfer_in_place(&mut self, words: &mut [u8]) -> Result<(), EspError>
pub fn flush(&mut self) -> Result<(), EspError>
Trait Implementations§
Source§impl<'d, T> Drop for SpiBusDriver<'d, T>where
T: BorrowMut<SpiDriver<'d>>,
impl<'d, T> Drop for SpiBusDriver<'d, T>where
T: BorrowMut<SpiDriver<'d>>,
Source§impl<'d, T> ErrorType for SpiBusDriver<'d, T>where
T: BorrowMut<SpiDriver<'d>>,
impl<'d, T> ErrorType for SpiBusDriver<'d, T>where
T: BorrowMut<SpiDriver<'d>>,
Source§impl<'d, T> SpiBus for SpiBusDriver<'d, T>where
T: BorrowMut<SpiDriver<'d>>,
impl<'d, T> SpiBus for SpiBusDriver<'d, T>where
T: BorrowMut<SpiDriver<'d>>,
Source§fn read(&mut self, words: &mut [u8]) -> Result<(), Self::Error>
fn read(&mut self, words: &mut [u8]) -> Result<(), Self::Error>
Read
words
from the slave. Read moreSource§fn write(&mut self, words: &[u8]) -> Result<(), Self::Error>
fn write(&mut self, words: &[u8]) -> Result<(), Self::Error>
Write
words
to the slave, ignoring all the incoming words. Read moreSource§fn flush(&mut self) -> Result<(), Self::Error>
fn flush(&mut self) -> Result<(), Self::Error>
Wait until all operations have completed and the bus is idle. Read more
Source§fn transfer(&mut self, read: &mut [u8], write: &[u8]) -> Result<(), Self::Error>
fn transfer(&mut self, read: &mut [u8], write: &[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 moreSource§fn transfer_in_place(&mut self, words: &mut [u8]) -> Result<(), Self::Error>
fn transfer_in_place(&mut self, words: &mut [u8]) -> Result<(), Self::Error>
Write and read simultaneously. The contents of
words
are
written to the slave, and the received words are stored into the same
words
buffer, overwriting it. Read more