AM263Px MCU+ SDK: icss_timeSync.h File Reference

| AM263Px MCU+ SDK 26.00.00 |

Macros | Functions
icss_timeSync.h File Reference

Go to the source code of this file.

## Macros
#define | TIME_SYNC_OK (1)
| Success. More...
#define | TIME_SYNC_UNABLE_TO_CREATE_TASK (-1)
| Time Sync module is unable to create a Task. More...
#define | TIME_SYNC_UNABLE_TO_CREATE_SEMAPHORE (-2)
| Time Sync module is unable to create a Semaphore. More...
#define | TIME_SYNC_UNABLE_TO_CREATE_INTERRUPT (-3)
| Time Sync module is unable to create an interrupt. More...
#define | TIME_SYNC_UNABLE_TO_ALLOC_MEM (-4)
| Time Sync module is unable to allocate memory. More...
#define | TIME_SYNC_UNABLE_TO_CREATE_CLOCK (-5)
| Time Sync module is unable to create timer. More...
#define | TIME_SYNC_UNABLE_TO_CREATE_MAILBOX (-6)
| Time Sync module is unable to create a mailbox. More...
#define | TIME_SYNC_UNABLE_TO_CREATE_EVENT (-7)
| Time Sync module is unable to create an event. More...
#define | TIME_SYNC_UNSUPPORTED_FORMAT (-8)
| Time Sync unsupported format. More...
#define | TIME_SYNC_EDMA_INIT_FAILED (-9)
| Time Sync not able to initialize EDMA. More...
#define | TIME_SYNC_FEATURE_NOT_ENABLED (-10)
| Time Sync feature disabled. More...
#define | TIME_SYNC_HANDLE_NOT_INITIALIZED (-11)
| Time Sync handle uninitialized. More...
#define | DEFAULT_PDELAY_REQ_LOG_INTERVAL 3
#define | DEFAULT_SYNC_SEND_LOG_INTERVAL 0
#define | DEFAULT_ANNOUNCE_SEND_LOG_INTERVAL 1
#define | DEFAULT_ANNOUNCE_TIMEOUT_LOG_INTERVAL 3
#define | TIMESYNC_SYNC_ISR_MASK_P1 0x400000
#define | TIMESYNC_SYNC_ISR_MASK_P2 0x2000000
#define | TIMESYNC_TX_TS_ISR_MASK_P1 0x800000
#define | TIMESYNC_TX_TS_ISR_MASK_P2 0x1000000
#define | PTP_SYNC_MSG_ID 0x00
#define | PTP_DLY_REQ_MSG_ID 0x01
#define | PTP_PDLY_REQ_MSG_ID 0x02
#define | PTP_PDLY_RSP_MSG_ID 0x03
#define | PTP_FOLLOW_UP_MSG_ID 0x08
#define | PTP_DLY_RESP_MSG_ID 0x09
#define | PTP_PDLY_RESP_FLW_UP_MSG_ID 0x0A
#define | PTP_ANNOUNCE_MSG_ID 0x0B
#define | PTP_MGMT_MSG_ID 0x0D
#define | PTP_FLW_UP_CTRL_MSG_ID 0x02
#define | SEC_TO_NS 1000000000
#define | FILTER_ALPHA_COEFF 0.85
#define | PTP_SYNC0_PERIOD_DIVIDER 4
#define | OFFSET_THRESHOLD_FOR_RESET 10000
#define | STABLE_FILTER_THRESHOLD 100
#define | TIMESYNC_PEER_DELAY_ERROR_THRESHOLD 10000
#define | NUM_SYNC_MISSED_THRESHOLD 3
#define | AVG_NUM_DELAY_MEASUREMENTS 3
#define | SRC_MAC_OFFSET 6
#define | IP_DSCP_OFFSET 15
#define | SRC_IP_OFFSET 26
#define | DST_IP_OFFSET 30
#define | IP_CHKSUM_OFFSET 40
#define | PTP_MSG_ID_OFFSET 42
#define | PTP_DOMAIN_NUM_OFFSET 46
#define | PTP_FLAG_OFFSET 48
#define | PTP_CORRECTION_OFFSET 50
#define | PTP_SRC_CLK_IDENTITY 62
#define | PTP_SRC_PORT_ID_OFFSET 70
#define | PTP_SEQ_ID_OFFSET 72
#define | PTP_CONTROL_MSG_ID_OFFSET 74
#define | PTP_LOG_MSG_PERIOD 75
#define | PTP_REQ_RCPT_TS_SEC_OFFSET 76
#define | PTP_REQ_RCPT_TS_NSEC_OFFSET 82
#define | PTP_REQ_SRC_PORT_IDENTITY 86
#define | PTP_REQ_SRC_PORT_ID 94
#define | PTP_UTC_OFFSET 86
#define | PTP_PRIORITY1_OFFSET 89
#define | PTP_GM_CLK_CLASS_OFFSET 90
#define | PTP_GM_CLK_ACCU_OFFSET 91
#define | PTP_GM_CLK_VARIANCE_OFFSET 92
#define | PTP_PRIORITY2_OFFSET 94
#define | PTP_GM_CLK_IDENTITY_OFFSET 95
#define | PTP_STEPS_REMOVED_OFFSET 103
#define | PTP_TIME_SRC_OFFSET 105
#define | PTP_E2E_BUFFER_OFFSET 42
#define | PTP_P2P_BUFFER_OFFSET 14
#define | ANNEX_D_ANNEX_F_DIFF 28
#define | HSR_CORRECTION 6
#define | SRC_DST_MAC_SIZE 12
#define | PTP_LEAP_61_MASK (1<<0)
#define | PTP_LEAP_59_MASK (1<<1)
#define | PTP_UTC_REASONABLE_MASK (1<<2)
#define | PTP_TIMESCALE_MASK (1<<3)
#define | PTP_TIME_TRACEABLE_MASK (1<<4)
#define | PTP_FREQ_TRACEABLE_MASK (1<<5)
#define | PTP_ALTERNATE_MASTER_MASK (1<<8)
#define | PTP_TWO_STEP_MASK (1<<9)
#define | PTP_UNICAST_MASK (1<<10)
#define | PTP_PROFILE_SPECIFIC_1_MASK (1<<13)
#define | PTP_PROFILE_SPECIFIC_2_MASK (1<<14)
#define | PTP_SECURITY_MASK (1<<15)
#define | SYNC_INTERVAL_PERIOD_CHANGE_THRESHOLD 60
#define | GPTP_NUM_DOMAINS 2
#define | PTP_FLAG_SIZE (2)
#define | PTP_SRC_CLK_IDENTITY_SIZE (8)
#define | PTP_SRC_PORT_ID_SIZE (2)
#define | PTP_GM_CLK_IDENTITY_SIZE (8)
#define | PTP_GM_CLK_CLASS_SIZE (1)
#define | PTP_GM_CLK_ACCU_SIZE (1)
#define | PTP_GM_CLK_VARIANCE_SIZE (2)
#define | PTP_UTC_SIZE (2)
#define | PTP_TIME_SRC_SIZE (1)
#define | PTP_PRIORITY1_SIZE (1)
#define | PTP_PRIORITY2_SIZE (1)
#define | PTP_STEPS_REMOVED_SIZE (2)

