pub struct Mem2Mem<'d, Dm>where
Dm: DriverMode,{
pub rx: Mem2MemRx<'d, Dm>,
pub tx: Mem2MemTx<'d, Dm>,
}
Available on crate feature
unstable
only.Expand description
DMA Memory to Memory pseudo-Peripheral
This is a pseudo-peripheral that allows for memory to memory transfers. It is not a real peripheral, but a way to use the DMA engine for memory to memory transfers.
Fields§
§rx: Mem2MemRx<'d, Dm>
RX Half
tx: Mem2MemTx<'d, Dm>
TX Half
Implementations§
Source§impl<'d> Mem2Mem<'d, Blocking>
impl<'d> Mem2Mem<'d, Blocking>
Sourcepub fn new(
channel: impl DmaChannelConvert<AnyGdmaChannel<'d>>,
peripheral: impl DmaEligible,
) -> Self
pub fn new( channel: impl DmaChannelConvert<AnyGdmaChannel<'d>>, peripheral: impl DmaEligible, ) -> Self
Create a new Mem2Mem instance.
Sourcepub unsafe fn new_unsafe(
channel: impl DmaChannelConvert<AnyGdmaChannel<'d>>,
peripheral: DmaPeripheral,
) -> Self
pub unsafe fn new_unsafe( channel: impl DmaChannelConvert<AnyGdmaChannel<'d>>, peripheral: DmaPeripheral, ) -> Self
Create a new Mem2Mem instance.
§Safety
You must ensure that you’re not using DMA for the same peripheral and that you’re the only one using the DmaPeripheral.
Sourcepub fn with_descriptors(
self,
rx_descriptors: &'static mut [DmaDescriptor],
tx_descriptors: &'static mut [DmaDescriptor],
config: BurstConfig,
) -> Result<SimpleMem2Mem<'d, Blocking>, DmaError>
pub fn with_descriptors( self, rx_descriptors: &'static mut [DmaDescriptor], tx_descriptors: &'static mut [DmaDescriptor], config: BurstConfig, ) -> Result<SimpleMem2Mem<'d, Blocking>, DmaError>
Shortcut to create a SimpleMem2Mem
Sourcepub fn into_async(self) -> Mem2Mem<'d, Async>
pub fn into_async(self) -> Mem2Mem<'d, Async>
Convert Mem2Mem to an async Mem2Mem.