AM64x MCU+ SDK  08.02.00
iPtcpDrv.h File Reference

Go to the source code of this file.

Data Structures

struct  ptcpPortDelayVal_t
 Structure containing the port delay values of the local and remote. More...
 
struct  ptcpSyncInfo_t
 Structure containing current sync info. More...
 
struct  PNIO_TimeStamp
 
struct  LatchVars
 

Typedefs

typedef void(* ptcpCallBack_t) (uint32_t arg, uint32_t arg2)
 

Enumerations

enum  ptcpPortStatus_t { disable = 0, enable = 1 }
 Enum for enable/disable states. More...
 
enum  syncState_t { OUT_OF_SYNC, IN_SYNC, TAKEOVER_TIMEOUT, SYNC_TIMEOUT }
 Enum for the various sync states. More...
 

Functions

void PN_PTCP_registerSyncStatusCall (PN_Handle pnHandle, ptcpCallBack_t callBack)
 Registers the callback function for getting notifications about change in sync state. More...
 
void PN_PTCP_registerDelayUpdateCall (PN_Handle pnHandle, ptcpCallBack_t callBack)
 Registers the callback function for getting notifications about new cable delay measurement. More...
 
void PN_PTCP_getDelayValues (PN_Handle pnHandle, ptcpPortDelayVal_t *portDelays, uint8_t portNum)
 Returns the current cable delay related values. More...
 
void PN_PTCP_getLocalDelayValues (PN_Handle pnHandle, uint8_t portNum, uint32_t *outRxDelay, uint32_t *outTxDelay)
 Get the local port delay values. More...
 
void PN_PTCP_getRemoteDelayValues (PN_Handle pnHandle, uint8_t portNum, uint32_t *outRxDelay, uint32_t *outTxDelay)
 Get the remote port delay values. More...
 
void PN_PTCP_getSyncInfo (PN_Handle pnHandle, ptcpSyncInfo_t *syncInfo)
 Returns current sync status and other sync related info. More...
 
void PN_PTCP_getSyncMasterAddress (PN_Handle pnHandle, uint8_t *addr)
 Get the sync Master address (MAC) More...
 
void PN_PTCP_setPllWindow (PN_Handle pnHandle, uint32_t pllWindowSize)
 Sets the PLL window for sync handling. More...
 
void PN_PTCP_setSyncTimeoutFactor (PN_Handle pnHandle, uint32_t syncTimeoutFactor)
 Sets the Sync timeout factor. More...
 
void PN_PTCP_setTakeoverTimeoutFactor (PN_Handle pnHandle, uint32_t takeoverTimeoutFactor)
 Sets the takeover timeout factor. More...
 
void PN_PTCP_setSyncUUID (PN_Handle pnHandle, uint8_t *subdomainUUID)
 Sets the sync UUID for the device.
Application is also notified about the current sync status.
. More...
 
void PN_PTCP_configureSyncFwd (PRUICSS_HwAttrs const *pruicssHwAttrs, ptcpPortStatus_t state)
 Controls(enable/disable) the sync forwarding; by default it is enabled. More...
 
void PN_PTCP_configureDelayMeasurement (PN_Handle pnHandle, uint8_t portNum, ptcpPortStatus_t state)
 Controls(enable/disable) the delay measurement process on a particular port.
By default, delay measurement is enabled on both the ports. More...
 
void PN_PTCP_configureDelayResp (PRUICSS_HwAttrs const *pruicssHwAttrs, uint8_t portNum, ptcpPortStatus_t state)
 
int32_t PN_PTCP_getAbsoluteTime (PN_Handle pnHandle, PNIO_TimeStamp *p_PNIO_TimeStamp, int32_t LatchEn)
 API to return absolute PTCP time. More...
 
void PN_PTCP_latchInit (PN_Handle pnHandle)
 

Function Documentation

◆ PN_PTCP_getAbsoluteTime()

int32_t PN_PTCP_getAbsoluteTime ( PN_Handle  pnHandle,
PNIO_TimeStamp p_PNIO_TimeStamp,
int32_t  LatchEn 
)

API to return absolute PTCP time.

Absolute time calculation triggered by latch0 event or function call. When triggered by latch0 event, ISR calculates absolute time.

Parameters
[in]pnHandleProfinet Handle
[in]LatchEnTrigger
1 - Triggered by latch input
0 - Triggered by function call itself
[in]p_PNIO_TimeStampointer to structure PNIO_TimeStamp
Return values
0if device is in sync with PLC, -1 if out of sync

◆ PN_PTCP_latchInit()

void PN_PTCP_latchInit ( PN_Handle  pnHandle)