Struct esp_idf_svc::hal::spi::SpiSoftCsDeviceDriver

source ·
pub struct SpiSoftCsDeviceDriver<'d, DEVICE, DRIVER> { /* private fields */ }

Implementations§

source§

impl<'d, DEVICE, DRIVER> SpiSoftCsDeviceDriver<'d, DEVICE, DRIVER>
where DEVICE: Borrow<SpiSharedDeviceDriver<'d, DRIVER>>, DRIVER: Borrow<SpiDriver<'d>> + 'd,

source

pub fn new( shared_device: DEVICE, cs: impl Peripheral<P = impl OutputPin> + 'd, cs_level: Level, ) -> Result<SpiSoftCsDeviceDriver<'d, DEVICE, DRIVER>, EspError>

source

pub fn cs_pre_delay_us( &mut self, delay_us: u32, ) -> &mut SpiSoftCsDeviceDriver<'d, DEVICE, DRIVER>

Add an aditional Amount of SPI bit-cycles the cs should be activated before the transmission (0-16). This only works on half-duplex transactions.

source

pub fn cs_post_delay_us( &mut self, delay_us: u32, ) -> &mut SpiSoftCsDeviceDriver<'d, DEVICE, DRIVER>

Add an aditional delay of x in uSeconds after transaction between last clk out and chip select

source

pub fn transaction( &mut self, operations: &mut [Operation<'_, u8>], ) -> Result<(), EspError>

source

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

source

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

source

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

source

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

Trait Implementations§

source§

impl<'d, DEVICE, DRIVER> ErrorType for SpiSoftCsDeviceDriver<'d, DEVICE, DRIVER>
where DEVICE: Borrow<SpiSharedDeviceDriver<'d, DRIVER>> + 'd, DRIVER: Borrow<SpiDriver<'d>> + 'd,

§

type Error = SpiError

Error type.
source§

impl<'d, DEVICE, DRIVER> SpiDevice for SpiSoftCsDeviceDriver<'d, DEVICE, DRIVER>
where DEVICE: Borrow<SpiSharedDeviceDriver<'d, DRIVER>> + 'd, DRIVER: Borrow<SpiDriver<'d>> + 'd,

source§

fn read( &mut self, buf: &mut [u8], ) -> Result<(), <SpiSoftCsDeviceDriver<'d, DEVICE, DRIVER> as ErrorType>::Error>

Do a read within a transaction. Read more
source§

fn write( &mut self, buf: &[u8], ) -> Result<(), <SpiSoftCsDeviceDriver<'d, DEVICE, DRIVER> as ErrorType>::Error>

Do a write within a transaction. Read more
source§

fn transaction( &mut self, operations: &mut [Operation<'_, u8>], ) -> Result<(), <SpiSoftCsDeviceDriver<'d, DEVICE, DRIVER> as ErrorType>::Error>

Perform a transaction against the device. Read more
source§

fn transfer( &mut self, read: &mut [Word], write: &[Word], ) -> Result<(), Self::Error>

Do a transfer within a transaction. Read more
source§

fn transfer_in_place(&mut self, buf: &mut [Word]) -> Result<(), Self::Error>

Do an in-place transfer within a transaction. Read more

Auto Trait Implementations§

§

impl<'d, DEVICE, DRIVER> Freeze for SpiSoftCsDeviceDriver<'d, DEVICE, DRIVER>
where DEVICE: Freeze,

§

impl<'d, DEVICE, DRIVER> RefUnwindSafe for SpiSoftCsDeviceDriver<'d, DEVICE, DRIVER>
where DEVICE: RefUnwindSafe,

§

impl<'d, DEVICE, DRIVER> Send for SpiSoftCsDeviceDriver<'d, DEVICE, DRIVER>
where DEVICE: Send,

§

impl<'d, DEVICE, DRIVER> !Sync for SpiSoftCsDeviceDriver<'d, DEVICE, DRIVER>

§

impl<'d, DEVICE, DRIVER> Unpin for SpiSoftCsDeviceDriver<'d, DEVICE, DRIVER>
where DEVICE: Unpin,

§

impl<'d, DEVICE, DRIVER> !UnwindSafe for SpiSoftCsDeviceDriver<'d, DEVICE, DRIVER>

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.