comprehensive-rust
comprehensive-rust copied to clipboard
Add section about DMA
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), whyDropis not enough (becausecore::mem::forgetis 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_fenceandcore::sync::atomic::fence).
https://docs.rust-embedded.org/embedonomicon/dma.html could be a useful source, and maybe some of the virtio-drivers crate.