ztimer frequency conversion modules

ztimer frequency conversion modules More...

Detailed Description

ztimer frequency conversion modules

ztimer provides multiple conversion modules:

Modules

 conversion using shifts
 Translates between clock tick rates.
 
 plain 64bit carithmetic
 ztimer frequency conversion module (64bit arithmetic)
 
 ztimer_convert_frac frequency conversion layer
 Translates between clock tick rates.
 

Files

file  convert.h
 ztimer frequency conversion base module
 

Data Structures

struct  ztimer_convert_t
 base type for ztimer convert modules More...
 

Functions

void ztimer_convert_init (ztimer_convert_t *ztimer_convert, ztimer_clock_t *lower, uint32_t max_value)
 Initialization function for ztimer_convert_t. More...
 
void ztimer_convert_cancel (ztimer_clock_t *clock)
 ztimer_convert common cancel() op More...
 

Function Documentation

◆ ztimer_convert_cancel()

void ztimer_convert_cancel ( ztimer_clock_t clock)

ztimer_convert common cancel() op

Used by some conversion modules as ztimer_clock_t::ops.cancel().

Parameters
[in]clockztimer clock to operate on

◆ ztimer_convert_init()

void ztimer_convert_init ( ztimer_convert_t ztimer_convert,
ztimer_clock_t lower,
uint32_t  max_value 
)

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_convertobject to initialize
[in]lowerlower ztimer clock
[in]max_valuemaximum value for this clock's set()