Rev 100 | Rev 134 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 100 | Rev 123 | ||
---|---|---|---|
Line 21... | Line 21... | ||
21 | #endif |
21 | #endif |
22 | */ |
22 | */ |
23 | 23 | ||
24 | #include "CAENV1718.h" |
24 | #include "CAENV1718.h" |
25 | #include "wusbvme_dll.h" |
25 | #include "wusbvme_dll.h" |
26 | #include "wienvme_dll.h" |
26 | #include "wienvme_dll.h" |
27 | 27 | ||
28 | static int VME_interface= -1; |
28 | static int VME_interface= -1; |
29 | int VME_GetInterface() { |
29 | int VME_GetInterface() { |
- | 30 | return VME_interface; |
|
- | 31 | } |
|
30 | int VME_CONNECTED(){ |
32 | int VME_CONNECTED() { |
31 | 33 | ||
32 |
|
34 | return VME_interface; |
- | 35 | } |
|
- | 36 | ||
- | 37 | short __stdcall VME_START (int interface) { |
|
- | 38 | ||
- | 39 | ||
- | 40 | VME_interface=interface; |
|
- | 41 | switch (VME_interface) { |
|
- | 42 | case CAEN_V1718: |
|
- | 43 | CAEN_VME_START (NULL); |
|
- | 44 | VME_R_Ptr = CAEN_VME_R; |
|
- | 45 | VME_W_Ptr = CAEN_VME_W; |
|
- | 46 | ||
- | 47 | VME_MW_Ptr = CAEN_VME_MW; |
|
- | 48 | VME_MR_Ptr = CAEN_VME_MR; |
|
- | 49 | ||
- | 50 | VME_MW_Ptr = CAEN_VME_MW; |
|
- | 51 | VME_MR_Ptr = CAEN_VME_MR; |
|
- | 52 | ||
- | 53 | VME_MWEXEC_Ptr = CAEN_VME_MWEXEC; |
|
- | 54 | VME_MREXEC_Ptr = CAEN_VME_MREXEC; |
|
- | 55 | ||
- | 56 | VME_MWRST_Ptr = CAEN_VME_MWRST; |
|
- | 57 | VME_MRRST_Ptr = CAEN_VME_MRRST; |
|
- | 58 | ||
- | 59 | ||
- | 60 | break; |
|
- | 61 | ||
- | 62 | case WIENER_VMEMM: |
|
- | 63 | WIENVME_VME_START(NULL); |
|
- | 64 | VME_R_Ptr = WIENVME_VME_R; |
|
- | 65 | VME_W_Ptr = WIENVME_VME_W; |
|
- | 66 | ||
- | 67 | VME_MW_Ptr = WIENVME_VME_MW; |
|
- | 68 | VME_MR_Ptr = WIENVME_VME_MR; |
|
- | 69 | ||
- | 70 | VME_MW_Ptr = WIENVME_VME_MW; |
|
- | 71 | VME_MR_Ptr = WIENVME_VME_MR; |
|
- | 72 | ||
- | 73 | VME_MWEXEC_Ptr = WIENVME_VME_MWEXEC; |
|
- | 74 | VME_MREXEC_Ptr = WIENVME_VME_MREXEC; |
|
- | 75 | ||
- | 76 | VME_MWRST_Ptr = WIENVME_VME_MWRST; |
|
- | 77 | VME_MRRST_Ptr = WIENVME_VME_MRRST; |
|
- | 78 | break; |
|
- | 79 | case WIENER_VMUSB: |
|
- | 80 | WIENER_VMUSB_VME_START("VM0120"); |
|
- | 81 | VME_R_Ptr = WIENER_VMUSB_VME_R; |
|
- | 82 | VME_W_Ptr = WIENER_VMUSB_VME_W; |
|
- | 83 | ||
- | 84 | VME_MW_Ptr = WIENER_VMUSB_VME_MW; |
|
- | 85 | VME_MR_Ptr = WIENER_VMUSB_VME_MR; |
|
- | 86 | ||
- | 87 | VME_MW_Ptr = WIENER_VMUSB_VME_MW; |
|
- | 88 | VME_MR_Ptr = WIENER_VMUSB_VME_MR; |
|
- | 89 | ||
- | 90 | VME_MWEXEC_Ptr = WIENER_VMUSB_VME_MWEXEC; |
|
- | 91 | VME_MREXEC_Ptr = WIENER_VMUSB_VME_MREXEC; |
|
- | 92 | ||
- | 93 | VME_MWRST_Ptr = WIENER_VMUSB_VME_MWRST; |
|
- | 94 | VME_MRRST_Ptr = WIENER_VMUSB_VME_MRRST; |
|
- | 95 | break; |
|
- | 96 | ||
- | 97 | } |
|
- | 98 | ||
- | 99 | return 0; |
|
33 | } |
100 | } |
34 | 101 | ||
35 | short |
102 | short __stdcall VME_STOP () { |
36 | { |
- | |
37 | - | ||
38 | - | ||
39 | VME_interface=interface; |
- | |
40 |
|
103 | switch (VME_interface) { |
41 |
|
104 | case CAEN_V1718: |
42 | CAEN_VME_START (NULL); |
- | |
43 | VME_R_Ptr = CAEN_VME_R; |
- | |
44 | VME_W_Ptr = CAEN_VME_W; |
- | |
45 | - | ||
46 | VME_MW_Ptr = CAEN_VME_MW; |
- | |
47 | VME_MR_Ptr = CAEN_VME_MR; |
- | |
48 | 105 | ||
49 | VME_MW_Ptr = CAEN_VME_MW; |
- | |
50 |
|
106 | CAEN_VME_STOP( ); |
51 | - | ||
52 | VME_MWEXEC_Ptr = CAEN_VME_MWEXEC; |
- | |
53 | VME_MREXEC_Ptr = CAEN_VME_MREXEC; |
- | |
54 | - | ||
55 | VME_MWRST_Ptr = CAEN_VME_MWRST; |
- | |
56 | VME_MRRST_Ptr = CAEN_VME_MRRST; |
- | |
57 | - | ||
58 | - | ||
59 |
|
107 | break; |
60 | 108 | ||
61 |
|
109 | case WIENER_VMEMM: |
62 | WIENVME_VME_START(NULL); |
- | |
63 | VME_R_Ptr = WIENVME_VME_R; |
- | |
64 | VME_W_Ptr = WIENVME_VME_W; |
- | |
65 | - | ||
66 | VME_MW_Ptr = WIENVME_VME_MW; |
- | |
67 | VME_MR_Ptr = WIENVME_VME_MR; |
- | |
68 | - | ||
69 | VME_MW_Ptr = WIENVME_VME_MW; |
- | |
70 | VME_MR_Ptr = WIENVME_VME_MR; |
- | |
71 | - | ||
72 | VME_MWEXEC_Ptr = WIENVME_VME_MWEXEC; |
- | |
73 | VME_MREXEC_Ptr = WIENVME_VME_MREXEC; |
- | |
74 | 110 | ||
75 | VME_MWRST_Ptr = WIENVME_VME_MWRST; |
- | |
76 | VME_MRRST_Ptr = WIENVME_VME_MRRST; |
- | |
77 |
|
111 | break; |
78 |
|
112 | case WIENER_VMUSB: |
79 |
|
113 | WIENER_VMUSB_VME_STOP( ); |
80 | VME_R_Ptr = WIENER_VMUSB_VME_R; |
- | |
81 | VME_W_Ptr = WIENER_VMUSB_VME_W; |
- | |
82 | 114 | break; |
|
83 | VME_MW_Ptr = WIENER_VMUSB_VME_MW; |
- | |
84 | VME_MR_Ptr = WIENER_VMUSB_VME_MR; |
- | |
85 | - | ||
86 | VME_MW_Ptr = WIENER_VMUSB_VME_MW; |
- | |
87 | VME_MR_Ptr = WIENER_VMUSB_VME_MR; |
- | |
88 | 115 | default: |
|
89 | VME_MWEXEC_Ptr = WIENER_VMUSB_VME_MWEXEC; |
- | |
90 | VME_MREXEC_Ptr = WIENER_VMUSB_VME_MREXEC; |
- | |
91 | 116 | ||
92 | VME_MWRST_Ptr = WIENER_VMUSB_VME_MWRST; |
- | |
93 | VME_MRRST_Ptr = WIENER_VMUSB_VME_MRRST; |
- | |
94 |
|
117 | break; |
95 | - | ||
96 | } |
- | |
97 | 118 | ||
98 | return 0; |
- | |
99 | } |
119 | } |
100 | 120 | ||
101 | short __stdcall VME_STOP () |
- | |
102 | { |
- | |
103 | switch (VME_interface){ |
- | |
104 | case CAEN_V1718: |
- | |
105 | - | ||
106 | CAEN_VME_STOP( ); |
- | |
107 | break; |
- | |
108 | - | ||
109 | case WIENER_VMEMM: |
- | |
110 | - | ||
111 | break; |
- | |
112 | case WIENER_VMUSB: |
- | |
113 | WIENER_VMUSB_VME_STOP( ); |
- | |
114 | break; |
- | |
115 | default: |
- | |
116 | - | ||
117 | break; |
- | |
118 | - | ||
119 | } |
- | |
120 | - | ||
121 | VME_interface = -1; |
121 | VME_interface = -1; |
122 | return 0; |
122 | return 0; |
123 | } |
123 | } |