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( channel: impl DmaChannelConvert<AnyGdmaChannel<'d>>, peripheral: impl DmaEligible, ) -> Self

Create a new Mem2Mem instance.

Source

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.

Source

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

Source

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

Convert Mem2Mem to an async Mem2Mem.

Auto Trait Implementations§

§

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

§

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

§

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> !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.