stm32duino / STM32Examples

Arduino library to provide several examples for the Arduino core for STM32 MCUs.
140 stars 54 forks source link

Adding hardware timer example to show coutermode #32

Closed owennewo closed 3 years ago

owennewo commented 3 years ago

I found your other timer examples super useful, it helped me work out how to do centered timers - which is the subject of this example.

It makes use of LL_TIM* macros - and visually displays what the timer is doing e.g.

_ — ‾ ‾ — _ | _ — ‾ ‾ — _ |

This was tested in platformio and on a weird stm32g431 chip but I can't see why it won't work in arduino IDE with more normal chips e.g. stm32f103

Thanks again - you saved me hours!!

owennewo commented 3 years ago

Thanks for explaining that this repo is only hosting Arduino API code (not low level).
I do understand, but there are a lot of cool stm32 timer features that will likely never make it into arduino API eg. complementary timers with deadtime.

You can close/reject this PR.

fpistm commented 3 years ago

Thanks for your understanding. Best way to add those feature would be to enhance the HardwareTimer. Do not hesitate to contribut. :wink: