-
Notifications
You must be signed in to change notification settings - Fork 2k
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
drivers/periph_timer: add periph_timer_freq feature #20131
Conversation
The optional feature allows to query the frequency a timer is actually running at. This is especially useful when the MCU is running of an integrated in-silicon RC oscillator, which may run at an actual frequency that differs a lot from the nominal frequency.
Would you mind adding a single implementation so I can test it. Other than that it makes sense! |
Did so now for the fe310. Sadly, that is a pretty boring timer :-/ |
I'll also squash the fixup that adds a missing |
The FE310 has only a 32.678 kHz RTT that is either clocked by an external watch crystal or an internal oscillator. Since this timer is always present and requires no board configuration, we can add this feature at CPU level.
512d610
to
0f39866
Compare
Let's put this on a hold. With #16349 finally on its way in, I'm not sure this is a good idea anymore. With #16349 one can just query prior to I do agree that this API can be easier to use. But as this would need to be implemented for each and every peripheral, I'm not sure if the effort to maintain it is worth the convenience. |
After a (short) discussion in the matrix room, I close this in favor of #16349 |
Contribution description
The optional feature allows to query the frequency a timer is actually running at. This is especially useful when the MCU is running of an integrated in-silicon RC oscillator, which may run at an actual frequency that differs a lot from the nominal frequency.
Testing procedure
Some PRs to add this feature will be added soonish. The test app has been extended to print the actual frequency.
Issues/PRs references
None