Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
precision_clock_pps Struct Reference

Caller-owned autonomous one-pulse-per-second output instance. More...

#include <zephyr/precision_timing/precision_clock_pps.h>

Data Fields

struct k_work_delayable work
 Delayable poll work scheduled on the subsystem workqueue.
struct k_work_sync work_sync
 Sync object for synchronous poll cancellation during stop.
struct k_mutex lock
 Per-instance lock protecting the state below.
const struct precision_clock * precision_clk
 Protocol-neutral clock that owns the output channel.
struct precision_clock_pps_config config
 Immutable configuration copied from the caller.
precision_time_t start_lead_time_ns
 Provider's minimum lead time plus the instance's start guard.
struct precision_clock_pps_state state
 Published state snapshot.
precision_time_t clock_phc_ns
 Registered clock time at the most recent successful service read.
precision_time_t clock_mono_pre_ns
 Monotonic time immediately before that clock read.
precision_time_t clock_mono_post_ns
 Monotonic time immediately after that clock read.
bool clock_read_done
 Whether a successful clock sample is available for continuity checking.
bool read_failed
 Whether the most recent clock read failed.
uint8_t consecutive_status_errors
 Consecutive status errors, saturated at the threshold until status recovers.

Detailed Description

Caller-owned autonomous one-pulse-per-second output instance.

The structure is exposed so that it can be embedded by value, for example as a static or a member of a larger object. Its contents are managed by the precision_clock_pps_*() API. Use precision_clock_pps_state_get() to observe the instance; only config.user_data may be read directly by the caller. The storage must remain valid and must not be moved or copied. The clock must remain valid from initialization until the instance is no longer used, including between stopping and restarting it. When CONFIG_KERNEL_COHERENCE is enabled, the storage must also reside in coherent memory: the instance embeds a struct k_work_sync used by stop(), which generally cannot be on the stack. See sys_cache_is_mem_coherent().

Field Documentation

◆ clock_mono_post_ns

precision_time_t precision_clock_pps::clock_mono_post_ns

Monotonic time immediately after that clock read.

◆ clock_mono_pre_ns

precision_time_t precision_clock_pps::clock_mono_pre_ns

Monotonic time immediately before that clock read.

◆ clock_phc_ns

precision_time_t precision_clock_pps::clock_phc_ns

Registered clock time at the most recent successful service read.

◆ clock_read_done

bool precision_clock_pps::clock_read_done

Whether a successful clock sample is available for continuity checking.

◆ config

struct precision_clock_pps_config precision_clock_pps::config

Immutable configuration copied from the caller.

◆ consecutive_status_errors

uint8_t precision_clock_pps::consecutive_status_errors

Consecutive status errors, saturated at the threshold until status recovers.

◆ lock

struct k_mutex precision_clock_pps::lock

Per-instance lock protecting the state below.

◆ precision_clk

const struct precision_clock* precision_clock_pps::precision_clk

Protocol-neutral clock that owns the output channel.

◆ read_failed

bool precision_clock_pps::read_failed

Whether the most recent clock read failed.

◆ start_lead_time_ns

precision_time_t precision_clock_pps::start_lead_time_ns

Provider's minimum lead time plus the instance's start guard.

◆ state

struct precision_clock_pps_state precision_clock_pps::state

Published state snapshot.

◆ work

struct k_work_delayable precision_clock_pps::work

Delayable poll work scheduled on the subsystem workqueue.

◆ work_sync

struct k_work_sync precision_clock_pps::work_sync

Sync object for synchronous poll cancellation during stop.


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