Skip to main content

Mem2Mem

Struct Mem2Mem 

Source
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>

Source

pub fn new<CH>( channel: CH, peripheral: impl DmaEligiblePeripheral<CH::Erased>, ) -> Self
where CH: Mem2MemCapableChannel<'d>,

Create a new Mem2Mem instance.

Source

pub unsafe fn new_unsafe<CH>(channel: CH, peripheral: DmaPeripheral) -> Self
where CH: Mem2MemCapableChannel<'d>,

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 peripheral. You must also ensure that the peripheral is compatible with the channel.

Source

pub fn into_async(self) -> Mem2Mem<'d, Async>

Convert Mem2Mem to an async Mem2Mem.

Source§

impl<'d> Mem2Mem<'d, Blocking>

Source

pub fn with_descriptors( self, rx_descriptors: &'d mut [DmaDescriptor], tx_descriptors: &'d mut [DmaDescriptor], config: BurstConfig, ) -> Result<SimpleMem2Mem<'d, Blocking>, DmaError>

Shortcut to create a SimpleMem2Mem

Auto Trait Implementations§

§

impl<'d, Dm> Freeze for Mem2Mem<'d, Dm>

§

impl<'d, Dm> !RefUnwindSafe for Mem2Mem<'d, Dm>

§

impl<'d, Dm> Send for Mem2Mem<'d, Dm>
where Dm: Send,

§

impl<'d, Dm> Sync for Mem2Mem<'d, Dm>
where Dm: Sync,

§

impl<'d, Dm> Unpin for Mem2Mem<'d, Dm>
where Dm: Unpin,

§

impl<'d, Dm> UnsafeUnpin for Mem2Mem<'d, Dm>

§

impl<'d, Dm> !UnwindSafe for Mem2Mem<'d, Dm>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.