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

source

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

source

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

source

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

source

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

source

pub fn transfer_in_place(&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§

fn read( &mut self, words: &mut [u8], ) -> Result<(), <SpiBusDriver<'d, T> as ErrorType>::Error>

Read words from the slave. Read more
source§

fn write( &mut self, words: &[u8], ) -> Result<(), <SpiBusDriver<'d, T> as ErrorType>::Error>

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

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>

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

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.