AM64x MCU+ SDK  08.02.00
iPtcpUtils.h File Reference

Go to the source code of this file.

Data Structures

struct  ptcp_iDelayResp_struct_t
 
struct  currentPtcpStatus_t
 
struct  deviceDelays_t
 
struct  devicePortOffsets_t
 
struct  debugDelay_t
 
struct  debugSync_t
 
struct  syncAnalysis_t
 

Macros

#define PRU_IEP_COUNT_REG   0x0C
 
#define PRU_IEP_CMP_CFG_REG   0x40
 
#define PRU_IEP_CMP1_REG   0x4C
 
#define PRU_IEP_SYNC_PWIDTH_REG   0x110
 
#define PRU_IEP_CAP_CFG_REG   0x10
 
#define PTCP_ENABLE_FILTER
 
#define ISR_PTCP_NUM   24
 
#define ISR_PTCP_NUM_ARM   124+32
 
#define NUM_DELAYS_SMA   7
 
#define NUM_DELAYS_BURST   5
 
#define PTCP_NUM_PORTS   2
 
#define MAX_SEQID   61435
 
#define PTCP_DELAY_REQ_LEN   60
 
#define MAX_CTR_VAL   512
 
#define INTER_DEL_REQ_GAP   200000000
 
#define INTER_DEL_REQ_GAP_MS   205
 
#define INTER_DEL_REQ_BURST_GAP_MS   8205
 
#define SYNC_INTERVAL   30000000
 
#define PORT_RX_DELAY   220
 
#define PORT_TX_DELAY   64
 
#define DEBUG_DELAY_N_ITER   200
 
#define DEBUG_SYNC_N_ITER   40000
 
#define SYNC_FILTER_SIZE   8
 
#define SYNC_ANALYSIS_N_ITER   100
 
#define SYNC_ANALYSIS_N_RESETS   40
 
#define LATCH0_EVENT   12/* Latch Event number */
 
#define SYNC_SINGLE_ITER_SIZE   200
 

Functions

void PN_PTCP_start (PN_Handle pnHandle)
 Triggers the start of ptcp protocol Should be called from stack after initialization It only controls ARM side tasks of PTCP, not PRU. More...
 
void PN_PTCP_ClockChange (PN_Handle pnHandle, uint32_t cycleTime)
 Handles the clock (IEP CMP0) change scenario. More...
 
void PN_PTCP_reset (PN_Handle pnHandle)
 reset relevant data on start or sync timeout More...
 
void PN_PTCP_init (PN_Handle pnHandle)
 Initializes the PTCP data structure and memory for PTCP pre-formatted packets. More...
 
void PN_PTCP_delayMeasurement (PN_Handle pnHandle)
 
void PN_PTCP_resetDelayValues (PN_Handle pnHandle)
 
void PN_PTCP_smaDelayMeasurement (PN_Handle pnHandle)
 
int32_t PN_PTCP_lineDelayCalc (PN_Handle pnHandle, ptcp_iDelayResp_struct_t *ptcp_iDelayResp_parsed)
 
int32_t PN_PTCP_parseInDelayResp (ptcp_iDelayResp_struct_t *ptcp_iDelayResp_parsed, uint8_t *ptcp_iDelayResp_packet, uint8_t *ptcp_iDelayFupResp_packet, int32_t w_FUP)
 
int32_t PN_PTCP_cableDelayCalc (PN_Handle pnHandle, ptcp_iDelayResp_struct_t *ptcp_iDelayResp_parsed, uint8_t port)
 
uint32_t PN_PTCP_rotUint (uint32_t *input)
 
uint16_t PN_PTCP_rotUshort (uint16_t *input)
 
int32_t PN_PTCP_setupIsr (PN_Handle pnHandle)
 
void PN_PTCP_isrHandler (void *arg)
 Profinet PTCP ISR handler. More...
 
int32_t PN_PTCP_enableIsr (PN_Handle pnHandle)
 
void PN_PTCP_syncHandling (PN_Handle pnHandle)
 
void PN_PTCP_syncIepAdjustment (PN_Handle pnHandle, int32_t ecapPeriod, uint32_t compensation)
 
int32_t PN_PTCP_parseSyncFields (PN_Handle pnHandle, volatile ptcpSyncInfo_t *ptcp_sync_parsed, uint8_t *sync_sblock)
 
void PN_PTCP_syncPreprocess (PN_Handle pnHandle, uint8_t ctrlByte)
 
void PN_PTCP_portDelaySmaCalc (PN_Handle pnHandle, uint8_t portNum)
 
void PN_PTCP_processDelayResponse (PN_Handle pnHandle, uint8_t portNum)
 
void PN_PTCP_resetDelayTimings (PN_Handle pnHandle, uint8_t portNum)
 
int32_t PN_PTCP_adjCtrDiff (PN_Handle pnHandle, int32_t ctrDiff)
 
int32_t PN_PTCP_absVal (int32_t num)
 
void PN_PTCP_syncTimeoutMonitor (PN_Handle pnHandle)
 
void PN_PTCP_taskSleep (uint32_t mSec)
 
void PN_PTCP_configureSync0Pin (PN_Handle pnHandle)
 
int32_t PN_PTCP_modFunc (int32_t num, uint32_t mod)
 
void PN_PTCP_triggerMeasurement (PN_Handle pnHandle)