Skip to content
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

PWM interface only exposed for TIM2 #79

Open
berkowski opened this issue Feb 15, 2020 · 2 comments
Open

PWM interface only exposed for TIM2 #79

berkowski opened this issue Feb 15, 2020 · 2 comments

Comments

@berkowski
Copy link

I'm looking at using this crate for a device built around the STM32L071 and found that the PWM interface is only exposed for TIM2. I'll need PWM on TIM3 as well and looked into making a PR when I noticed things were pretty hard-coded in pwm.rs.

Is there any reason things are the way they are with the current implementation? What kind of changes would be allowed to provide a more generic creation of PWM interfaces for the other timers?

I also have an idea of adding category features to enable specific peripherals following the tables in the reference manuals such as Table 2 in RM0377. Right now all peripherals are available even if your specific device doesn't have them.

@almusil
Copy link
Contributor

almusil commented Apr 23, 2020

Hi,
AFAIK the pwm module is missing only PIN mapping for TIM3. The TIM3 and TIM2 are configured from the same registers that's why PAC TIM3 points to the same register block as TIM2.

IMO exposing the pins should be done under the io-STM32L071 feature. I can post a PR for that if you want.

On the other support for the TIM21 and TIM22 is another story but still doable.

@berkowski
Copy link
Author

I ended up just using the PAC crate directly without stm32l0xx-hal. Too many of my requirements were half- or unsupported that using the HAL as is just didn't make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants