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

How to Establish a Continuous LPTIM Peripheral #319

Open
justacec opened this issue May 28, 2022 · 3 comments
Open

How to Establish a Continuous LPTIM Peripheral #319

justacec opened this issue May 28, 2022 · 3 comments
Labels
question Further information is requested

Comments

@justacec
Copy link

I would like to use an LPTIM peripheral to track time. To do so I would like it to be in continuous mode so it just fires off the event and then reloads and keeps going. Unfortunately, the start function implementation for the LPTIM peripherals seems to set the mode to Single. How would I go about setting this up for continuous?

@newAM
Copy link
Member

newAM commented May 28, 2022

Continuous timers are part of the PwmPin traits:

impl embedded_hal::PwmPin for $tim {

There's an example here: https://docs.rs/stm32wlxx-hal/latest/stm32wlxx_hal/lptim/trait.LpTim.html#example-5

The new_output_pin method is optional, that's just for PWM.

@newAM newAM added the question Further information is requested label May 28, 2022
@justacec
Copy link
Author

Ahh. Got it. I should have seen that. I will take a look there and see if I can get everything to work.

Thanks for being so helpful and responsive. :)

@newAM
Copy link
Member

newAM commented May 28, 2022

No problem! It is misleading being called PwmPin when the pin isn't even required 😅

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

No branches or pull requests

2 participants