## Functions
void | TimeSync_resetIEP (TimeSync_ParamsHandle_t timeSyncHandle)
| Resets CMP1 once first adjustment is done, else 1PPS signal doesn't trigger. More...
void | TimeSync_doFirstAdjustment (TimeSync_ParamsHandle_t timeSyncHandle, uint8_t portNum)
| Do initial adjustment for the IEP based on sync timestamp. More...
void | TimeSync_Port1linkResetCallBack (uint8_t linkStatus, void *arg2)
| Callback for link status change on Port 1. More...
void | TimeSync_Port2linkResetCallBack (uint8_t linkStatus, void *arg2)
| Callback for link status change on Port 2. More...
void | TimeSync_reset (TimeSync_ParamsHandle_t timeSyncHandle)
| Reset the state machine in firmware to restart synchronization (First adjustment happens again) More...
void | TimeSync_processPTPFrame (TimeSync_ParamsHandle_t timeSyncHandle, uint8_t *pktBuffer, uint8_t portNum, uint16_t size, uint8_t isLinkLocal)
| Processes a PTP message and extract fields. More...
uint8_t | TimeSync_isEnabled (TimeSync_ParamsHandle_t timeSyncHandle)
| Return True/False 1/0 if timeSync module is enabled. More...
void | TimeSync_updateParentAddress (TimeSync_ParamsHandle_t timeSyncHandle, uint8_t *parentMac)
| Write the MAC ID of PTP master to Firmware. BMC Algorithm should call this API. More...
void | TimeSync_getPrevAddress (TimeSync_ParamsHandle_t timeSyncHandle, uint8_t *prevMac)
| Retuns the previous master's MAC ID. More...
void | TimeSync_getGeneralMessage (TimeSync_ParamsHandle_t timeSyncHandle, int8_t *buff)
| Copies the PTP announce message data to PTP stack buffer. More...
void | TimeSync_rxPhyDelayCorrection (TimeSync_ParamsHandle_t timeSyncHandle)
| Performs PHY delay correction on Rx timestamp Assumption : The function expects the timestamp in rxTimestamp_gPTP field on which it does correction. More...
void | TimeSync_getTxTS (TimeSync_ParamsHandle_t timeSyncHandle, uint8_t portNum, ptpFrameTypes_t frameType)
void | TimeSync_lineDelayCalc (TimeSync_ParamsHandle_t timeSyncHandle)
void | TimeSync_peerDelayCalc (TimeSync_ParamsHandle_t timeSyncHandle, uint8_t twoStep, uint8_t portNum)
void | TimeSync_processSyncFrame (TimeSync_ParamsHandle_t timeSyncHandle, uint8_t *buff, uint8_t followUp, uint8_t portNum, uint16_t size)
void | TimeSync_processDelayResFrame (TimeSync_ParamsHandle_t timeSyncHandle, uint8_t *buff, uint8_t portNum)
void | TimeSync_processPdelayReqFrame (TimeSync_ParamsHandle_t timeSyncHandle, uint8_t *buff, uint8_t portNum)
void | TimeSync_processPdelayRespFrame (TimeSync_ParamsHandle_t timeSyncHandle, uint8_t *buff, uint8_t followUp, uint8_t portNum)
void | TimeSync_forced2StepBDCalc (TimeSync_ParamsHandle_t timeSyncHandle, uint8_t portNum)
void | TimeSync_synchronizeClock (TimeSync_ParamsHandle_t timeSyncHandle)
void | TimeSync_calcNRR (TimeSync_ParamsHandle_t timeSyncHandle, uint8_t portNum)
void | TimeSync_updateNRRParams (TimeSync_ParamsHandle_t timeSyncHandle, uint8_t portNum)
void | TimeSync_calcRcfAndSyncInterval (TimeSync_ParamsHandle_t timeSyncHandle)
void | TimeSync_writeTS_SingleStep_Sync (TimeSync_ParamsHandle_t timeSyncHandle, uint8_t portNum)
void | TimeSync_dummyBMCA (TimeSync_ParamsHandle_t timeSyncHandle, uint8_t *pktBuffer)
uint64_t | getIEPTimestamp (TimeSync_ParamsHandle_t timeSyncHandle)

