pub struct Transfer<'a> { /* private fields */ }Expand description
The core DMA transfer future
Transfer is a future that drives the DMA transfer. Transfer will
initiate a DMA transfer when it is first polled. You may then poll it
to understand when the transfer completes.
To cancel a transfer, drop the Transfer.
If you’ve enabled DMA interrupts, consider using on_interrupt
to wake an executor when the DMA transfer completes, The interrupt interface assumes that you’ve
- configured your channel to generate interrupts
- registered a DMA ISR with your embedded runtime
- unmasked the DMA interrupt in the NVIC
Transfer calls the unsafe enable method to enable a
DMA transfer. To properly use Transfer, make sure that you’ve configured your DMA
channel for a valid transfer.
Transfer is the core DMA future used in imxrt_dma. For safe DMA transfers, consider
using
Memcpyfor buffer-to-buffer DMA transfersReadfor peripheral-to-memory DMA transfersWritefor memory-to-peripheral DMA transfers
Transfer is designed to the DMA Channel public interface. If you need to implement
your own transfer future, you may do so.
use imxrt_dma::{channel::Channel, Transfer};
let my_channel: Channel = // Acquire your channel...
// Properly prepare your transfer...
// Safety: transfer properly prepared
unsafe { Transfer::new(&my_channel) }.await?;