-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow users to easily name DMA channels #1771
Conversation
This is totally bike-shedding, but to be honest, I'm not sure how, as a user, I would react seeing a type like |
I added Gdma to the name because The type aliases kinda suck for discoverability like you said. The Having said that, I don't care about the names (someone else can decide), I just want the solution to not use type aliases, it should be consistent across drivers and it shouldn't get in the way of splitting a channel into an Rx half and tx half. |
I also think names like Maybe having |
Alright I'll replace the const generic with a simple type.
|
Probably naming them like |
# Conflicts: # esp-hal/src/dma/gdma.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Thank you for your contribution!
We appreciate the time and effort you've put into this pull request.
To help us review it efficiently, please ensure you've gone through the following checklist:
Submission Checklist 📝
cargo xtask fmt-packages
command to ensure that all changed code is formatted correctly.CHANGELOG.md
in the proper section.Extra:
Pull Request Details 📖
Description
Fixes part of #1767.
With this PR users can now consistently name the dma channel in use in a driver.
This PR introduces a public trait called
DmaChannel
which describes the RX and TX parts of a channel in associated types.The existing
ChannelTypes
trait which is really similar just didn't cut it (maybe a skill issue). With this PR at least, the "private but public for technical reasons" traitsTx
,TxPrivate
,Rx
andRxPrivate
can be removed andChannelTx
andChannelRx
can just havepub(crate)
methods on it.There will be a follow up PR to simplify the
InstanceDma
trait (based on this) in the SPI driver, which was my main motive for making this PR.Testing
No actual code changes, I just shuffled the generics about so CI should be fine.