## Macro Definition Documentation

## ◆ TIME_SYNC_OK

#define TIME_SYNC_OK (1)

Success.

## ◆ TIME_SYNC_UNABLE_TO_CREATE_TASK

#define TIME_SYNC_UNABLE_TO_CREATE_TASK (-1)

Time Sync module is unable to create a Task.

## ◆ TIME_SYNC_UNABLE_TO_CREATE_SEMAPHORE

#define TIME_SYNC_UNABLE_TO_CREATE_SEMAPHORE (-2)

Time Sync module is unable to create a Semaphore.

## ◆ TIME_SYNC_UNABLE_TO_CREATE_INTERRUPT

#define TIME_SYNC_UNABLE_TO_CREATE_INTERRUPT (-3)

Time Sync module is unable to create an interrupt.

## ◆ TIME_SYNC_UNABLE_TO_ALLOC_MEM

#define TIME_SYNC_UNABLE_TO_ALLOC_MEM (-4)

Time Sync module is unable to allocate memory.

## ◆ TIME_SYNC_UNABLE_TO_CREATE_CLOCK

#define TIME_SYNC_UNABLE_TO_CREATE_CLOCK (-5)

Time Sync module is unable to create timer.

## ◆ TIME_SYNC_UNABLE_TO_CREATE_MAILBOX

