All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
ztimer frequency conversion modules

ztimer frequency conversion modules More...

Detailed Description

ztimer frequency conversion modules

ztimer provides multiple conversion modules:

Topics

 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.
 
void ztimer_convert_cancel (ztimer_clock_t *clock)
 ztimer_convert common cancel() op
 
void ztimer_convert_start (ztimer_clock_t *clock)
 ztimer_convert common start() op
 
void ztimer_convert_stop (ztimer_clock_t *clock)
 ztimer_convert common stop() op
 

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()

◆ ztimer_convert_start()

void ztimer_convert_start ( ztimer_clock_t * clock)

ztimer_convert common start() op

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

Parameters
[in]clockztimer clock to operate on

◆ ztimer_convert_stop()

void ztimer_convert_stop ( ztimer_clock_t * clock)

ztimer_convert common stop() op

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

Parameters
[in]clockztimer clock to operate on