Zephyr API Documentation
3.6.99
A Scalable Open Source RTOS
|
generic Precision Time Protocol (gPTP) support More...
Data Structures | |
struct | gptp_scaled_ns |
Scaled Nanoseconds. More... | |
struct | gptp_uscaled_ns |
UScaled Nanoseconds. More... | |
struct | gptp_port_identity |
Port Identity. More... | |
struct | gptp_flags |
gPTP message flags More... | |
struct | gptp_hdr |
gPTP message header More... | |
struct | gptp_phase_dis_cb |
Phase discontinuity callback structure. More... | |
struct | gptp_clk_src_time_invoke_params |
ClockSourceTime.invoke function parameters. More... | |
Typedefs | |
typedef void(* | gptp_phase_dis_callback_t) (uint8_t *gm_identity, uint16_t *time_base, struct gptp_scaled_ns *last_gm_ph_change, double *last_gm_freq_change) |
Define callback that is called after a phase discontinuity has been sent by the grandmaster. | |
typedef void(* | gptp_port_cb_t) (int port, struct net_if *iface, void *user_data) |
Callback used while iterating over gPTP ports. | |
Functions | |
void | gptp_register_phase_dis_cb (struct gptp_phase_dis_cb *phase_dis, gptp_phase_dis_callback_t cb) |
Register a phase discontinuity callback. | |
void | gptp_unregister_phase_dis_cb (struct gptp_phase_dis_cb *phase_dis) |
Unregister a phase discontinuity callback. | |
void | gptp_call_phase_dis_cb (void) |
Call a phase discontinuity callback function. | |
int | gptp_event_capture (struct net_ptp_time *slave_time, bool *gm_present) |
Get gPTP time. | |
char * | gptp_sprint_clock_id (const uint8_t *clk_id, char *output, size_t output_len) |
Utility function to print clock id to a user supplied buffer. | |
void | gptp_foreach_port (gptp_port_cb_t cb, void *user_data) |
Go through all the gPTP ports and call callback for each of them. | |
struct gptp_domain * | gptp_get_domain (void) |
Get gPTP domain. | |
void | gptp_clk_src_time_invoke (struct gptp_clk_src_time_invoke_params *arg) |
This interface is used by the ClockSource entity to provide time to the ClockMaster entity of a time-aware system. | |
struct gptp_hdr * | gptp_get_hdr (struct net_pkt *pkt) |
Return pointer to gPTP packet header in network packet. | |
generic Precision Time Protocol (gPTP) support
gptp_phase_dis_callback_t |
#include <zephyr/net/gptp.h>
Define callback that is called after a phase discontinuity has been sent by the grandmaster.
gm_identity | A pointer to first element of a ClockIdentity array. The size of the array is GPTP_CLOCK_ID_LEN. |
time_base | A pointer to the value of timeBaseIndicator of the current grandmaster. |
last_gm_ph_change | A pointer to the value of lastGmPhaseChange received from grandmaster. |
last_gm_freq_change | A pointer to the value of lastGmFreqChange received from the grandmaster. |
gptp_port_cb_t |
#include <zephyr/net/gptp.h>
Callback used while iterating over gPTP ports.
port | Port number |
iface | Pointer to network interface |
user_data | A valid pointer to user data or NULL |
void gptp_call_phase_dis_cb | ( | void | ) |
#include <zephyr/net/gptp.h>
Call a phase discontinuity callback function.
void gptp_clk_src_time_invoke | ( | struct gptp_clk_src_time_invoke_params * | arg | ) |
#include <zephyr/net/gptp.h>
This interface is used by the ClockSource entity to provide time to the ClockMaster entity of a time-aware system.
arg | Current state and parameters of the ClockSource entity. |
int gptp_event_capture | ( | struct net_ptp_time * | slave_time, |
bool * | gm_present | ||
) |
#include <zephyr/net/gptp.h>
Get gPTP time.
slave_time | A pointer to structure where timestamp will be saved. |
gm_present | A pointer to a boolean where status of the presence of a grand master will be saved. |
void gptp_foreach_port | ( | gptp_port_cb_t | cb, |
void * | user_data | ||
) |
#include <zephyr/net/gptp.h>
Go through all the gPTP ports and call callback for each of them.
cb | User-supplied callback function to call |
user_data | User specified data |
struct gptp_domain * gptp_get_domain | ( | void | ) |
#include <zephyr/net/gptp.h>
Get gPTP domain.
This contains all the configuration / status of the gPTP domain.
#include <zephyr/net/gptp.h>
Return pointer to gPTP packet header in network packet.
pkt | Network packet (received or sent) |
void gptp_register_phase_dis_cb | ( | struct gptp_phase_dis_cb * | phase_dis, |
gptp_phase_dis_callback_t | cb | ||
) |
#include <zephyr/net/gptp.h>
Register a phase discontinuity callback.
phase_dis | Caller specified handler for the callback. |
cb | Callback to register. |
#include <zephyr/net/gptp.h>
Utility function to print clock id to a user supplied buffer.
clk_id | Clock id |
output | Output buffer |
output_len | Output buffer len |
void gptp_unregister_phase_dis_cb | ( | struct gptp_phase_dis_cb * | phase_dis | ) |
#include <zephyr/net/gptp.h>
Unregister a phase discontinuity callback.
phase_dis | Caller specified handler for the callback. |