google / google/comprehensive-rust

Add section about DMA

Open
#521 0 comments 0 reactions 1 assignee Claimed by @qwandor View on GitHub
deep_dives/bare_metal enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.