-
Notifications
You must be signed in to change notification settings - Fork 1.3k
mimxrt10xx: Implement pin claiming, pin reset, and pin protections #2898
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
Conversation
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.
This looks like a good start! Just a couple comments.
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.
Good work! Some comments and ideas
@tannewt @arturo182 issues reworked, this should be good for re-review. |
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.
Looks good to me too! Thanks!
This PR expands the Microcontroller/Pin module to allow pin objects to be claimed and reset in the context of a python program. Claiming prevents pins that have previously been used for a peripheral instance from being used again without a de-init, and resetting returns pins to their startup state. All pins except those in the never_reset array are automatically reset at startup and soft reboots.
This ended up being a little trickier than it usually is for other ports, since the i.MX does not have a pin reset function in the SDK, and has unique reset values for many pins. Additionally, it is more difficult to iterate through pins on the i.MX since GPIO banks are frequently left incomplete, with fewer than 32 pins included per bank. I resolved this by adding an iterable pin array and some new values to the pin object, but I'm open to any and all suggestions on approach!
This makes some assumptions about what pins to include in never_reset for the feathers, since I don't have their schematics - @arturo182 and @tannewt, please double check these if you can to ensure my guesses are correct.
Tested on 1010 EVK, still double checking the 1020 and 1060 so should not be merged until those are done.
resolves #2486
resolves #2481
resolves #2479