[WIP] cpu/stm32_common: add LPTIM driver#7351
[WIP] cpu/stm32_common: add LPTIM driver#7351vincent-d wants to merge 2 commits intoRIOT-OS:masterfrom
Conversation
| */ | ||
| typedef struct { | ||
| TIM_TypeDef *dev; /**< timer device */ | ||
| TIM_TypeDef *dev; /**< timer device, not set for LPTIM */ |
There was a problem hiding this comment.
why not? Set it to LPTIM1 and you can use dev(tim)-> below in line 223, too.
There was a problem hiding this comment.
Main reason is that LPTIM1 is not a TIM_TypeDef * so we could either use an union or a void *.
We would then need a dev_lptim(tim) to return the pointer with the right type.
There was a problem hiding this comment.
ah, different low-level types, haven't seen that.
|
This looks rather hacky to me, and does once more point out the problems of For the long term we will have a redone/overworked high level timer system, that can simply utilize the But for the short term, I see only two options: 'hack' the periph/timer implementation to make use of both |
|
Hi, what status of this issue now? @vincent-d |
|
I did not work on this recently, as it didn't really reached a consensus. But the LPTIM can be accessed through If one think it still useful to add the support through |
I have a working prototype here. Soon as the staging tree is in place (or an alternative), I'll PR so we can discuss more visibly. @gebart and @ZetaR60 also have coded towards better timers. There's already a periph_rtt backend in ztimer, so LPTIM should already be usable with that. |
@kaspar030, I don't understand why you think having the staging tree is a requirement for this feature. It appears that at least @vincent-d, @gebart, @ZetaR60 (all maintainers) are interested by such a feature and already started to also work on that on their side. They should be enough motivated (and I will) to give help and speed-up the review/merge process. Since it's a core feature, many existing features in RIOT will certainly benefit from it. Please open the PR asap! |
I agree with this. I think it would be beneficial to merge your work directly in the mainline. Closing this one anyway. |
It is not at all a requirement. I just didn't expect staging/ to be blocked that long, and I think something like ztimer would be quite useful even volatile and / or unpolished, thus ideal for staging/. |
This is rough and WIP, but it adds an implementation of timer API for the stm32f4 LPTIM.
tests/xtimer_msgworks, buttests/xtimer_longtermdoes not, and I don't know why!Not related to that PR, but pm / pm_layered do not work on stm32...