stm32f0xx-hal
stm32f0xx-hal copied to clipboard
Continue Improvements to PWM Interface
Motivation
Now that the interface to create complementary PWM channels is exposed, it should include controlling the dead time as well.
Change(s) Description
- Add
set_dead_time
function to complementary channels, provided by theComplementaryPwm
trait - Fix typo in set up of complementary channels
Testing
It works.
Limitations
The implementation I've made for now does not include any of the fancy multiplier capabilities the BDTR register provides. This only allows the dead time to be from 0-7 clock cycles.
Future
- I hope to add an interface for setting PWM channels (complementary or not) to be center aligned.
- More examples
Would you please rebase the PR to get rid of the merge (and maybe some of the intermediate sausage making)?
#170 will fix this PR.