[][src]Trait embedded_dma::StaticReadBuffer

pub unsafe trait StaticReadBuffer: ReadBuffer {
    type Word;
    unsafe fn static_read_buffer(&self) -> (*const Self::Word, usize);
}

Trait for buffers that can be given to DMA for reading. This is a more strict version of ReadBuffer, if you are not sure about which one to use on your safe API, prefer this one. This trait also allows end users to unsafely bypass the 'static invariant.

Safety

This has the same invariants as ReadBuffer with the additional requirement that the buffer should have a 'static lifetime.

Associated Types

type Word

Loading content...

Required methods

unsafe fn static_read_buffer(&self) -> (*const Self::Word, usize)

Provide a buffer usable for DMA reads.

The return value is:

  • pointer to the start of the buffer
  • buffer size in words

Safety

Once this method has been called, it is unsafe to call any &mut self methods on this object as long as the returned value is in use (by DMA).

Loading content...

Implementors

impl<B: ReadBuffer + 'static> StaticReadBuffer for B[src]

type Word = Self::Word

Loading content...