#define TIME_SYNC_UNABLE_TO_CREATE_MAILBOX (-6)

Time Sync module is unable to create a mailbox.

## ◆ TIME_SYNC_UNABLE_TO_CREATE_EVENT

#define TIME_SYNC_UNABLE_TO_CREATE_EVENT (-7)

Time Sync module is unable to create an event.

## ◆ TIME_SYNC_UNSUPPORTED_FORMAT

#define TIME_SYNC_UNSUPPORTED_FORMAT (-8)

Time Sync unsupported format.

## ◆ TIME_SYNC_EDMA_INIT_FAILED

#define TIME_SYNC_EDMA_INIT_FAILED (-9)

Time Sync not able to initialize EDMA.

## ◆ TIME_SYNC_FEATURE_NOT_ENABLED

#define TIME_SYNC_FEATURE_NOT_ENABLED (-10)

Time Sync feature disabled.

## ◆ TIME_SYNC_HANDLE_NOT_INITIALIZED

#define TIME_SYNC_HANDLE_NOT_INITIALIZED (-11)

Time Sync handle uninitialized.

## ◆ DEFAULT_PDELAY_REQ_LOG_INTERVAL

#define DEFAULT_PDELAY_REQ_LOG_INTERVAL 3

Default PDelay Request packet interval. Actual value is 2^value seconds

## ◆ DEFAULT_SYNC_SEND_LOG_INTERVAL

#define DEFAULT_SYNC_SEND_LOG_INTERVAL 0

Default Sync transmit interval. Actual value is 2^value seconds

## ◆ DEFAULT_ANNOUNCE_SEND_LOG_INTERVAL

#define DEFAULT_ANNOUNCE_SEND_LOG_INTERVAL 1

Default Announce packet transmit interval. Actual value is 2^value seconds

## ◆ DEFAULT_ANNOUNCE_TIMEOUT_LOG_INTERVAL

#define DEFAULT_ANNOUNCE_TIMEOUT_LOG_INTERVAL 3

Default Announce packet timeout. Actual value is 2^value seconds

## ◆ TIMESYNC_SYNC_ISR_MASK_P1

#define TIMESYNC_SYNC_ISR_MASK_P1 0x400000

Interrupt mask for PRU event 22

## ◆ TIMESYNC_SYNC_ISR_MASK_P2

#define TIMESYNC_SYNC_ISR_MASK_P2 0x2000000

Interrupt mask for PRU event 25

## ◆ TIMESYNC_TX_TS_ISR_MASK_P1

#define TIMESYNC_TX_TS_ISR_MASK_P1 0x800000

## ◆ TIMESYNC_TX_TS_ISR_MASK_P2

#define TIMESYNC_TX_TS_ISR_MASK_P2 0x1000000

Interrupt mask for PRU event 24

## ◆ PTP_SYNC_MSG_ID

#define PTP_SYNC_MSG_ID 0x00

Sync message ID value

## ◆ PTP_DLY_REQ_MSG_ID

#define PTP_DLY_REQ_MSG_ID 0x01

Delay request message ID value

## ◆ PTP_PDLY_REQ_MSG_ID

#define PTP_PDLY_REQ_MSG_ID 0x02

PDelay request message ID value

## ◆ PTP_PDLY_RSP_MSG_ID

#define PTP_PDLY_RSP_MSG_ID 0x03

PDelay response message ID value

## ◆ PTP_FOLLOW_UP_MSG_ID

#define PTP_FOLLOW_UP_MSG_ID 0x08

Follow up message ID value

