Struct esp_idf_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,
impl<'d, DEVICE, DRIVER> SpiSoftCsDeviceDriver<'d, DEVICE, DRIVER>where
DEVICE: Borrow<SpiSharedDeviceDriver<'d, DRIVER>>,
DRIVER: Borrow<SpiDriver<'d>> + 'd,
pub fn new( shared_device: DEVICE, cs: impl Peripheral<P = impl OutputPin> + 'd, cs_level: Level, ) -> Result<Self, EspError>
sourcepub fn cs_pre_delay_us(&mut self, delay_us: u32) -> &mut Self
pub fn cs_pre_delay_us(&mut self, delay_us: u32) -> &mut Self
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.
sourcepub fn cs_post_delay_us(&mut self, delay_us: u32) -> &mut Self
pub fn cs_post_delay_us(&mut self, delay_us: u32) -> &mut Self
Add an aditional delay of x in uSeconds after transaction between last clk out and chip select
pub fn transaction( &mut self, operations: &mut [Operation<'_, u8>], ) -> Result<(), EspError>
pub async fn transaction_async( &mut self, operations: &mut [Operation<'_, u8>], ) -> Result<(), EspError>
pub fn read(&mut self, read: &mut [u8]) -> Result<(), EspError>
pub async fn read_async(&mut self, read: &mut [u8]) -> Result<(), EspError>
pub fn write(&mut self, write: &[u8]) -> Result<(), EspError>
pub async fn write_async(&mut self, write: &[u8]) -> Result<(), EspError>
pub fn transfer_in_place(&mut self, buf: &mut [u8]) -> Result<(), EspError>
pub async fn transfer_in_place_async( &mut self, buf: &mut [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>
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,
impl<'d, DEVICE, DRIVER> ErrorType for SpiSoftCsDeviceDriver<'d, DEVICE, DRIVER>where
DEVICE: Borrow<SpiSharedDeviceDriver<'d, DRIVER>> + 'd,
DRIVER: Borrow<SpiDriver<'d>> + 'd,
source§impl<'d, DEVICE, DRIVER> SpiDevice for SpiSoftCsDeviceDriver<'d, DEVICE, DRIVER>where
DEVICE: Borrow<SpiSharedDeviceDriver<'d, DRIVER>> + 'd,
DRIVER: Borrow<SpiDriver<'d>> + 'd,
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<(), Self::Error>
fn read(&mut self, buf: &mut [u8]) -> Result<(), Self::Error>
Do a read within a transaction. Read more
source§fn write(&mut self, buf: &[u8]) -> Result<(), Self::Error>
fn write(&mut self, buf: &[u8]) -> Result<(), Self::Error>
Do a write within a transaction. Read more
source§fn transaction(
&mut self,
operations: &mut [Operation<'_, u8>],
) -> Result<(), Self::Error>
fn transaction( &mut self, operations: &mut [Operation<'_, u8>], ) -> Result<(), Self::Error>
Perform a transaction against the device. Read more
source§fn transfer(
&mut self,
read: &mut [Word],
write: &[Word],
) -> Result<(), Self::Error>
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>
fn transfer_in_place(&mut self, buf: &mut [Word]) -> Result<(), Self::Error>
Do an in-place transfer within a transaction. Read more
source§impl<'d, DEVICE, DRIVER> SpiDevice for SpiSoftCsDeviceDriver<'d, DEVICE, DRIVER>where
DEVICE: Borrow<SpiSharedDeviceDriver<'d, DRIVER>> + 'd,
DRIVER: Borrow<SpiDriver<'d>> + 'd,
impl<'d, DEVICE, DRIVER> SpiDevice for SpiSoftCsDeviceDriver<'d, DEVICE, DRIVER>where
DEVICE: Borrow<SpiSharedDeviceDriver<'d, DRIVER>> + 'd,
DRIVER: Borrow<SpiDriver<'d>> + 'd,
source§async fn read(&mut self, buf: &mut [u8]) -> Result<(), Self::Error>
async fn read(&mut self, buf: &mut [u8]) -> Result<(), Self::Error>
Do a read within a transaction. Read more
source§async fn write(&mut self, buf: &[u8]) -> Result<(), Self::Error>
async fn write(&mut self, buf: &[u8]) -> Result<(), Self::Error>
Do a write within a transaction. Read more
source§async fn transaction(
&mut self,
operations: &mut [Operation<'_, u8>],
) -> Result<(), Self::Error>
async fn transaction( &mut self, operations: &mut [Operation<'_, u8>], ) -> Result<(), Self::Error>
Perform a transaction against the device. Read more
source§async fn transfer(
&mut self,
read: &mut [Word],
write: &[Word],
) -> Result<(), Self::Error>
async fn transfer( &mut self, read: &mut [Word], write: &[Word], ) -> Result<(), Self::Error>
Do a transfer within a transaction. Read more
source§async fn transfer_in_place(
&mut self,
buf: &mut [Word],
) -> Result<(), Self::Error>
async fn transfer_in_place( &mut self, buf: &mut [Word], ) -> Result<(), Self::Error>
Do an in-place transfer within a transaction. Read more