Loading...
Searching...
No Matches

Translates between clock tick rates. More...

Detailed Description

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
 

Function Documentation

◆ ztimer_convert_shift_up_init()

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.

Parameters
[in]clockpointer to instance being initialized
[in]lowerpointer to underlying clock
[in]shiftshift value to use