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

changed(eic)!: Overhaul the eic module #792

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

jbeaurivage
Copy link
Contributor

@jbeaurivage jbeaurivage commented Nov 25, 2024

Summary

In light of #781, I realized the eic module was in a serious need of an overhaul. Most importantly, in its current state, any EXTINT channel may accept any GPIO pin, which results in configuration errors which are not caught at compile time.

This PR provides a more typesafe API, which does not rely so heavily on macros. Erroneous channel/pin combos are caught at compile time. Additionnally, some types/modules are moved around to make a little more sense, and code is reused where possible, instead of providing two completely separate codebases for D11/D21 and D5x chips.

I figured now was a good time to get this done before the next release, as #635 already has brought in some breaking changes to the eic module.

To note that despite the large changes, the public API is still very reasonably easy to use, and migrating to the new API only takes changes to 2-3 lines of code (check the updated examples).

Closes #781.

Checklist

  • All new or modified code is well documented, especially public items
  • No new warnings or clippy suggestions have been introduced

@jbeaurivage
Copy link
Contributor Author

Tested on SAMD51 hardware.

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.

EIC accepts any pin, even if it's not the correct EXTINT pad
1 participant