Rev 658 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
658 | giacomo | 1 | /* File name ......... : 833drive.h |
2 | * Object ............ : driver del frame grabber PCL833 della Advantech |
||
3 | * scaricati al sito della Advantech www.advantech.com |
||
4 | * Language .......... : C |
||
5 | * Operative system .. : DOS/SHARK |
||
6 | */ |
||
7 | |||
8 | #ifndef __833DRIVE_H |
||
9 | #define __833DRIVE_H |
||
10 | |||
11 | // Define Error Code |
||
12 | |||
13 | #define ERR -6 |
||
14 | #define PARAMETER_ERR -5 |
||
15 | #define COUNT_LATCH_ERR -4 |
||
16 | #define COUNT_MODE_ERR -3 |
||
17 | #define CHANNEL_NUM_ERR -2 |
||
18 | #define FUNCTION_NUM_ERR -1 |
||
19 | #define FUNCTION_SUCCESS 0 |
||
20 | #define OK 0 |
||
21 | |||
22 | // Define Basic Function Number |
||
23 | |||
24 | #define Ch1_SetInputMode 1000 |
||
25 | #define Ch2_SetInputMode 1001 |
||
26 | #define Ch3_SetInputMode 1002 |
||
27 | #define Ch1_DefineResetValue 1003 |
||
28 | #define Ch2_DefineResetValue 1004 |
||
29 | #define Ch3_DefineResetValue 1005 |
||
30 | #define Ch1_SetLatchSource 1006 |
||
31 | #define Ch2_SetLatchSource 1007 |
||
32 | #define Ch3_SetLatchSource 1008 |
||
33 | #define Ch1_IfResetOnLatch 1009 |
||
34 | #define Ch2_IfResetOnLatch 1010 |
||
35 | #define Ch3_IfResetOnLatch 1011 |
||
36 | #define LatchWhenOverflow 1012 |
||
37 | #define CounterReset 1013 |
||
38 | #define ChooseSysClock 1014 |
||
39 | #define SetCascadeMode 1015 |
||
40 | #define Set16C54TimeBase 1016 |
||
41 | #define SetDI1orTimerInt 1017 |
||
42 | #define Set16C54Divider 1018 |
||
43 | #define Ch_Read 1019 |
||
44 | #define Overflow_Read 1020 |
||
45 | #define Status_Read 1021 |
||
46 | #define Latch_Ch1 1022 |
||
47 | #define Latch_Ch2 1023 |
||
48 | #define Latch_Ch3 1024 |
||
49 | #define FreeAll 1025 |
||
50 | #define NoneReset 1026 |
||
51 | #define Reset_Ch1 1027 |
||
52 | #define Reset_Ch2 1028 |
||
53 | #define Reset_Ch3 1029 |
||
54 | |||
55 | // Define Miscellaneous Function Number |
||
56 | |||
57 | #define Initialize833 2000 |
||
58 | |||
59 | // Define Values |
||
60 | |||
61 | #define ch1 1 |
||
62 | #define ch2 2 |
||
63 | #define ch3 3 |
||
64 | #define NA 4 |
||
65 | |||
66 | // vCh_SetInputMode options |
||
67 | #define PclDisable 0 |
||
68 | #define x1 1 |
||
69 | #define x2 2 |
||
70 | #define x4 3 |
||
71 | #define TwoPulseIn 4 |
||
72 | #define OnePulseIn 5 |
||
73 | // vCh_DefineResetValue options |
||
74 | #define start 0 |
||
75 | #define middle 8 |
||
76 | // vCh_SetLatchSource options |
||
77 | #define SwReadLatch 0 |
||
78 | #define IndexInLatch 1 |
||
79 | #define DI0Latch 2 |
||
80 | #define DI1Latch 3 |
||
81 | #define TimerLatch 4 |
||
82 | // vCh_IfResetOnLatch options |
||
83 | #define ResetNo 0 |
||
84 | #define ResetYes 0x08 |
||
85 | // vChooseSysClock options |
||
86 | #define Sys8MHZ 0 |
||
87 | #define Sys4MHZ 1 |
||
88 | #define Sys2MHZ 2 |
||
89 | // vSetCascadeMode options |
||
90 | #define c24bits 0 |
||
91 | #define c48bits 4 |
||
92 | #define c72bits 8 |
||
93 | #define cascade 7 |
||
94 | // vSet16C54TimeBase options |
||
95 | #define tPoint1ms 0 |
||
96 | #define t1ms 1 |
||
97 | #define t10ms 2 |
||
98 | #define t100ms 3 |
||
99 | #define t1s 4 |
||
100 | // vSetDI1orTimerInt options |
||
101 | #define DI1Int 0 |
||
102 | #define TimerInt 8 |
||
103 | |||
104 | //Output Registers and Input Registers |
||
105 | |||
106 | extern int OutReg[16]; |
||
107 | extern int InReg[16]; |
||
108 | |||
109 | //All fuctions are called through pcl833() |
||
110 | |||
111 | int pcl833(int func, int option); |
||
112 | |||
113 | #endif |