21#ifndef ZEPHYR_INCLUDE_SYS_TIMEUTIL_H_
22#define ZEPHYR_INCLUDE_SYS_TIMEUTIL_H_
_TIME_T_ time_t
Definition: _timespec.h:14
time_t timeutil_timegm(const struct tm *tm)
Convert broken-down time to a POSIX epoch offset in seconds.
int64_t timeutil_timegm64(const struct tm *tm)
Convert broken-down time to a POSIX epoch offset in seconds.
int timeutil_sync_state_set_skew(struct timeutil_sync_state *tsp, float skew, const struct timeutil_sync_instant *base)
Update the state with a new skew and possibly base value.
int timeutil_sync_ref_from_local(const struct timeutil_sync_state *tsp, uint64_t local, uint64_t *refp)
Interpolate a reference timescale instant from a local instant.
int timeutil_sync_state_update(struct timeutil_sync_state *tsp, const struct timeutil_sync_instant *inst)
Record a new instant in the time synchronization state.
int32_t timeutil_sync_skew_to_ppb(float skew)
Convert from a skew to an error in parts-per-billion.
float timeutil_sync_estimate_skew(const struct timeutil_sync_state *tsp)
Estimate the skew based on current state.
int timeutil_sync_local_from_ref(const struct timeutil_sync_state *tsp, uint64_t ref, int64_t *localp)
Interpolate a local timescale instant from a reference instant.
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__INT32_TYPE__ int32_t
Definition: stdint.h:44
__UINT64_TYPE__ uint64_t
Definition: stdint.h:61
__INT64_TYPE__ int64_t
Definition: stdint.h:45
Immutable state for synchronizing two clocks.
Definition: timeutil.h:82
uint32_t ref_Hz
Definition: timeutil.h:90
uint32_t local_Hz
Definition: timeutil.h:103
Representation of an instant in two time scales.
Definition: timeutil.h:113
uint64_t ref
Definition: timeutil.h:119
uint64_t local
Definition: timeutil.h:125
State required to convert instants between time scales.
Definition: timeutil.h:138
const struct timeutil_sync_config * cfg
Definition: timeutil.h:140
float skew
Definition: timeutil.h:166
struct timeutil_sync_instant latest
Definition: timeutil.h:149
struct timeutil_sync_instant base
Definition: timeutil.h:143