versadac  1
versadac - Scalable Recorder Firmware
user.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 : Consuption */
15 /* $Workfile:: user.h $*/
16 /* $Revision:: 1 $*/
17 /* $Date:: 7/06/10 11:05 $*/
18 /* */
19 /*---------------------------------------------------------------------------*/
20 /* */
21 /* D e s c r i p t i o n : */
22 /* - Main user consumer thread */
23 /*---------------------------------------------------------------------------*/
24 
25 #ifndef _USER_H
26 #define _USER_H
27 
28 #define STAT_CPM_INIT 0x00
29 #define STAT_CPM_DECLARED_DEVICE 0x80
30 #define STAT_CPM_UNDECLARED_DEVICE 0x40
31 #define STAT_CPM_CLOSED 0xC0
32 
33 #define STAT_PPM_INIT 0x00
34 #define STAT_PPM_PROV_STOP 0x25
35 #define STAT_PPM_PROV_START 0x35
36 
37 /*
38 0x01 : bit0:state :0x00 IOCR state is backup 0x01 IOCR state is primary
39 0x04 : bit2:DataValid :0x00 DataItem invalid 0x01 DataItem valid
40 0x10 : bit4:ProviderState :0x00 Stop 0x01 Run
41 0x20 : bit5:StationProblemIndicator:0x00 Problem detected 0x01 Normal Operation
42 */
43 
44 /*0x1*/
45 #define PNIO_STAT_1 0x00
46 #define PNIO_STAT_2 0x10
47 #define PNIO_STAT_3 0x20
48 #define PNIO_STAT_4 0x30
49 
50 #define PNIO_STAT_5 0x01
51 #define PNIO_STAT_6 0x11
52 #define PNIO_STAT_7 0x21
53 #define PNIO_STAT_8 0x31
54 
55 #define PNIO_STAT_9 0x05
56 #define PNIO_STAT_10 0x15
57 #define PNIO_STAT_11 0x25
58 #define PNIO_STAT_12 0x35
59 
60 #define PNIO_STAT_13 0x04
61 #define PNIO_STAT_14 0x14
62 #define PNIO_STAT_15 0x24
63 #define PNIO_STAT_16 0x34
64 
65 
66 /* Protection consistency*/
67 
68 /*User*/
69 #define LOCK_FOR_USER 0x01
70 #define UNLOCK_FOR_STACK 0x02
71 
72 /*stack*/
73 #define LOCK_FOR_STACK 0x02
74 #define UNLOCK_FOR_USER 0x01
75 
76 
77 
78 
79 APP_WORD USER_InitSharedMemory(APP_LPVOID lpdata , APP_DWORD dwLen );
80 APP_WORD USER_ExitSharedMemory(APP_VOID);
81 APP_WORD USER_ReadSharedMemory(APP_DWORD dwOffset , APP_WORD wNb , APP_LPBYTE lpData);
82 APP_WORD USER_WriteSharedMemory(APP_DWORD dwOffset,APP_WORD wNb,APP_LPBYTE lpData);
83 
84 #endif