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, by using bit shifts. Thus it works only for fractions that are powers of 2.
Files | |
file | convert_shift.h |
ztimer_convert_shift interface definitions | |
Data Structures | |
struct | ztimer_convert_shift_t |
ztimer_convert_shift frequency conversion layer class More... | |
Functions | |
void | ztimer_convert_shift_up_init (ztimer_convert_shift_t *clock, ztimer_clock_t *lower, unsigned shift) |
ztimer_convert_shift init() for (fake) increasing timer frequency More... | |
void ztimer_convert_shift_up_init | ( | ztimer_convert_shift_t * | clock, |
ztimer_clock_t * | lower, | ||
unsigned | shift | ||
) |
ztimer_convert_shift init() for (fake) increasing timer frequency
Will cause every lower now() to be left-shifted and every set() to be right-shifted.
[in] | clock | pointer to instance being initialized |
[in] | lower | pointer to underlying clock |
[in] | shift | shift value to use |