ztimer frequency conversion modules
More...
ztimer frequency conversion modules
ztimer provides multiple conversion modules:
- ztimer_convert_shift: should be used if the fraction is a power of two.
- ztimer_convert_frac: should be used if the fraction is not a power of two. rounding might be a bit off for some fractions.
- ztimer_convert_muldiv64: can be used instead of ztimer_convert_frac, if 64bit division is cheap on the target board.
|
file | convert.h |
| ztimer frequency conversion base module
|
|
◆ ztimer_convert_cancel()
ztimer_convert common cancel() op
Used by some conversion modules as ztimer_clock_t::ops.cancel().
- Parameters
-
[in] | clock | ztimer clock to operate on |
◆ ztimer_convert_init()
Initialization function for ztimer_convert_t.
max_value
needs to be set to the maximum value that can be converted without overflowing. E.g., if the conversion module slows down a lower clock by factor X, max_value needs to be set to UINT32_MAX / X.
- Parameters
-
[in,out] | ztimer_convert | object to initialize |
[in] | lower | lower ztimer clock |
[in] | max_value | maximum value for this clock's set() |