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 DmaDescriptorThe descriptor the DMA will start from.
block_size: Option<DmaBufBlkSize>Block size for PSRAM transfers
is_burstable: boolSpecifies 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.