versadac  1
versadac - Scalable Recorder Firmware
schedule.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 : Schedule */
15 /* $Workfile:: schedule.h $*/
16 /* $Revision:: 3 $*/
17 /* $Date:: 7/06/10 9:50 $*/
18 /* */
19 /*---------------------------------------------------------------------------*/
20 /* */
21 /* D e s c r i p t i o n : */
22 /* */
23 /* */
24 /*---------------------------------------------------------------------------*/
25 #ifndef __SCHEDULE_H
26 #define __SCHEDULE_H
27 
28 
29 /******************************************************************************/
30 typedef APP_VOID APP_FAR (*LPFST_SCHEDULE)(APP_VOID);
31 #define APP_CBF APP_FAR
32 
33 #ifdef __MEDIUM__
34  typedef unsigned short (APP_FAR * FX_CBF)(APP_LPVOID lpData, APP_WORD wState);
35 #else
36  typedef unsigned short (APP_NEAR * FX_CBF)(APP_LPVOID lpData, APP_WORD wState);
37 #endif
38 /******************************************************************************/
39 
40 typedef struct st_cbf
41 {
42  ST_LINK stLink;
43  APP_DWORD dwRecNow;
44  APP_DWORD dwDelta;
45  APP_DWORD dwPeriod;
46  APP_LPBYTE lpSync;
47  APP_LPVOID lpData;
48  APP_DWORD dwTic;
49  FX_CBF fn;
50  APP_WORD wId;
51  APP_WORD wNb;
52  APP_WORD wPhase;
53 }ST_CBF, * PST_CBF , APP_FAR * LPST_CBF;
54 
55 typedef struct
56 {
57  APP_DWORD dwTic;
58  APP_DWORD dwExpiry;
59  APP_DWORD dwPeriod;
60  APP_DWORD dwUniqueId;
61  APP_LPVOID lpCrep;
62  APP_LPVOID lpData;
63  APP_LPBYTE lpSync;
64  LPST_CBF APP_FAR* lpstCbf;
65  APP_WORD wId;
66 
67  APP_WORD wNb;
68  APP_WORD wPhase;
69  APP_WORD wReductionRatio;
70 }
72 #define ST_SCHEDULE_INSERT_SIZEOF sizeof(ST_SCHEDULE_INSERT)
73 
74 typedef struct {
75  LPST_CBF APP_FAR* lpstCbf;
76  APP_LPVOID lpCrep;
77  APP_DWORD dwId;
79 #define ST_SCHEDULE_REMOVE_SIZEOF sizeof(ST_SCHEDULE_REMOVE)
80 
81 
82 /******************************************************************************/
83 
84 enum enSchedState
85 {
86  SSNone = 0, /* bug */
87  SSInit,
88  SSOneShoot,
89  SSRunningShoot,
90  SSEverShoot,
91  SSLastShoot
92 };
93 
94 /******************************************************************************/
95 
96 typedef struct
97 {
98  ST_DESC_LINK stFree;
99  ST_DESC_LINK stUsed;
100 }ST_DESC_CBF, * PST_DESC_CBF, APP_FAR * LPST_DESC_CBF;
101 
102 
103 
104 /******************************************************************************/
105 #define ID_PPM_ERROR_IND_DV 43
106 
107 APP_WORD Schedule_task(APP_LPVOID pStart);
108 APP_BOOL Schedule_InitProcessing(APP_VOID);
109 APP_BOOL Schedule_ExitProcessing(APP_VOID);
110 
111 APP_VOID Schedule_Start(APP_WORD wPeriod);
112 APP_VOID Schedule_Stop();
113 
114 APP_BOOL Schedule_IdleProcessing(APP_VOID);
115 
116 LPST_CBF Schedule_FunctionInsert(FX_CBF pCbfFn, APP_DWORD dwExpiry1, APP_DWORD dwExpiry2, APP_WORD wNb, APP_LPVOID lpData);
117 APP_BOOL Schedule_FunctionRemove(LPST_CBF pstCbf);
118 
119 
120 LPST_CBF Schedule_CbfNew ( APP_VOID );
121 APP_VOID Schedule_CbfReset ( LPST_CBF pstCbf );
122 APP_DWORD PrecalEnding ( APP_DWORD dwExpiry );
123 
124 
125 /******************************************************************************/
126 #endif /* __SCHEDULE_H */
Definition: link.h:35
Definition: schedule.h:40
Definition: schedule.h:55
Definition: link.h:42
Definition: schedule.h:96
Definition: schedule.h:74