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>>,

source

pub fn new(driver: T, config: &Config) -> Result<Self, EspError>

source

pub fn read(&mut self, words: &mut [u8]) -> Result<(), EspError>

source

pub async fn read_async(&mut self, words: &mut [u8]) -> Result<(), EspError>

source

pub fn write(&mut self, words: &[u8]) -> Result<(), EspError>

source

pub async fn write_async(&mut self, words: &[u8]) -> Result<(), EspError>

source

pub fn transfer( &mut self, read: &mut [u8], write: &[u8], ) -> Result<(), EspError>

source

pub async fn transfer_async( &mut self, read: &mut [u8], write: &[u8], ) -> Result<(), EspError>

source

pub fn transfer_in_place(&mut self, words: &mut [u8]) -> Result<(), EspError>

source

pub async fn transfer_in_place_async( &mut self, words: &mut [u8], ) -> Result<(), EspError>

source

pub fn flush(&mut self) -> Result<(), EspError>

Trait Implementations§

source§

impl<'d, T> Drop for SpiBusDriver<'d, T>
where T: BorrowMut<SpiDriver<'d>>,

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<'d, T> ErrorType for SpiBusDriver<'d, T>
where T: BorrowMut<SpiDriver<'d>>,

§

type Error = SpiError

Error type.
source§

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>

Read words from the slave. Read more
source§

async fn write(&mut self, buf: &[u8]) -> Result<(), Self::Error>

Write words to the slave, ignoring all the incoming words. Read more
source§

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 more
source§

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 more
source§

async fn flush(&mut self) -> Result<(), Self::Error>

Wait until all operations have completed and the bus is idle. Read more
source§

impl<'d, T> SpiBus for SpiBusDriver<'d, T>
where T: BorrowMut<SpiDriver<'d>>,

source§

fn read(&mut self, words: &mut [u8]) -> Result<(), Self::Error>

Read words from the slave. Read more
source§

fn write(&mut self, words: &[u8]) -> Result<(), Self::Error>

Write words to the slave, ignoring all the incoming words. Read more
source§

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>

Write and read simultaneously. write is written to the slave on MOSI and words received on MISO are stored in read. Read more
source§

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

Auto Trait Implementations§

§

impl<'d, T> Freeze for SpiBusDriver<'d, T>
where T: Freeze,

§

impl<'d, T> RefUnwindSafe for SpiBusDriver<'d, T>
where T: RefUnwindSafe,

§

impl<'d, T> !Send for SpiBusDriver<'d, T>

§

impl<'d, T> !Sync for SpiBusDriver<'d, T>

§

impl<'d, T> Unpin for SpiBusDriver<'d, T>
where T: Unpin,

§

impl<'d, T> UnwindSafe for SpiBusDriver<'d, T>
where T: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.