STM32 Timer: connect and configureOutputChannel #908
strongly-typed
started this conversation in
Ideas
Replies: 3 comments 5 replies
-
I have made a proof-of-concept on that branch. With that change you can now also write:
This only implements it for those two methods in the general-purpose timer implementation but feel free to take my changes and extend them if you like. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Nice, though it would have to be for backward compatibility: Timer4::configureOutputSignal<GpioB7::Ch2>(Timer4::OutputCompareMode::Pwm, 0);
Timer4::setCompareValueSignal<GpioB7::Ch2>(1000); or alternatively you could also do this less elegant version: Timer4::configureOutputChannel(Timer4::signalToChannel<GpioB7::Ch2>(), Timer4::OutputCompareMode::Pwm, 0); |
Beta Was this translation helpful? Give feedback.
5 replies
-
This feature has been implemented in #912 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
connect
uses a symbolic template parameter to connect to the pin:Timer4::connect<GpioB7::Ch2>();
whereas
configureOutputChannel
uses a plain int for this.Timer4::configureOutputChannel(2, Timer4::OutputCompareMode::Pwm, 0);
I would love to create a template class that gets
GpioB7::Ch2
as a template parameter and then uses this forconnect
(possible) and deduced the channel number2
from the template parameterGpioB7::Ch2
.Is there any chance to get something like
GpioB7::Ch2::ChId
or similar that can be passed toconfigureOutputChannel
?Beta Was this translation helpful? Give feedback.
All reactions