Zephyr API Documentation 4.0.0-rc2
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
timeutil_sync_config Struct Reference

Immutable state for synchronizing two clocks. More...

#include <timeutil.h>

Data Fields

uint32_t ref_Hz
 The nominal instance counter rate in Hz.
 
uint32_t local_Hz
 The nominal local counter rate in Hz.
 

Detailed Description

Immutable state for synchronizing two clocks.

Values required to convert durations between two time scales.

Note
The accuracy of the translation and calculated skew between sources depends on the resolution of these frequencies. A reference frequency with microsecond or nanosecond resolution would produce the most accurate tracking when the local reference is the Zephyr tick counter. A reference source like an RTC chip with 1 Hz resolution requires a much larger interval between sampled instants to detect relative clock drift.

Field Documentation

◆ local_Hz

uint32_t timeutil_sync_config::local_Hz

The nominal local counter rate in Hz.

This value is assumed to be inaccurate but reasonably stable. For a local clock driven by a crystal oscillator an error of 25 ppm is common; for an RC oscillator larger errors should be expected. The timeutil_sync infrastructure can calculate the skew between the local and reference clocks and apply it when converting between time scales.

The value must be positive.

◆ ref_Hz

uint32_t timeutil_sync_config::ref_Hz

The nominal instance counter rate in Hz.

This value is assumed to be precise, but may drift depending on the reference clock source.

The value must be positive.


The documentation for this struct was generated from the following file: