|
Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
|
Precision Clock. More...
Topics | |
| Precision Clock PTP Adapter | |
| Precision Clock PTP Adapter. | |
Data Structures | |
| struct | precision_clock_api |
| Operations implemented by a precision clock adapter. More... | |
| struct | precision_clock |
| Protocol-neutral precision clock instance. More... | |
Macros | |
| #define | PRECISION_CLOCK_SCALED_PPM_SHIFT 16 |
| Number of fractional bits in a scaled parts-per-million rate adjustment. | |
| #define | PRECISION_CLOCK_SCALED_PPM_ONE (INT64_C(1) << PRECISION_CLOCK_SCALED_PPM_SHIFT) |
| One part per million in the scaled rate-adjustment representation. | |
Functions | |
| int | precision_clock_read (const struct precision_clock *precision_clk, precision_time_t *time_ns) |
| Read a precision clock. | |
| int | precision_clock_set (const struct precision_clock *precision_clk, precision_time_t time_ns) |
| Set a precision clock. | |
| int | precision_clock_adjust_phase (const struct precision_clock *precision_clk, precision_time_t phase_ns) |
| Apply a phase adjustment to a precision clock. | |
| int | precision_clock_ppb_to_scaled_ppm (double ppb, int64_t *scaled_ppm) |
| Convert parts per billion to scaled parts per million. | |
| int | precision_clock_adjust_rate (const struct precision_clock *precision_clk, int64_t scaled_ppm) |
| Set the rate offset of a precision clock. | |
Precision Clock.
| #define PRECISION_CLOCK_SCALED_PPM_ONE (INT64_C(1) << PRECISION_CLOCK_SCALED_PPM_SHIFT) |
#include <zephyr/precision_timing/precision_clock.h>
One part per million in the scaled rate-adjustment representation.
| #define PRECISION_CLOCK_SCALED_PPM_SHIFT 16 |
#include <zephyr/precision_timing/precision_clock.h>
Number of fractional bits in a scaled parts-per-million rate adjustment.
| int precision_clock_adjust_phase | ( | const struct precision_clock * | precision_clk, |
| precision_time_t | phase_ns ) |
#include <zephyr/precision_timing/precision_clock.h>
Apply a phase adjustment to a precision clock.
| precision_clk | Clock to adjust. |
| phase_ns | Signed phase adjustment in nanoseconds. |
| 0 | on success. |
| int precision_clock_adjust_rate | ( | const struct precision_clock * | precision_clk, |
| int64_t | scaled_ppm ) |
#include <zephyr/precision_timing/precision_clock.h>
Set the rate offset of a precision clock.
| precision_clk | Clock to adjust. |
| scaled_ppm | Signed frequency offset from nominal in parts per million with a 16-bit binary fractional field. For example, PRECISION_CLOCK_SCALED_PPM_ONE represents 1 ppm. |
| 0 | on success. |
| int precision_clock_ppb_to_scaled_ppm | ( | double | ppb, |
| int64_t * | scaled_ppm ) |
#include <zephyr/precision_timing/precision_clock.h>
Convert parts per billion to scaled parts per million.
| ppb | Signed frequency offset from nominal in parts per billion. |
| scaled_ppm | Destination for the signed scaled parts-per-million value. |
| 0 | on success. |
| -EINVAL | if scaled_ppm is null. |
| -ERANGE | if ppb is not finite or the result is not representable. |
| int precision_clock_read | ( | const struct precision_clock * | precision_clk, |
| precision_time_t * | time_ns ) |
#include <zephyr/precision_timing/precision_clock.h>
Read a precision clock.
| precision_clk | Clock to read. |
| time_ns | Destination for the clock value in nanoseconds. |
| 0 | on success. |
| int precision_clock_set | ( | const struct precision_clock * | precision_clk, |
| precision_time_t | time_ns ) |
#include <zephyr/precision_timing/precision_clock.h>
Set a precision clock.
| precision_clk | Clock to set. |
| time_ns | New clock value in nanoseconds. |
| 0 | on success. |