## ◆ PTP_DLY_RESP_MSG_ID

#define PTP_DLY_RESP_MSG_ID 0x09

Delay response message ID value

## ◆ PTP_PDLY_RESP_FLW_UP_MSG_ID

#define PTP_PDLY_RESP_FLW_UP_MSG_ID 0x0A

PDelay response follow up message ID value

## ◆ PTP_ANNOUNCE_MSG_ID

#define PTP_ANNOUNCE_MSG_ID 0x0B

Announce message ID value

## ◆ PTP_MGMT_MSG_ID

#define PTP_MGMT_MSG_ID 0x0D

Management message ID value

## ◆ PTP_FLW_UP_CTRL_MSG_ID

#define PTP_FLW_UP_CTRL_MSG_ID 0x02

Control message ID value for Follow Up

## ◆ SEC_TO_NS

#define SEC_TO_NS 1000000000

Value of seconds in nanoseconds. Useful for calculations

## ◆ FILTER_ALPHA_COEFF

#define FILTER_ALPHA_COEFF 0.85

Alpha coefficient for sync interval exponential filter and other filters

## ◆ PTP_SYNC0_PERIOD_DIVIDER

#define PTP_SYNC0_PERIOD_DIVIDER 4

CMP1 period divided by this number makes the width of the Sync pulse

## ◆ OFFSET_THRESHOLD_FOR_RESET

#define OFFSET_THRESHOLD_FOR_RESET 10000

If offset from Master goes above this threshold it will trigger a reset. Value is in nanoseconds

## ◆ STABLE_FILTER_THRESHOLD

#define STABLE_FILTER_THRESHOLD 100

When clock drift goes below this value it indicates drift has stabilized and SMA filter can kick in

## ◆ TIMESYNC_PEER_DELAY_ERROR_THRESHOLD

#define TIMESYNC_PEER_DELAY_ERROR_THRESHOLD 10000

When peer delay exceeds this value it gets reset to 0 Sometimes wrong values are calculated when doing peer delay calculation when clock on peer changes in between peer delay messages and because of the filter this value stays for a long time This helps in fixing it. This is set to a value much higher than max peer delay (of a 100 mtr cable)

## ◆ NUM_SYNC_MISSED_THRESHOLD

#define NUM_SYNC_MISSED_THRESHOLD 3

If this many consecutive sync frames are missed the DUT gets reset

## ◆ AVG_NUM_DELAY_MEASUREMENTS

#define AVG_NUM_DELAY_MEASUREMENTS 3

Number of values in the running average

## ◆ SRC_MAC_OFFSET

#define SRC_MAC_OFFSET 6

Source MAC address offset

## ◆ IP_DSCP_OFFSET

#define IP_DSCP_OFFSET 15

Differentiated Services Code Point (DSCP) offset in IP4/UDP

## ◆ SRC_IP_OFFSET

#define SRC_IP_OFFSET 26

Source IP address offset in IP4/UDP

## ◆ DST_IP_OFFSET

#define DST_IP_OFFSET 30

Destination IP address offset in IP4/UDP

## ◆ IP_CHKSUM_OFFSET

#define IP_CHKSUM_OFFSET 40

IP4 checksum offset in IP4/UDP

## ◆ PTP_MSG_ID_OFFSET

#define PTP_MSG_ID_OFFSET 42

PTP message ID offset

## ◆ PTP_DOMAIN_NUM_OFFSET

#define PTP_DOMAIN_NUM_OFFSET 46

PTP domain number offset

## ◆ PTP_FLAG_OFFSET

#define PTP_FLAG_OFFSET 48

Offset for PTP flags (including 2 step)

## ◆ PTP_CORRECTION_OFFSET

#define PTP_CORRECTION_OFFSET 50

Offset for PTP correction field

## ◆ PTP_SRC_CLK_IDENTITY

#define PTP_SRC_CLK_IDENTITY 62

Offset for PTP source clock identity (MAC + protocol id)

## ◆ PTP_SRC_PORT_ID_OFFSET

#define PTP_SRC_PORT_ID_OFFSET 70

Offset source port id

