google / google/comprehensive-rust
Add section about DMA
- Dominant language
- Rust
- Stars
- 33.4k
- Forks
- 2.1k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 10
Description
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.
Contributor guide
Assessment
This issue has not been assessed yet.