Skip to main content

SimpleMem2Mem

Struct SimpleMem2Mem 

Source
pub struct SimpleMem2Mem<'d, Dm, E>
where Dm: DriverMode, E: Mem2MemEngine,
{ /* private fields */ }
Available on crate feature unstable only.
Expand description

A simple and easy to use wrapper around Mem2Mem. More complex memory to memory transfers should use Mem2Mem directly.

Implementations§

Source§

impl<'d, Dm, E> SimpleMem2Mem<'d, Dm, E>
where Dm: DriverMode, E: Mem2MemEngine,

Source

pub fn new( mem2mem: Mem2Mem<'d, Dm, E>, rx_descriptors: &'d mut [DmaDescriptor], tx_descriptors: &'d mut [DmaDescriptor], min: Option<BurstSize>, ) -> Result<Self, DmaError>

Creates a new SimpleMem2Mem.

With min, the transfers require buffers that are aligned to min, so that the buffers do not limit a burst up to that size. Configure the burst with Mem2Mem::apply_dma_config.

Source§

impl<'d, Dm, E> SimpleMem2Mem<'d, Dm, E>
where Dm: DriverMode, E: Mem2MemEngine,

Source

pub fn start_transfer( &mut self, rx_buffer: &mut [u8], tx_buffer: &[u8], ) -> Result<SimpleMem2MemTransfer<'_, 'd, Dm, E>, DmaError>

Starts a memory to memory transfer.

Trait Implementations§

Source§

impl<Dm, E> Drop for SimpleMem2Mem<'_, Dm, E>
where Dm: DriverMode, E: Mem2MemEngine,

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<'d, Dm, E> !Sync for SimpleMem2Mem<'d, Dm, E>

§

impl<'d, Dm, E> !UnwindSafe for SimpleMem2Mem<'d, Dm, E>

§

impl<'d, Dm, E> Forget for SimpleMem2Mem<'d, Dm, E>

§

impl<'d, Dm, E> Freeze for SimpleMem2Mem<'d, Dm, E>
where <<E as Mem2MemEngine>::Channel<'d> as DmaChannel>::Rx: Freeze, PhantomData<Dm>: Freeze, <E as Mem2MemEngine>::Config: Freeze, <<E as Mem2MemEngine>::Channel<'d> as DmaChannel>::Tx: Freeze, &'d mut [DmaDescriptor]: Freeze, BufView<DmaRxBuf>: Freeze, BufView<DmaTxBuf>: Freeze,

§

impl<'d, Dm, E> Move for SimpleMem2Mem<'d, Dm, E>

§

impl<'d, Dm, E> RefUnwindSafe for SimpleMem2Mem<'d, Dm, E>
where <<E as Mem2MemEngine>::Channel<'d> as DmaChannel>::Rx: RefUnwindSafe, Dm: RefUnwindSafe, <E as Mem2MemEngine>::Config: RefUnwindSafe, <<E as Mem2MemEngine>::Channel<'d> as DmaChannel>::Tx: RefUnwindSafe, BufView<DmaRxBuf>: RefUnwindSafe, BufView<DmaTxBuf>: RefUnwindSafe,

§

impl<'d, Dm, E> Send for SimpleMem2Mem<'d, Dm, E>
where Dm: Send, <<E as Mem2MemEngine>::Channel<'d> as DmaChannel>::Rx: Send, <E as Mem2MemEngine>::Config: Send, <<E as Mem2MemEngine>::Channel<'d> as DmaChannel>::Tx: Send, DmaDescriptor: Send, BufView<DmaRxBuf>: Send, BufView<DmaTxBuf>: Send,

§

impl<'d, Dm, E> Unpin for SimpleMem2Mem<'d, Dm, E>
where Dm: Unpin, <<E as Mem2MemEngine>::Channel<'d> as DmaChannel>::Rx: Unpin, <E as Mem2MemEngine>::Config: Unpin, <<E as Mem2MemEngine>::Channel<'d> as DmaChannel>::Tx: Unpin, &'d mut [DmaDescriptor]: Unpin, BufView<DmaRxBuf>: Unpin, BufView<DmaTxBuf>: Unpin,

§

impl<'d, Dm, E> UnsafeUnpin for SimpleMem2Mem<'d, Dm, E>
where <<E as Mem2MemEngine>::Channel<'d> as DmaChannel>::Rx: UnsafeUnpin, PhantomData<Dm>: UnsafeUnpin, <E as Mem2MemEngine>::Config: UnsafeUnpin, <<E as Mem2MemEngine>::Channel<'d> as DmaChannel>::Tx: UnsafeUnpin, &'d mut [DmaDescriptor]: UnsafeUnpin, BufView<DmaRxBuf>: UnsafeUnpin, BufView<DmaTxBuf>: UnsafeUnpin,

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

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

fn try_from(value: U) -> Result<T, !>

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.