[−][src]Struct samd_dma::storage::UnsafeStorage
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.
- The base and write-back addresses MUST point to contiguous blocks of memory.
- The base and write-back addresses MUST be 128-bit aligned.
- The length of the base and write-back memory regions MUST be equal.
- The base and write-back memory regions MUST be statically allocated.
- 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]
baseaddr: &'static mut [TransferDescriptor],
wbaddr: &'static mut [TransferDescriptor]
) -> UnsafeStorage<T>
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]
self
) -> (&'static mut [TransferDescriptor], &'static mut [TransferDescriptor])
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.
fn baseaddr(&self) -> *const TransferDescriptor
[src]
fn wbaddr(&self) -> *const TransferDescriptor
[src]
Auto Trait Implementations
impl<T> !Send for UnsafeStorage<T>
impl<T> !Sync for UnsafeStorage<T>
impl<T> Unpin for UnsafeStorage<T> where
T: Unpin,
T: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
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>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,