Module time

Module time 

Source
Expand description

Device timestamp helpers and host mapping utilities.

The TimeSync struct maintains a sliding window of timestamp measurements and computes a linear model mapping device ticks to host time. It supports:

  • Configurable window capacity
  • Optional outlier trimming for robustness
  • Both immediate (auto-fit on update) and deferred (manual fit) modes

Structs§

TimeSync
Maintain a linear mapping between device ticks and host time.

Enums§

TimeError
Errors encountered while interacting with timestamp control registers.

Constants§

DEFAULT_TIME_WINDOW
Default maximum number of samples kept for linear regression.
REG_TIMESTAMP_CONTROL
Address of the SFNC TimestampControl register.
REG_TIMESTAMP_TICK_FREQUENCY
Address of the SFNC TimestampTickFrequency register (64-bit).
REG_TIMESTAMP_VALUE
Address of the SFNC TimestampValue register (64-bit).
TIMESTAMP_LATCH_BIT
Bit flag to latch the timestamp counter.
TIMESTAMP_RESET_BIT
Bit flag to reset the timestamp counter.

Traits§

ControlChannel
Minimal interface required to read/write timestamp registers.

Functions§

read_tick_frequency
Read the device tick frequency.
read_timestamp_value
Read the current 64-bit timestamp value from the device.
timestamp_latch
Latch the current timestamp counter to make it readable without jitter.
timestamp_reset
Issue a timestamp reset using the SFNC control register.