comprehensive-rust icon indicating copy to clipboard operation
comprehensive-rust copied to clipboard

Add section about DMA

Open qwandor opened this issue 2 years ago • 0 comments

This could be an extension of the UART driver in the bare metal afternoon, as the PL011 appears to support DMA. This should cover:

  • Using lifetimes for buffers to make a safe API (probably using 'static), why Drop is not enough (because core::mem::forget is safe).
  • Pin
  • Passing ownership back and forth with the type state pattern to prevent other operations clashing with the DMA transfer.
  • Compiler and memory barriers (core::sync::atomic::compiler_fence and core::sync::atomic::fence).

https://docs.rust-embedded.org/embedonomicon/dma.html could be a useful source, and maybe some of the virtio-drivers crate.

qwandor avatar Mar 22 '23 14:03 qwandor