-
Notifications
You must be signed in to change notification settings - Fork 216
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
Consider Implementing the embedded_hal::PwmPin trait for PwmOutput Pins #360
Comments
Please do! I personally didn't want to put much effort into e-h implementations until the e-h 1.0 version settles but if you have a current need for this, I don't object to adding it. :) |
Sorry for not getting back to this! I actually had totally overlooked that PwmPin is one of the traits that's removed in embedded-hal. (Seems to me like they could/should just have I think it's better to wait on embedded-hal, and if I really need it I can fork avr-hal temporarily. |
As long as we're still depending on the old version of |
The
avr_hal_generic::simple_pwm::PwmPinOps
trait maps pretty exactly toembedded_hal::PwmPin
. ImplementingPwmPin
would be nice so users can make use of generic code that uses it.It would be nice to implement the
Pwm
trait in embedded-hal too, but I'd suggest that just doingPwmPin
is lower hanging fruit. Not sure how this matches up with #130 (in particular this comment) but adding this impl as is was super straightforward.The implementation looks like this in
simple_pwm
- I've tested this locally. The only other change needed is replacing use ofu8
in a couple places in simple_pwm with theDuty
type (this should be done anyway). I'd be happy to open a PR for this if adding the impl is given the 👍.So any
Pin<PwmOutput...>
that implsPwmPinOps
(which they all do) also now implsPwmPin
:The text was updated successfully, but these errors were encountered: