]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - apps/tidep0079.git/blob - EC_Master_SysBios_Am572x/SDK/INC/EcCommonPrivate.h
EC-Mater + TTS (PDK1.0.6 PSDK3.3.0.4)
[apps/tidep0079.git] / EC_Master_SysBios_Am572x / SDK / INC / EcCommonPrivate.h
1 /*-----------------------------------------------------------------------------
2  * EcCommonPrivate.h               
3  * Copyright                acontis technologies GmbH, Weingarten, Germany
4  * Response                 Stefan Zintgraf
5  * Description              Common private header shared by all AT-EM layers.
6  *---------------------------------------------------------------------------*/
8 #ifndef INC_ECCOMMONPRIVATE
9 #define INC_ECCOMMONPRIVATE
11 /*-INCLUDES------------------------------------------------------------------*/
12 #ifndef INC_ECTYPE
13   #include "EcType.h"
14 #endif
15 #ifndef INC_ECERROR
16   #include "EcError.h"
17 #endif
18 #ifndef INC_ECOS
19   #include "EcOs.h"
20 #endif
22 #ifdef __cplusplus
23 extern "C"
24 {
25 #endif
27 /*-DEFINES-------------------------------------------------------------------*/
28 #define MAX_QUEUED_ETH_FRAMES               127     /* more than this amount of frames cannot be queued due to IDX number limitation! */
29 #define DEFAULT_PHYSICAL_MBX_POLLING_TIME    10     /* default per slave physical mailbox polling */
30 #define SLAVE_STATE_UPDATE_TIMEOUT         1000     /* timeout waiting for slave state update (AL_STATUS command request result) */
31 #define SLAVE_ERROR_ACK_STATUS_TIMEOUT     1000     /* timeout waiting for slave error acknowledge status */
32 #define EC_INITCMDRETRYTIMEOUT               10     /* timeout after which retry value in InitCmds is decremented */
34 #define IS_CLIENT_RAW_CMD            0x80000000     /* marker to signal that this is a client specific raw command */
36 #define EC_MBX_DEFAULT_TIMEOUT       0x80002710     /* 10000 if Mbx cmd is commited with no_wait use this
37                                                      * timeout in msecs for internal handling
38                                                      * The highest bit 0x80000000 is set to recognize the 
39                                                      * default timeout using IsDefaultTimeout()
40                                                      */
42 /*-MACROS--------------------------------------------------------------------*/
44 #define TESTBIT(evt, probe) (((EC_T_WORD)probe)&(1<<((EC_T_BYTE)evt)))
46 /* debug tracing */
47 #ifdef DEBUGTRACE
49 extern EC_T_DWORD G_dwTraceMask;    /* trace mask */
50 extern EC_T_DWORD G_dwMemTraceMask; /* memory trace mask */
52 void EcTraceAddMem(char* szLoc, EC_T_ADDRESS dwAddress, size_t nSize);
53 void EcTraceSubMem(char* szLoc, EC_T_ADDRESS dwAddress);
55 #define EC_TRACEMSG(Mask, Msg) \
56             ((void)((((Mask) & G_dwTraceMask) != 0)?(OsTrcMsg Msg),1:0))
58 #define EC_TRACE_ADDMEM(Mask, szLoc, dwAddress, dwSize) \
59             ((void)((((Mask) & G_dwMemTraceMask) != 0)?(EcTraceAddMem((szLoc),(EC_T_ADDRESS)(dwAddress),(dwSize))),1:0))
61 #define EC_TRACE_SUBMEM(Mask, szLoc, dwAddress) \
62             ((void)((((Mask) & G_dwMemTraceMask) != 0)?(EcTraceSubMem((szLoc), (EC_T_ADDRESS)(dwAddress))),1:0))
64 #else  /* DEBUGTRACE */
66 #define EC_TRACEMSG(Mask, Msg)
67 #define EC_TRACE_ADDMEM(Mask, szLoc, dwAddress, nSize)
68 #define EC_TRACE_SUBMEM(Mask, szLoc, dwAddress)
70 #endif /* DEBUGTRACE */
72 /**********************************************************/
73 /* EtherCAT master stack internal performance measurement */
74 /**********************************************************/
76 /* settings */
78 #define EC_MSMT_eUsrJob_ProcessAllRxFrames          0
79 #define EC_MSMT_ProcessCycFrames                    1
80 #define EC_MSMT_ProcessAcycFrames                   2
81 #define EC_MSMT_ProcessAcycFramesErrHdl             3
82 #define EC_MSMT_ProcessAcycFramesCore               4
83 #define EC_MSMT_ProcessAcycFramesSingleCmd          5
84 #define EC_MSMT_ProcessSlaveCmd                     6
85 #define EC_MSMT_ProcessMasterCmd                    7
86 #define EC_MSMT_NotifyAndFree                       8
87 #define EC_MSMT_NotifyCallback                      9
88 #define EC_MSMT_LinkRecvFrame                       10 
89 #define EC_MSMT_LinkFreeRecvFrame                   11
90 #define EC_MSMT_LinkFreeSendFrame                   12
91 #define EC_MSMT_MboxNotify                         13
92 #define EC_MSMT_eUsrJob_ProcessAllCycFrames        14
93 #define EC_MSMT_eUsrJob_ProcessAllAcycFrames       15
94 #define EC_MSMT_eUsrJob_SendAllCycFrames           16
95 #define EC_MSMT_eUsrJob_SendCycFramesByTaskId      17
96 #define EC_MSMT_eUsrJob_RunMcSm                    18
97 #define EC_MSMT_eUsrJob_MasterTimer                19
98 #define EC_MSMT_LinkSendAndFreeFrame               20 
99 #define EC_MSMT_FlushQueuedCmds                    21
100 #define EC_MSMT_LinkSendFrame                      22
101 #define EC_MSMT_FlushQueuedCmdsFrameDescCreate     23
102 #define EC_MSMT_LinkAllocSendFrame                 24 
103 #define EC_MSMT_LinkGetStatus                      25
104 #define EC_MSMT_QueueEcatCmdReq                    26
105 #define EC_MSMT_QueueRegisterCmdReq                27
106 #define EC_MSMT_eUsrJob_SendAcycFrames             28
108 #define EC_MSMT_HCSM                               30
109 #define EC_MSMT_BTSM                               31
110 #define EC_MSMT_BTSSM                              32
111 #define EC_MSMT_BTCHKSM                            33
112 #define EC_MSMT_BTEEPSM                            34
113 #define EC_MSMT_EEPSM                              35
114 #define EC_MSMT_DCSM                               36
115 #define EC_MSMT_BT_INIT_CHECK_CONFIG               37
116 #define EC_MSMT_BT_CHECK_CONFIG                    38
117 #define NUM_EC_MSMT_POINTS                         39   /* add strings into G_aszMeasInfo[] in EcTscMeas.cpp! */
120 extern EC_T_TSC_MEAS_DESC G_TscMeasDesc;
121 extern EC_T_CHAR* G_aszMeasInfo[];
123 #ifdef INCLUDE_EC_INTERNAL_TSC_MEASUREMENT
124     #define PerfMeasInit( pTscMeasDesc, dwlFreqSet, dwNumMeas, pfnMessage )       ecatPerfMeasInit(pTscMeasDesc, dwlFreqSet, dwNumMeas, pfnMessage)
125     #define PerfMeasDeinit( pTscMeasDesc )                  ecatPerfMeasDeinit(pTscMeasDesc)
126     #define PerfMeasShow(pTscMeasDesc)                      ecatPerfMeasShow(pTscMeasDesc,0xFFFFFFFF, G_aszMeasInfo)
127     #define PerfMeasStart(pTscMeasDesc, dwIndex)            ecatPerfMeasStart(pTscMeasDesc,(dwIndex))
128     #define PerfMeasEnd(pTscMeasDesc, dwIndex)              ecatPerfMeasEnd(pTscMeasDesc,(dwIndex))
129     #define PerfMeasReset( pTscMeasDesc, dwIndex)           ecatPerfMeasReset(pTscMeasDesc, dwIndex)
130 #else
131     #define PerfMeasInit(pTscMeasDesc, pfnMessage)
132     #define PerfMeasDeinit(pTscMeasDesc)
133     #define PerfMeasShow(pTscMeasDesc)
134     #define PerfMeasStart(pTscMeasDesc, dwIndex)
135     #define PerfMeasEnd(pTscMeasDesc, dwIndex)
136     #define PerfMeasReset(pTscMeasDesc, dwIndex)
137 #endif
139 #ifdef __cplusplus
140 } /* extern "C"*/
141 #endif
144 #endif /* INC_ECCOMMONPRIVATE */
147 /*-END OF SOURCE FILE--------------------------------------------------------*/