[FEATURE REQUEST] Prepare+Execute semantics for SPI/I2C/I3C/UART/etc.
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- rust
- Domain
- embedded-iot
Research direction
Review the existing SPI, I2C, I3C, and UART bus traits and their DMA-related abstractions, if present. Determine whether prepare/execute semantics belong in bus-specific traits or a higher-level Stream trait; the issue names no files or tests, and completion would require an agreed API design and corresponding validation.
Written by the indexing model from the issue text.
Description
In short: I would like to propose - or ask why it hasn't been added yet, if there was an attempt already - a semantic that allows splitting a transaction into a prepare and an execute step.
Background
I am working on a nrf52 based device that pulls data from an IMU. I want the maximum possible sample rate and thus have to utilize the SPI bus as efficient as possible. For that I have set up the IMU in FIFO mode with a watermark interrupt so that I know exactly how many bytes I have to/can transfer from the FIFO in a single read operation.
On the nrf52 this is all implemented via DMA, which takes time to set up.
Proposal
If you know how many bytes you need to transfer but you "don't know" the exact time to start, having prepared the DMA request and the channel set up would allow to trigger the transfer after an GPIO interrupt (in software or via event peripheral) and await that DMA transfer complete event.
DMA setup + trigger + complete-event is a - as far as I have seen - very common architecture which would lend itself to a generic trait.
I am not sure whether such a trait would be a SPI/I2C/UART specific thing or a higher-level Stream-trait that needs some added methods in a bus-trait.
- Dominant language
- Rust
- Stars
- 2.7k
- Forks
- 282
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-embedded/embedded-hal
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
rust-embedded/embedded-hal#742 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
rust-embedded/embedded-hal#747 · 5 comments · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
rust-embedded/embedded-hal#746 · 2 comments · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
rust-embedded/embedded-hal#745 · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
rust-embedded/embedded-hal#744 · 1 comment ·
All issues in rust-embedded/embedded-hal
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100