[][src]Trait embedded_dma::ReadBuffer

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

Trait for buffers that can be given to DMA for reading.

Safety

The implementing type must be safe to use for DMA reads. This means:

  • It must be a pointer that references the actual buffer.
  • As long as no &mut self method is called on the implementing object:
    • read_buffer must always return the same value, if called multiple times.
    • The memory specified by the pointer and size returned by read_buffer must not be freed as long as self is not dropped.

Associated Types

type Word

Loading content...

Required methods

unsafe fn 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, T: ?Sized> ReadBuffer for B where
    B: Deref<Target = T> + StableDeref,
    T: ReadTarget
[src]

type Word = T::Word

Loading content...