Struct SpiDmaTransfer

Source
pub struct SpiDmaTransfer<'d, Dm, Buf>
where Dm: DriverMode,
{ /* private fields */ }
Available on crate feature unstable only.
Expand description

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time. A structure representing a DMA transfer for SPI.

This structure holds references to the SPI instance, DMA buffers, and transfer status.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Implementations§

Source§

impl<'d, Dm, Buf> SpiDmaTransfer<'d, Dm, Buf>
where Dm: DriverMode,

Source

pub fn is_done(&self) -> bool

Checks if the transfer is complete.

This method returns true if both RX and TX operations are done, and the SPI instance is no longer busy.

Source

pub fn wait(self) -> (SpiDma<'d, Dm>, Buf)

Waits for the DMA transfer to complete.

This method blocks until the transfer is finished and returns the SpiDma instance and the associated buffer.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn cancel(&mut self)

Cancels the DMA transfer.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source§

impl<Buf> SpiDmaTransfer<'_, Async, Buf>

Source

pub async fn wait_for_done(&mut self)

Waits for the DMA transfer to complete asynchronously.

This method awaits the completion of both RX and TX operations.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Trait Implementations§

Source§

impl<Dm, Buf> Drop for SpiDmaTransfer<'_, Dm, Buf>
where Dm: DriverMode,

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'d, Dm, Buf> Freeze for SpiDmaTransfer<'d, Dm, Buf>
where Buf: Freeze,

§

impl<'d, Dm, Buf> RefUnwindSafe for SpiDmaTransfer<'d, Dm, Buf>
where Buf: RefUnwindSafe, Dm: RefUnwindSafe,

§

impl<'d, Dm, Buf> Send for SpiDmaTransfer<'d, Dm, Buf>
where Buf: Send, Dm: Send,

§

impl<'d, Dm, Buf> Sync for SpiDmaTransfer<'d, Dm, Buf>
where Buf: Sync, Dm: Sync,

§

impl<'d, Dm, Buf> Unpin for SpiDmaTransfer<'d, Dm, Buf>
where Buf: Unpin, Dm: Unpin,

§

impl<'d, Dm, Buf> !UnwindSafe for SpiDmaTransfer<'d, Dm, Buf>

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.