-
Notifications
You must be signed in to change notification settings - Fork 211
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
Tracking issue for input/output pin traits #397
Comments
I already mentioned this in the prior There is two things that could change between an input and an output config:
Should switching an Further, should pin configs that are already
Another question is: Who decides which pin configuration combinations should form an |
it's certainly tricky to express all this huh! i wonder if the type-based swap read and write types is a little artificial. could we stack traits into something like alternately we could add a |
First I'd like to point out that there are 2 questions here :
Let's consider only the second question and answer the first one once we get there. I know that all of you know this but et me state the actors here, and their needs :
Translated into code
Implementing I think this impedance mismatch should be resolved by the hal, it should provide a trait for the consumer, Here is my attempt : 25d4f39 There is a conversion trait that everyone can implement (and same for output) and could be useful not only for IoPin
There is a, iopin trait that is nice to use
And there is an implementation of an IoPin called I don't know if having infallible conversion would allow an infallible GenericIoPin since there is is still an |
The input/output pin trait available on the 0.2.x versions have been removed ahead of the 1.0.0 release. See: #357
This issue servers as a tracking issue until we add them back.
An interface should be worked out which allows changing the pin mode while being useful and usable by both generic drivers as well as MCU/OS HAL implementations.
IOPin trait as of the 0.2.7 release:
Relevant issues/PRs:
digital::IoPin
, pins that can switch between input and output modes at runtime #29Please feel free to participate, highlight your current use cases, problems and provide solutions.
The text was updated successfully, but these errors were encountered: