esp_hal::dma

Struct Preparation

Source
pub struct Preparation {
    pub start: *mut DmaDescriptor,
    pub block_size: Option<DmaBufBlkSize>,
    pub is_burstable: bool,
    pub check_owner: Option<bool>,
}
Expand description

Holds all the information needed to configure a DMA channel for a transfer.

Fields§

§start: *mut DmaDescriptor

The descriptor the DMA will start from.

§block_size: Option<DmaBufBlkSize>

Block size for PSRAM transfers

§is_burstable: bool

Specifies whether descriptor linked list specified in start conforms to the alignment requirements required to enable burst transfers.

Note: This only applies to burst transfer of the buffer data, not the descriptors themselves.

There are no additional alignment requirements for TX burst transfers, but RX transfers require all descriptors to have buffer pointers and sizes that are a multiple of 4 (word aligned).

§check_owner: Option<bool>

Configures the “check owner” feature of the DMA channel.

Most DMA channels allow software to configure whether the hardware checks that DmaDescriptor::owner is set to Owner::Dma before consuming the descriptor. If this check fails, the channel stops operating and fires DmaRxInterrupt::DescriptorError/DmaTxInterrupt::DescriptorError.

This field allows buffer implementation to configure this behaviour.

  • Some(true): DMA channel must check the owner bit.
  • Some(false): DMA channel must NOT check the owner bit.
  • None: DMA channel should check the owner bit if it is supported.

Some buffer implementations may require that the DMA channel performs this check before consuming the descriptor to ensure correct behaviour. e.g. To prevent wrap-around in a circular transfer.

Some buffer implementations may require that the DMA channel does NOT perform this check as the ownership bit will not be set before the channel tries to consume the descriptor.

Most implementations won’t have any such requirements and will work correctly regardless of whether the DMA channel checks or not.

Note: If the DMA channel doesn’t support the provided option, preparation will fail.

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.