Struct esp_idf_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<Self, EspError>
pub fn read(&mut self, words: &mut [u8]) -> Result<(), EspError>
pub async fn read_async(&mut self, words: &mut [u8]) -> Result<(), EspError>
pub fn write(&mut self, words: &[u8]) -> Result<(), EspError>
pub async fn write_async(&mut self, words: &[u8]) -> Result<(), EspError>
pub fn transfer( &mut self, read: &mut [u8], write: &[u8], ) -> Result<(), EspError>
pub async fn transfer_async( &mut self, read: &mut [u8], write: &[u8], ) -> Result<(), EspError>
pub fn transfer_in_place(&mut self, words: &mut [u8]) -> Result<(), EspError>
pub async fn transfer_in_place_async( &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§async fn read(&mut self, buf: &mut [u8]) -> Result<(), Self::Error>
async fn read(&mut self, buf: &mut [u8]) -> Result<(), Self::Error>
Read
words
from the slave. Read moresource§async fn write(&mut self, buf: &[u8]) -> Result<(), Self::Error>
async fn write(&mut self, buf: &[u8]) -> Result<(), Self::Error>
Write
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 and read simultaneously.
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>
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 moresource§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