## ◆ PTP_SEQ_ID_OFFSET

#define PTP_SEQ_ID_OFFSET 72

Offset for sequence identifier (incremented every frame)

## ◆ PTP_CONTROL_MSG_ID_OFFSET

#define PTP_CONTROL_MSG_ID_OFFSET 74

Offset for message id. This categorizes frames into two groups time critical and non time critical

## ◆ PTP_LOG_MSG_PERIOD

#define PTP_LOG_MSG_PERIOD 75

Log message interval offset

## ◆ PTP_REQ_RCPT_TS_SEC_OFFSET

#define PTP_REQ_RCPT_TS_SEC_OFFSET 76

Offset for seconds timestamp

## ◆ PTP_REQ_RCPT_TS_NSEC_OFFSET

#define PTP_REQ_RCPT_TS_NSEC_OFFSET 82

Offset for nanoseconds timestamp

## ◆ PTP_REQ_SRC_PORT_IDENTITY

#define PTP_REQ_SRC_PORT_IDENTITY 86

Offset for requestor clock identity

## ◆ PTP_REQ_SRC_PORT_ID

#define PTP_REQ_SRC_PORT_ID 94

Offset for requestor port identity

## ◆ PTP_UTC_OFFSET

#define PTP_UTC_OFFSET 86

Offset for UTC offset in Announce frame

## ◆ PTP_PRIORITY1_OFFSET

#define PTP_PRIORITY1_OFFSET 89

Offset for Priority 1 field in Announce frame

## ◆ PTP_GM_CLK_CLASS_OFFSET

#define PTP_GM_CLK_CLASS_OFFSET 90

Offset for GM clock class field in Announce frame

## ◆ PTP_GM_CLK_ACCU_OFFSET

#define PTP_GM_CLK_ACCU_OFFSET 91

Offset for GM clock accuracy field in Announce frame

## ◆ PTP_GM_CLK_VARIANCE_OFFSET

#define PTP_GM_CLK_VARIANCE_OFFSET 92

Offset for GM clock variance field in Announce frame

## ◆ PTP_PRIORITY2_OFFSET

#define PTP_PRIORITY2_OFFSET 94

Offset for priority 2 field in Announce frame

## ◆ PTP_GM_CLK_IDENTITY_OFFSET

#define PTP_GM_CLK_IDENTITY_OFFSET 95

Offset for GM clock identity field in Announce frame

## ◆ PTP_STEPS_REMOVED_OFFSET

#define PTP_STEPS_REMOVED_OFFSET 103

Offset for steps removed field in Announce frame

## ◆ PTP_TIME_SRC_OFFSET

#define PTP_TIME_SRC_OFFSET 105

Offset for GM time source field in Announce frame

## ◆ PTP_E2E_BUFFER_OFFSET

#define PTP_E2E_BUFFER_OFFSET 42

Offset for start of PTP data in UDP/IP4 frame

## ◆ PTP_P2P_BUFFER_OFFSET

#define PTP_P2P_BUFFER_OFFSET 14

Offset for start of PTP data in 802.3 frame

## ◆ ANNEX_D_ANNEX_F_DIFF

#define ANNEX_D_ANNEX_F_DIFF 28

Number of Extra bytes from Annex F(802.1) to Annex E(UDP)

## ◆ HSR_CORRECTION

#define HSR_CORRECTION 6

Number of bytes in HSR Header

## ◆ SRC_DST_MAC_SIZE

#define SRC_DST_MAC_SIZE 12

Num bytes in source plus destination MAC

## ◆ PTP_LEAP_61_MASK

#define PTP_LEAP_61_MASK (1<<0)

Mask for Leap 61 status in PTP Flags

## ◆ PTP_LEAP_59_MASK

#define PTP_LEAP_59_MASK (1<<1)

Mask for Leap 59 status in PTP Flags

## ◆ PTP_UTC_REASONABLE_MASK

#define PTP_UTC_REASONABLE_MASK (1<<2)

Mask for UTC reasonable value in PTP Flags

## ◆ PTP_TIMESCALE_MASK

#define PTP_TIMESCALE_MASK (1<<3)

