![]() |
flexPTP 1.0
An IEEE 1588 PTP implementation designed for microcontrollers
|
This module defines the fundamental PTP message and state machine type, flags, bitfields and the PTP engine's internal state types. More...
#include <stdbool.h>#include <stdint.h>#include "event.h"#include "ptp_defs.h"#include "timeutils.h"#include "ptp_sync_cycle_data.h"#include <flexptp_options.h>Go to the source code of this file.
Data Structures | |
| struct | PtpFlags |
| PTP flags structure. More... | |
| struct | PtpHeader |
| PTP message header structure. More... | |
| struct | PtpDelay_RespIdentification |
| Identification carrying Delay_Resp message. More... | |
| struct | RawPtpMessage |
| struct | PtpAnnounceBody |
| Contents of a PTP Announce message without the common PTP header. More... | |
| struct | PtpBmcaState |
| BMCA state. More... | |
| struct | PtpProfileTlvElement |
| PTP profile additional data list element. More... | |
| struct | PtpProfile |
| PTP profile structure. More... | |
| struct | PtpTlvHeader |
| PTP TLV. More... | |
| struct | PtpSlaveMessagingState |
| PTP slave messaging state structure. More... | |
| struct | PtpMasterMessagingState |
| PTP master messaging state structure. More... | |
| struct | PtpP2PSlaveInfo |
| PTP P2P slave info structure;. More... | |
| struct | PtpHWClockState |
| Hardware clock state. More... | |
| struct | PtpNetworkState |
| Network state. More... | |
| struct | PtpStats |
| Structure for statistics. More... | |
| struct | PtpCoreState |
| Giant PTP core state object. More... | |
Macros | |
| #define | MAX_PTP_MSG_SIZE (128) |
| Maximum PTP message size. | |
| #define | PTP_VARIANCE_HAS_NOT_BEEN_COMPUTED (0xFFFF) |
| #define | PTP_TLV_HEADER |
Typedefs | |
| typedef TimerHandle_t | TimerType |
| typedef void() | TxCb(const struct RawPtpMessage_ *pMsg) |
| |
| typedef PtpAnnounceBody | PtpMasterProperties |
| typedef void(* | PtpSyncCallback) (int64_t time_error, const PtpSyncCycleData *pSCD, uint32_t freqCodeWord) |
| typedef void(* | PtpUserEventCallback) (PtpUserEventCode uev) |
This module defines the fundamental PTP message and state machine type, flags, bitfields and the PTP engine's internal state types.
Definition in file ptp_types.h.
| #define MAX_PTP_MSG_SIZE (128) |
Maximum PTP message size.
Definition at line 165 of file ptp_types.h.
| #define PTP_TLV_HEADER |
Length of this TLV
Definition at line 400 of file ptp_types.h.
| #define PTP_VARIANCE_HAS_NOT_BEEN_COMPUTED (0xFFFF) |
Definition at line 256 of file ptp_types.h.
| typedef PtpAnnounceBody PtpMasterProperties |
Definition at line 273 of file ptp_types.h.
| typedef void(* PtpSyncCallback) (int64_t time_error, const PtpSyncCycleData *pSCD, uint32_t freqCodeWord) |
Sync callback type prototype.
Definition at line 476 of file ptp_types.h.
| typedef void(* PtpUserEventCallback) (PtpUserEventCode uev) |
User event callback prototype.
Definition at line 487 of file ptp_types.h.
| typedef TimerHandle_t TimerType |
Definition at line 29 of file ptp_types.h.
| typedef void() TxCb(const struct RawPtpMessage_ *pMsg) |
Definition at line 175 of file ptp_types.h.
| enum BmcaCandidateState |
BMCA candidate states.
| Enumerator | |
|---|---|
| BMCA_NO_CANDIDATE | No candidate on the network. |
| BMCA_CANDIDATE_COLLECTION | Collecting candidates, we are in the candidate collection time window. |
Definition at line 295 of file ptp_types.h.
| enum BmcaMasterState |
BMCA master states.
| Enumerator | |
|---|---|
| BMCA_NO_MASTER | No master. |
| BMCA_MASTER_REMOTE | A remote master is found to be the best. |
| BMCA_MASTER_ME | I am the best master, yeey! |
Definition at line 286 of file ptp_types.h.
| enum PtpBmcaFsmState |
| Enumerator | |
|---|---|
| PTP_BMCA_INITIALIZING | |
| PTP_BMCA_LISTENING | |
| PTP_BMCA_PRE_MASTER | |
| PTP_BMCA_MASTER | |
| PTP_BMCA_SLAVE | |
| PTP_BMCA_PASSIVE | |
| PTP_BMCA_UNCALIBRATED | |
| PTP_BMCA_FAULTY | |
| PTP_BMCA_DISABLED | |
Definition at line 309 of file ptp_types.h.
| enum PtpClockAccuracy |
Standard clock accuracy definitions.
Definition at line 220 of file ptp_types.h.
| enum PtpClockClass |
Standard PTP clock classes.
Definition at line 204 of file ptp_types.h.
| enum PtpControl |
PTP header control field values.
| Enumerator | |
|---|---|
| PTP_CON_Sync | Sync. |
| PTP_CON_Delay_Req | Delay Request. |
| PTP_CON_Follow_Up | Follow Up. |
| PTP_CON_Delay_Resp | Delay Response. |
| PTP_CON_Other | Other. |
Definition at line 51 of file ptp_types.h.
| enum PtpDelayMechanism |
PTP Delay mechanism enumeration.
| Enumerator | |
|---|---|
| PTP_DM_E2E | End-to-End Delay Mechanism. |
| PTP_DM_P2P | Peer-to-Peer Delay Mechanism. |
Definition at line 144 of file ptp_types.h.
| enum PtpFastCompState |
Fast compensation states.
Definition at line 492 of file ptp_types.h.
| enum PtpLogMsgPeriods |
Enumeration for logarithmic message period boundaries.
| Enumerator | |
|---|---|
| PTP_LOGPER_MIN | Minimal logarithmic messaging period. |
| PTP_LOGPER_MAX | Maximal logarithmic messaging period. |
| PTP_LOGPER_SYNCMATCHED | Messaging occurs whenever a Sync arrives. |
Definition at line 303 of file ptp_types.h.
| enum PtpM2SState |
Core state machine states.
| Enumerator | |
|---|---|
| SIdle | Idle. |
| SWaitFollowUp | Waiting for a Follow_Up message. |
Definition at line 278 of file ptp_types.h.
| enum PtpMessageClass |
Enumeration for different PTP message classes.
| Enumerator | |
|---|---|
| PTP_MC_EVENT | Event Message Class. |
| PTP_MC_GENERAL | General Message Class. |
Definition at line 160 of file ptp_types.h.
| enum PtpMessageType |
PTP packet type enumeration.
Definition at line 37 of file ptp_types.h.
| enum PtpP2PSlaveState |
PTP P2P slave state viewed from the MASTER.
| Enumerator | |
|---|---|
| PTP_P2PSS_NONE | No slave is detected. |
| PTP_P2PSS_CANDIDATE | A slave has reported in at least once, now being checked on. |
| PTP_P2PSS_ESTABLISHED | The slave is considered stable and ready. |
Definition at line 431 of file ptp_types.h.
| enum PtpProfileFlags |
PTP profile flags.
Definition at line 346 of file ptp_types.h.
| enum PtpTimeSource |
Standard PTP time source definitions.
Definition at line 245 of file ptp_types.h.
| enum PtpTlvType |
PTP TLV types.
Definition at line 371 of file ptp_types.h.
| enum PtpTransportSpecific |
PTP transport specific enumeration.
| Enumerator | |
|---|---|
| PTP_TSPEC_UNKNOWN_DEF | Unkown Transport Specific Flag (default) |
| PTP_TSPEC_GPTP_8021AS | 802.1AS Transport Specific Flag |
Definition at line 152 of file ptp_types.h.
| enum PtpTransportType |
PTP transport type enumeration.
| Enumerator | |
|---|---|
| PTP_TP_IPv4 | IPv4 Transport Type. |
| PTP_TP_802_3 | Ethernet Transport Type. |
Definition at line 136 of file ptp_types.h.
| enum RawPtpMsgTag |
Tagging of transmitted PTP messages.
| Enumerator | |
|---|---|
| RPMT_RANDOM | Create a random, unique tag. |
| RPMT_SYNC | Sync tag. |
| RPMT_DELAY_REQ | (P)Delay_Req tag |
Definition at line 180 of file ptp_types.h.