Zephyr API Documentation
3.7.0
A Scalable Open Source RTOS
|
State required to convert instants between time scales. More...
#include <timeutil.h>
Data Fields | |
const struct timeutil_sync_config * | cfg |
Pointer to reference and local rate information. | |
struct timeutil_sync_instant | base |
The base instant in both time scales. | |
struct timeutil_sync_instant | latest |
The most recent instant in both time scales. | |
float | skew |
The scale factor used to correct for clock skew. | |
State required to convert instants between time scales.
This state in conjunction with functions that manipulate it capture the offset information necessary to convert between two timescales along with information that corrects for skew due to inaccuracies in clock rates.
State objects should be zero-initialized before use.
struct timeutil_sync_instant timeutil_sync_state::base |
The base instant in both time scales.
const struct timeutil_sync_config* timeutil_sync_state::cfg |
Pointer to reference and local rate information.
struct timeutil_sync_instant timeutil_sync_state::latest |
The most recent instant in both time scales.
This is captured here to provide data for skew calculation.
float timeutil_sync_state::skew |
The scale factor used to correct for clock skew.
The nominal rate for the local counter is assumed to be inaccurate but stable, i.e. it will generally be some parts-per-million faster or slower than specified.
A duration in observed local clock ticks must be multiplied by this value to produce a duration in ticks of a clock operating at the nominal local rate.
A zero value indicates that the skew has not been initialized. If the value is zero when base is initialized the skew will be set to 1. Otherwise the skew is assigned through timeutil_sync_state_set_skew().