Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
ptp_clock.h File Reference
#include <zephyr/kernel.h>
#include <stdint.h>
#include <zephyr/device.h>
#include <zephyr/sys/util.h>
#include <zephyr/net/ptp_time.h>
#include <zephyr/syscalls/ptp_clock.h>

Go to the source code of this file.

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 time change rate when compared to its neighbor.
 

Macro Definition Documentation

◆ PTP_CLOCK_NAME

#define PTP_CLOCK_NAME   "PTP_CLOCK"

Function Documentation

◆ ptp_clock_adjust()

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

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 )

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()

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

Adjust the PTP clock time change rate when compared to its neighbor.

Parameters
devPTP clock device
rateRate of the clock time change
Returns
0 if ok, <0 if error

◆ ptp_clock_set()

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

Set the time of the PTP clock.

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