Mask for value indicating whether PTP Timescale in PTP Flags

## ◆ PTP_TIME_TRACEABLE_MASK

#define PTP_TIME_TRACEABLE_MASK (1<<4)

Mask for value indicating whether time traceable in PTP Flags

## ◆ PTP_FREQ_TRACEABLE_MASK

#define PTP_FREQ_TRACEABLE_MASK (1<<5)

Mask for value indicating whether freq traceable in PTP Flags

## ◆ PTP_ALTERNATE_MASTER_MASK

#define PTP_ALTERNATE_MASTER_MASK (1<<8)

Mask for value indicating whether alternate master in PTP Flags

## ◆ PTP_TWO_STEP_MASK

#define PTP_TWO_STEP_MASK (1<<9)

Mask for value indicating whether two step sync in PTP Flags

## ◆ PTP_UNICAST_MASK

#define PTP_UNICAST_MASK (1<<10)

Mask for value indicating whether messaging is unicast in PTP Flags

## ◆ PTP_PROFILE_SPECIFIC_1_MASK

#define PTP_PROFILE_SPECIFIC_1_MASK (1<<13)

Mask for value indicating alternate PTP Profile in PTP Flags

## ◆ PTP_PROFILE_SPECIFIC_2_MASK

#define PTP_PROFILE_SPECIFIC_2_MASK (1<<14)

Mask for value indicating alternate PTP Profile in PTP Flags

## ◆ PTP_SECURITY_MASK

#define PTP_SECURITY_MASK (1<<15)

Mask for value indicating whether PTP security is enabled or not in PTP Flags

## ◆ SYNC_INTERVAL_PERIOD_CHANGE_THRESHOLD

#define SYNC_INTERVAL_PERIOD_CHANGE_THRESHOLD 60

If current sync interval varies from previously measured sync interval by this much percentage then it triggers a PTP reset

## ◆ GPTP_NUM_DOMAINS

#define GPTP_NUM_DOMAINS 2

Number of domains supported by GPTP implementation

## ◆ PTP_FLAG_SIZE

#define PTP_FLAG_SIZE (2)

Size for PTP flags (including 2 step)

## ◆ PTP_SRC_CLK_IDENTITY_SIZE

#define PTP_SRC_CLK_IDENTITY_SIZE (8)

Size for PTP source clock identity (MAC + protocol id)

## ◆ PTP_SRC_PORT_ID_SIZE

#define PTP_SRC_PORT_ID_SIZE (2)

Size for source port id field

## ◆ PTP_GM_CLK_IDENTITY_SIZE

#define PTP_GM_CLK_IDENTITY_SIZE (8)

Size for GM clock identity field in Announce frame

## ◆ PTP_GM_CLK_CLASS_SIZE

#define PTP_GM_CLK_CLASS_SIZE (1)

Size for GM clock class field in Announce frame

## ◆ PTP_GM_CLK_ACCU_SIZE

#define PTP_GM_CLK_ACCU_SIZE (1)

Size for GM clock accuracy field in Announce frame

## ◆ PTP_GM_CLK_VARIANCE_SIZE

#define PTP_GM_CLK_VARIANCE_SIZE (2)

Size for GM clock variance field in Announce frame

## ◆ PTP_UTC_SIZE

#define PTP_UTC_SIZE (2)

Size for UTC offset in Announce frame

## ◆ PTP_TIME_SRC_SIZE

#define PTP_TIME_SRC_SIZE (1)

Size for GM time source field in Announce frame

## ◆ PTP_PRIORITY1_SIZE

#define PTP_PRIORITY1_SIZE (1)

Size for Priority 1 field in Announce frame

## ◆ PTP_PRIORITY2_SIZE

#define PTP_PRIORITY2_SIZE (1)

Size for Priority 2 field in Announce frame

## ◆ PTP_STEPS_REMOVED_SIZE

#define PTP_STEPS_REMOVED_SIZE (2)

Offset for steps removed field in Announce frame

## Function Documentation

## ◆ TimeSync_resetIEP()

void TimeSync_resetIEP | ( | TimeSync_ParamsHandle_t | timeSyncHandle | ) |

