pub struct Preparation {
pub start: *mut DmaDescriptor,
pub burst_transfer: BurstConfig,
pub check_owner: Option<bool>,
pub auto_write_back: bool,
}unstable only.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.
burst_transfer: BurstConfigConfigures the DMA to transfer data in bursts.
The implementation of the buffer must ensure that buffer size and alignment in each descriptor is compatible with the burst transfer configuration.
For details on alignment requirements, refer to the chip’s Technical Reference Manual
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 behavior.
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 behavior. 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 do not have any such requirements and work correctly regardless of whether the DMA channel checks or not.
If the DMA channel does not support the provided option, preparation fails.
auto_write_back: boolConfigures whether the DMA channel automatically clears the DmaDescriptor::owner bit after it is done with the buffer pointed to by a descriptor.
For RX transfers, this is always true and the value specified here is ignored.
SPI_DMA on the ESP32 does not support this and panics if set to true.