-
Notifications
You must be signed in to change notification settings - Fork 226
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
Add type for gpio::AnyPin #1067
Conversation
2f963a0
to
9836fd3
Compare
Thanks! This is very useful Maybe the Other than that, this looks really good to me |
9836fd3
to
cb3feac
Compare
Any chance of this getting merged soon? I'm really excited about the architectural options it will enable. |
It looks good - just needs a rebase |
Not a fan of the API honestly ( |
@Volkalex28 if you're able to rebase this, then I think we're good to merge. |
Sorry for delay. I'll rebase this tomorrow. |
58143d4
to
717c55e
Compare
@bjoernQ Please check it after rebase |
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 - needs the changelog fixed before merging
Thanks! We can merge this after fixing the changelog |
717c55e
to
45a6297
Compare
This makes it possible to safely implement the InputPin and OutputPin traits for AnyPin. Now you can convert any pin to AnyPin with the appropriate type and use it in other library modules Added: - Peripheral implementation for AnyPin - Implementation of Pin for AnyPin - Implementation of OutputPin for AnyPin with type IsOutputPin - Implementation of InputPin for AnyPin with type IsInputPin - Upgrade types for AnyPin (for example InputOutputAnalogPinType -> InputOutputPinType) - Implementation of From<Gpio> for AnyPin with the appropriate type Changed: - The Gpio::degrage method returns AnyPin with the appropriate type
45a6297
to
da7a390
Compare
Let me know when I can merge this or just do it 😉 |
Sorry the changelog entry should have been added to Unreleased/Added but I probably wasn't clear about it. Going to merge it as is and I'll fix the changelog afterwards. Thanks again |
This makes it possible to safely implement the InputPin and OutputPin traits for AnyPin. Now you can convert any pin to AnyPin with the appropriate type and use it in other library modules
Added:
Changed:
A small example where this can be useful: