AM263Px INDUSTRIAL COMMUNICATIONS SDK  10.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)
 
typedef void(* ptcpSyncCallBack_t) (PN_Handle arg1)
 

Enumerations

enum  ptcpPortStatus_t { disable = 0, enable = 1 }
 Enum for enable/disable states. More...
 
enum  syncState_t {
  OUT_OF_SYNC = 0, IN_SYNC, TAKEOVER_TIMEOUT, SYNC_TIMEOUT,
  SYNC_RESET
}
 Enum for the various sync states. More...
 
enum  icssIepClkFreq {
  ICSS_IEP_CLK_FREQ_200MHZ = 200000000, ICSS_IEP_CLK_FREQ_250MHZ = 250000000, ICSS_IEP_CLK_FREQ_333MHZ = 333333333, ICSS_IEP_CLK_FREQ_200MHZ = 200000000,
  ICSS_IEP_CLK_FREQ_250MHZ = 250000000, ICSS_IEP_CLK_FREQ_333MHZ = 333333333
}
 ICSS IEP Clock Frequencies. 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_registerSyncMonitorCall (PN_Handle pnHandle, ptcpSyncCallBack_t callBack)
 Registers the callback function for custom sync timeout monitor typedef void (ptcpSyncCallBack_t)(void arg1);
arg1: pnHandle. 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_setIepIncrementValue (PN_Handle pnHandle, uint32_t icssIepClockFreq)
 Sets the IEP increment value based on the ICSS IEP clock frequency. More...
 
void PN_PTCP_adjustIepCounter (PN_Handle pnHandle, int32_t adjDelta)
 Adjusts the IEP counter to synchronize it with the master device, by adjusting the counter increment value and enabling slow compensation. More...
 
void PN_PTCP_initIepConfig (PN_Handle pnHandle)
 Initialize the IEP configuration register. More...
 
void PN_PTCP_configPortDelay (PN_Handle pnHandle, uint16_t phyRxDelay, uint16_t phyTxDelay)
 Configure the Port Rx and Tx delay. 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_setIepIncrementValue()

void PN_setIepIncrementValue ( PN_Handle  pnHandle,
uint32_t  icssIepClockFreq 
)

Sets the IEP increment value based on the ICSS IEP clock frequency.

Parameters
pnHandleProfinet Handle
icssIepClockFreqICSS IEP clock frequency

◆ PN_PTCP_adjustIepCounter()

void PN_PTCP_adjustIepCounter ( PN_Handle  pnHandle,
int32_t  adjDelta 
)

Adjusts the IEP counter to synchronize it with the master device, by adjusting the counter increment value and enabling slow compensation.

Parameters
[in]pnHandleProfinet Handle
[in]adjDeltaTiming difference between master and device clocks

◆ PN_PTCP_initIepConfig()

void PN_PTCP_initIepConfig ( PN_Handle  pnHandle)

Initialize the IEP configuration register.

Sets the default increment counter value and compare increment value based on IEP clock frequency

Parameters
[in]pnHandleProfinet Handle

◆ PN_PTCP_configPortDelay()

void PN_PTCP_configPortDelay ( PN_Handle  pnHandle,
uint16_t  phyRxDelay,
uint16_t  phyTxDelay 
)

Configure the Port Rx and Tx delay.

Configures the port Rx and Tx delay values based on PHY module.

Parameters
[in]pnHandleProfinet Handle
[in]phyRxDelayPHY Rx Delay Value
[in]phyTxDelayPHY Tx Delay Value

◆ PN_PTCP_latchInit()

void PN_PTCP_latchInit ( PN_Handle  pnHandle)