Skip to content
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
wants to merge 13 commits into from

Conversation

bugadani
Copy link
Contributor

@bugadani bugadani commented Oct 11, 2024

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 📝

  • I have updated existing examples or added new ones (if applicable).
  • I have used cargo xtask fmt-packages command to ensure that all changed code is formatted correctly.
  • My changes were added to the CHANGELOG.md in the proper section.
  • I have added necessary changes to user code to the Migration Guide.
  • My changes are in accordance to the esp-rs API guidelines

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.

@bugadani
Copy link
Contributor Author

Unfortunately this isn't the last GPIO refactor PR :(

@bugadani bugadani force-pushed the gpios branch 4 times, most recently from 32449f8 to 1762a3e Compare October 11, 2024 16:51
@bugadani bugadani changed the title Reduce reliance on traits, type-erase GPIOs Reduce reliance on traits, erase GPIO types from more peripherals Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants