pub type RawBufSlice = RawU8Slice;Aliased Type§
pub struct RawBufSlice { /* private fields */ }Trait Implementations§
Source§impl ReadBuffer for RawBufSlice
This allows using Self in DMA based APIs which expect a embedded_dma::ReadBuffer.
impl ReadBuffer for RawBufSlice
This allows using Self in DMA based APIs which expect a embedded_dma::ReadBuffer.
However, the user still must ensure that any alignment rules for DMA buffers required by the hardware are met and than any MPU/MMU configuration necessary is also performed for this to work properly.
§Safety
- The raw slice type erases the lifetime of slice. The caller MUST ensure that the lifetime of the slice is valid as long as the buffer is in-use by the DMA.
- It is also imperitive that the DMA system you’re using returns the pointer only after a DMA transfer is complete. If you’re unsure check the docs and if nothing is mentioned in the docs please clarify it with a project maintainer.
- If the raw slice wrapper is used on a stack allocated slice: Higher-level APIs
oftentimes rely on
Dropimplementations to allow cancelling transfers on non-blocking APIs. Usingcore::mem::forgeton such implementations can leak the underlying memory. HAL and firmware authors MUST either use this abstraction combined with'staticslices or ensure that theDropimplementations always runs properly.