Translates between clock tick rates.
More...
Translates between clock tick rates.
Translates the ticks of an underlying clock into virtual ticks at a different frequency. This module makes use of frac for calculating fractions using multiplicative inversions, avoiding integer divisions. frac trades accuracy for speed. Please see the documentation of frac for more details.
◆ ztimer_convert_frac_change_rate()
void ztimer_convert_frac_change_rate |
( |
ztimer_convert_frac_t * |
self, |
|
|
uint32_t |
freq_self, |
|
|
uint32_t |
freq_lower |
|
) |
| |
Change the scaling without affecting the current count.
- Parameters
-
[in] | self | pointer to instance being initialized |
[in] | freq_self | desired frequency of this clock |
[in] | freq_lower | frequency of the underlying clock |
◆ ztimer_convert_frac_init()
ztimer_convert_frac_t constructor
- Parameters
-
[in] | self | pointer to instance being initialized |
[in] | lower | pointer to underlying clock |
[in] | freq_self | desired frequency of this clock |
[in] | freq_lower | frequency of the underlying clock |