Resets CMP1 once first adjustment is done, else 1PPS signal doesn't trigger.

Parameters

  timeSyncHandle | pointer to PTP Handle structure

## ◆ TimeSync_doFirstAdjustment()

void TimeSync_doFirstAdjustment | ( | TimeSync_ParamsHandle_t | timeSyncHandle,
|  | uint8_t | portNum
| ) |  |

Do initial adjustment for the IEP based on sync timestamp.

Parameters

  timeSyncHandle | pointer to PTP Handle structure
  portNum | ICSS_EMAC_PORT_1 or ICSS_EMAC_PORT_2

## ◆ TimeSync_getTxTS()

void TimeSync_getTxTS | ( | TimeSync_ParamsHandle_t | timeSyncHandle,
|  | uint8_t | portNum,
|  | ptpFrameTypes_t | frameType
| ) |  |

## ◆ TimeSync_lineDelayCalc()

void TimeSync_lineDelayCalc | ( | TimeSync_ParamsHandle_t | timeSyncHandle | ) |

## ◆ TimeSync_peerDelayCalc()

void TimeSync_peerDelayCalc | ( | TimeSync_ParamsHandle_t | timeSyncHandle,
|  | uint8_t | twoStep,
|  | uint8_t | portNum
| ) |  |

## ◆ TimeSync_processSyncFrame()

void TimeSync_processSyncFrame | ( | TimeSync_ParamsHandle_t | timeSyncHandle,
|  | uint8_t * | buff,
|  | uint8_t | followUp,
|  | uint8_t | portNum,
|  | uint16_t | size
| ) |  |

## ◆ TimeSync_processDelayResFrame()

void TimeSync_processDelayResFrame | ( | TimeSync_ParamsHandle_t | timeSyncHandle,
|  | uint8_t * | buff,
|  | uint8_t | portNum
| ) |  |

## ◆ TimeSync_processPdelayReqFrame()

void TimeSync_processPdelayReqFrame | ( | TimeSync_ParamsHandle_t | timeSyncHandle,
|  | uint8_t * | buff,
|  | uint8_t | portNum
| ) |  |

## ◆ TimeSync_processPdelayRespFrame()

void TimeSync_processPdelayRespFrame | ( | TimeSync_ParamsHandle_t | timeSyncHandle,
|  | uint8_t * | buff,
|  | uint8_t | followUp,
|  | uint8_t | portNum
| ) |  |

## ◆ TimeSync_forced2StepBDCalc()

void TimeSync_forced2StepBDCalc | ( | TimeSync_ParamsHandle_t | timeSyncHandle,
|  | uint8_t | portNum
| ) |  |

## ◆ TimeSync_synchronizeClock()

void TimeSync_synchronizeClock | ( | TimeSync_ParamsHandle_t | timeSyncHandle | ) |

## ◆ TimeSync_calcNRR()

void TimeSync_calcNRR | ( | TimeSync_ParamsHandle_t | timeSyncHandle,
|  | uint8_t | portNum
| ) |  |

## ◆ TimeSync_updateNRRParams()

void TimeSync_updateNRRParams | ( | TimeSync_ParamsHandle_t | timeSyncHandle,
|  | uint8_t | portNum
| ) |  |

## ◆ TimeSync_calcRcfAndSyncInterval()

void TimeSync_calcRcfAndSyncInterval | ( | TimeSync_ParamsHandle_t | timeSyncHandle | ) |

## ◆ TimeSync_writeTS_SingleStep_Sync()

void TimeSync_writeTS_SingleStep_Sync | ( | TimeSync_ParamsHandle_t | timeSyncHandle,
|  | uint8_t | portNum
| ) |  |

## ◆ TimeSync_dummyBMCA()

void TimeSync_dummyBMCA | ( | TimeSync_ParamsHandle_t | timeSyncHandle,
|  | uint8_t * | pktBuffer
| ) |  |

## ◆ getIEPTimestamp()

uint64_t getIEPTimestamp | ( | TimeSync_ParamsHandle_t | timeSyncHandle | ) |