pub struct Preparation {
pub start: *mut DmaDescriptor,
pub direction: TransferDirection,
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 DmaDescriptor
The descriptor the DMA will start from.
direction: TransferDirection
The direction of the DMA transfer.
burst_transfer: BurstConfig
Configures 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 your 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 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_write_back: bool
Configures 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.
Note: SPI_DMA on the ESP32 does not support this and will panic if set to true.