-
Notifications
You must be signed in to change notification settings - Fork 48
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
Added the possibility to configure PWM as open drain output #84
base: main
Are you sure you want to change the base?
Conversation
src/pwm.rs
Outdated
PF9<Alternate<AF3>>, | ||
|
||
#[cfg(feature = "pwm-open-drain")] | ||
PA2<AlternateOD<AF9>>, |
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.
What about changing the pin! macro so that we only need to specify pin and alternate function here? The macro would then generate the things both for Alternate
and AlternateOD
. This would avoid some repetition, not sure if it is worth the extra complexity though. Just a thought :) ...
So instead of having to specify
PA2<Alternate<AF9>>,
PA2<AlternateOD<AF9>>,
, something like this would suffice
PA2: AF9,
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.
I think that's a good suggestion. I will pick this up after the Christmas holidays. Thank you.
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.
I changed the pin macro as you suggested.
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.
Great! :)
(BRK2: #[ $( $pmeta:meta )* ] $PINBRK2:ident, $ALTBRK2:ty, $TIMX:ty) => { | ||
$( #[ $pmeta ] )* | ||
impl FaultPins<$TIMX> for $PINBRK2<Alternate<$ALTBRK2>> { | ||
const INPUT: BreakInput = BreakInput::BreakIn; |
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.
Should this be changed to
const INPUT: BreakInput = BreakInput::BreakIn; | |
const INPUT: BreakInput = BreakInput::BreakIn2; |
?
What about going as far as something like this? |
No description provided.