versadac  1
versadac - Scalable Recorder Firmware
crep.h
1 /*---------------------------------------------------------------------------*/
2 /* Copyright (C) 2006 Woodhead Software & Electonics. All rights reserved. */
3 /*---------------------------------------------------------------------------*/
4 /* This program is protected by international copyright. */
5 /* */
6 /* The use of this software including but not limited to its Source Code */
7 /* is subject to restrictions as agreed in the license agreement between */
8 /* you and Woodhead. */
9 /* Copying or distribution is not allowed unless expressly permitted */
10 /* according to your license agreement with Woodhead. */
11 /*---------------------------------------------------------------------------*/
12 /* */
13 /* Project : STACK PROFINET Controller */
14 /* Component : FRAME GENERATOR & CHECKER */
15 /* $Workfile:: crep.h $*/
16 /* $Revision:: 5 $*/
17 /* $Date:: 1/07/10 10:50 $*/
18 /* */
19 /*---------------------------------------------------------------------------*/
20 /* */
21 /* D e s c r i p t i o n : */
22 /* CREP Manager */
23 /* */
24 /*---------------------------------------------------------------------------*/
25 #ifndef _CREP_H
26 #define _CREP_H
27 
28 #include "os_pck.h"
29 typedef struct _ST_CREP{
30  LPST_AREP lpstArep; /*0 - 4*/
31  APP_LPBYTE pRtProd1; /*4 - 4*/
32  APP_LPBYTE pData; /*8 - 4*/
33  LPST_CBF pstCbf; /*12 - 4*/
34  APP_DWORD dwReceiverFrame; /*16 - 4*/
35  APP_DWORD dwTimeProd1; /*20 - 4*/
36  APP_DWORD dwTimeProd2; /*24 - 4*/
37  APP_DWORD dwTimeProd_min;
38  APP_DWORD dwTimeProd_max;
39  APP_DWORD dwTimeProd_moy;
40  APP_LPVOID lpContext; /*28 - 4*/
41  APP_LPVOID lpHandleDriver; /*32 - 4*/
42  APP_DWORD dwProtect; /*34 - 4*/
43  APP_DWORD dwOffsetData; /*40 - 4*/
44  APP_DWORD dwOffsetStatus; /*44 - 4*/
45  APP_DWORD dwOffsetOverRun; /*48 - 4*/
46  APP_DWORD dwTime; /*52 - 4*/
47  APP_DWORD dwIDInsert; /*56 - 4*/
48  APP_WORD wSendClockFactor; /*58 - 2*/
49  APP_WORD wReductionRatio; /*60 - 2*/
50  APP_WORD wPhase; /*62 - 2*/
51  APP_WORD wRtLen; /*64 - 2*/
52  APP_WORD wIdFrame; /*66 - 2*/
53  APP_WORD wLenFrame; /*68 - 2*/
54  APP_WORD wCycle; /*70 - 2*/
55  APP_WORD wStateMachine; /*72 - 2*/
56  APP_WORD wWatchdogFactor; /*74 - 2*/
57  APP_WORD wHoldTime; /*76 - 2*/
58  APP_WORD wCounter; /*78 - 2*/
59  APP_WORD wNewData; /*80 - 2*/
60  APP_WORD wDt; /*82 - 2*/
61  APP_WORD wDht; /*84 - 2*/
62  APP_BYTE bySrcAdrMac[MAC_ADDRESS_LEN]; /*86 - 6*/
63  APP_BYTE byDstAdrMac[MAC_ADDRESS_LEN]; /*92 - 6*/
64  APP_BYTE TxOption; /*98 - 1*/
65  APP_BYTE byDataStatus; /*99 - 1*/
66  APP_BYTE wSequence; /*100 - 1*/
67  APP_BYTE byConsistency; /*101 - 1*/
68  APP_BYTE byFlagSynchro; /*102 - 1*/
69 
70  APP_BYTE byNewData; /*103 - 1*/
71  APP_BYTE byNewStatus; /*104 - 1*/
72 
73  APP_DWORD dwWatchDog;
74 }PACK_ALIGNEMENT(ST_CREP), APP_FAR *LPST_CREP;
75 #define ST_CREP_SIZEOF sizeof(ST_CREP)
76 
77 APP_BOOL ActivePpmReq(LPST_AREP pArep , APP_LPVOID lpContext , LPST_CREP pCrepOut);
78 APP_BOOL ActiveCpmReq(LPST_AREP pArep , APP_LPVOID lpContext , LPST_CREP pCrepIn );
79 APP_WORD NbCrepInInCrBlock(LPST_AREP pArep);
80 APP_WORD NbCrepOutInCrBlock(LPST_AREP pArep);
81 
82 typedef struct _ST_CREP_ALM{
83  LPST_CBF pstCbf; /*0 - 4*/
84  APP_LPVOID lpContext; /*4 - 4*/
85  LPST_AREP lpstArep; /*8 - 4*/
86  APP_DWORD dwApi; /*12 - 4*/
87  APP_WORD wLenFrame; /* - */
88  APP_WORD wStateALPMI; /* - */
89  APP_WORD wStateALPMR; /* - */
90  APP_WORD wStateAPMR; /* - */
91  APP_WORD wStateAPMS; /* - */
92  APP_WORD wIdFrame; /* - */
93  APP_WORD wPriority; /* - */
94  APP_WORD w_Apms_Seq_Count; /* - */
95  APP_WORD w_Apms_Seq_CountO; /* - */
96  APP_WORD w_Apmr_Seq_Count; /* - */
97  APP_WORD w_Apmr_Seq_CountO; /* - */
98  APP_WORD wRetry; /* - */
99  APP_WORD wAlarmDstEndpoint; /* - */
100  APP_WORD wAlarmSrcEndpoint; /* - */
101  APP_WORD wRTATimeOutFactor; /* - */
102  APP_WORD wAlarmType; /* - */
103  APP_WORD wSlotNumber; /* - */
104  APP_WORD wSubSlotNumber; /* - */
105  APP_WORD wAlarmSpecifier; /* - */
106  APP_WORD wBufferLen;
107  APP_BOOL bCrepCtrlAlarm;
108  ST_PNIO_STATUS stPnioStatus;
109  APP_BYTE byDstAdrMac[MAC_ADDRESS_LEN];
110  APP_BYTE bySrcAdrMac[MAC_ADDRESS_LEN];
111  APP_BYTE bySyn;
112  APP_LPBYTE lpbyBufferedFrame;
113  APP_LPVOID lpbyHandleWrite;
114 
115 
116 }PACK_ALIGNEMENT(ST_CREP_ALM), APP_FAR *LPST_CREP_ALM;
117 #define ST_CREP_ALM_SIZEOF sizeof(ST_CREP_ALM)
118 
119 #include "os_unpck.h"
120 APP_BOOL ActiveAlmReq(LPST_AREP lpArep , APP_LPVOID lpContext , LPST_CREP_ALM lpCrepAlm, APP_WORD wPriority);
121 
122 #define IS_CREP_ALMPI(lpCrepAlm) lpCrepAlm->bCrepCtrlAlarm == APP_FALSE
123 
124 #endif
Definition: crep.h:82
Definition: crep.h:29
Definition: schedule.h:40