-
Notifications
You must be signed in to change notification settings - Fork 221
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
Reduce reliance on traits, erase GPIO types from more peripherals #2340
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Unfortunately this isn't the last GPIO refactor PR :( |
bugadani
force-pushed
the
gpios
branch
4 times, most recently
from
October 11, 2024 16:51
32449f8
to
1762a3e
Compare
bugadani
changed the title
Reduce reliance on traits, type-erase GPIOs
Reduce reliance on traits, erase GPIO types from more peripherals
Oct 11, 2024
Dominaezzz
reviewed
Oct 11, 2024
Closed
bugadani
force-pushed
the
gpios
branch
8 times, most recently
from
October 16, 2024 14:01
9bf8996
to
099099f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
The PR removes IOMUX related traits and tries to implement comparable functionality on a small set of concrete types. This is somewhat unfinished currently.
We don't really want to keep carrying tons of GPIO types where the peripheral doesn't have to bit-manipulate them for every clock transition. We don't carry these for communication peripherals, so PARL_IO and LCD/CAM can be cleaned up considerably.
I'm changing the peripherals to take
Into<Input/OutputConnection>
so that we can reduce the amount of trait bloat in the HAL. This shouldn't cause changes in user code, pins/signals can still be passed to drivers, they are just converted to a type-erased variant internally.The type-erased connection types are semi-internal, to allow third party driver authors to access the IO matrix funcitonality. They don't get much help to do it, currently, but at least this PR shouldn't take away the machinery.