Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
PTP Clock Interface

PTP Clock Interface. More...

Data Structures

struct  ptp_clock_driver_api

Macros

#define PTP_CLOCK_NAME   "PTP_CLOCK"

Functions

static int ptp_clock_set (const struct device *dev, struct net_ptp_time *tm)
 Set the time of the PTP clock.
int ptp_clock_get (const struct device *dev, struct net_ptp_time *tm)
 Get the time of the PTP clock.
static int ptp_clock_adjust (const struct device *dev, int increment)
 Adjust the PTP clock time.
static int ptp_clock_rate_adjust (const struct device *dev, double rate)
 Adjust the PTP clock rate ratio based on its nominal frequency.

Detailed Description

PTP Clock Interface.

Macro Definition Documentation

◆ PTP_CLOCK_NAME

#define PTP_CLOCK_NAME   "PTP_CLOCK"

Function Documentation

◆ ptp_clock_adjust()

int ptp_clock_adjust ( const struct device * dev,
int increment )
inlinestatic

#include <zephyr/drivers/ptp_clock.h>

Adjust the PTP clock time.

Parameters
devPTP clock device
incrementIncrement of the clock in nanoseconds
Returns
0 if ok, <0 if error

◆ ptp_clock_get()

int ptp_clock_get ( const struct device * dev,
struct net_ptp_time * tm )

#include <zephyr/drivers/ptp_clock.h>

Get the time of the PTP clock.

Parameters
devPTP clock device
tmWhere to store the current time.
Returns
0 if ok, <0 if error

◆ ptp_clock_rate_adjust()

int ptp_clock_rate_adjust ( const struct device * dev,
double rate )
inlinestatic

#include <zephyr/drivers/ptp_clock.h>

Adjust the PTP clock rate ratio based on its nominal frequency.

Parameters
devPTP clock device
rateRate ratio based on its nominal frequency
Returns
0 if ok, <0 if error

◆ ptp_clock_set()

int ptp_clock_set ( const struct device * dev,
struct net_ptp_time * tm )
inlinestatic

#include <zephyr/drivers/ptp_clock.h>

Set the time of the PTP clock.

Parameters
devPTP clock device
tmTime to set
Returns
0 if ok, <0 if error