Struct esp_idf_svc::hal::spi::SpiBusDriver
source · 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<SpiBusDriver<'d, T>, 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<(), <SpiBusDriver<'d, T> as ErrorType>::Error>
fn read( &mut self, words: &mut [u8], ) -> Result<(), <SpiBusDriver<'d, T> as ErrorType>::Error>
Read
words
from the slave. Read moresource§fn write(
&mut self,
words: &[u8],
) -> Result<(), <SpiBusDriver<'d, T> as ErrorType>::Error>
fn write( &mut self, words: &[u8], ) -> Result<(), <SpiBusDriver<'d, T> as ErrorType>::Error>
Write
words
to the slave, ignoring all the incoming words. Read moresource§fn flush(&mut self) -> Result<(), <SpiBusDriver<'d, T> as ErrorType>::Error>
fn flush(&mut self) -> Result<(), <SpiBusDriver<'d, T> as ErrorType>::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<(), <SpiBusDriver<'d, T> as ErrorType>::Error>
fn transfer( &mut self, read: &mut [u8], write: &[u8], ) -> Result<(), <SpiBusDriver<'d, T> as ErrorType>::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<(), <SpiBusDriver<'d, T> as ErrorType>::Error>
fn transfer_in_place( &mut self, words: &mut [u8], ) -> Result<(), <SpiBusDriver<'d, T> as ErrorType>::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