[][src]Struct samd_dma::storage::UnsafeStorage

pub struct UnsafeStorage<T: Unsigned + IsLessOrEqual<CHANMAX, Output = True>> { /* fields omitted */ }

A user allocated storage type.

If you prefer to allocate the base and write-back memory regions, you can use this type to do so. However, to prevent undefined behaviour or memory bugs, make sure to uphold the following invariants.

  1. The base and write-back addresses MUST point to contiguous blocks of memory.
  2. The base and write-back addresses MUST be 128-bit aligned.
  3. The length of the base and write-back memory regions MUST be equal.
  4. The base and write-back memory regions MUST be statically allocated.
  5. The generic type T MUST be an unsigned typenum less than or equal to the length of the base and write-back memory regions.

The base and write-back memory regions' length may be greater than 32, however the DMA system will ignore any further memory past 32 TransferDescriptor's. The base and write-back memory regions may overlap, but it is not recommended.

Methods

impl<T: Unsigned + IsLessOrEqual<CHANMAX, Output = True>> UnsafeStorage<T>[src]

pub unsafe fn new(
    baseaddr: &'static mut [TransferDescriptor],
    wbaddr: &'static mut [TransferDescriptor]
) -> UnsafeStorage<T>
[src]

Create a custom DMA memory storage unit.

Safety

This operation is unsafe as it requires you uphold certain invariants, as explained in the description of the UnsafeStorage type.

pub fn into_inner(
    self
) -> (&'static mut [TransferDescriptor], &'static mut [TransferDescriptor])
[src]

Get back the memory pointers to the base and write-back regions.

Trait Implementations

impl<T: Unsigned + IsLessOrEqual<CHANMAX, Output = True>> DmaStorage for UnsafeStorage<T>[src]

type Size = T

The number of channels supported.

Auto Trait Implementations

impl<T> !Send for UnsafeStorage<T>

impl<T> !Sync for UnsafeStorage<T>

impl<T> Unpin for UnsafeStorage<T> where
    T: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.