35 #define VMIC_PORT12 0x12
36 #define VMIC_PORT34 0x10
37 #define VMIC_PORT56 0x16
38 #define VMIC_PORT78 0x14
39 #define VMIC_CSRU 0x20
40 #define VMIC_CSRL 0x21
45 #define VMIC_OUTPUT_1 0x00004000
46 #define VMIC_OUTPUT_2 0x00000800
47 #define VMIC_OUTPUT_3 0x00000100
48 #define VMIC_OUTPUT_4 0x00000030
49 #define VMIC_OUTPUT_5 0x00000004
50 #define VMIC_OUTPUT_6 0x00800000
51 #define VMIC_OUTPUT_7 0x00100000
52 #define VMIC_OUTPUT_8 0x00020000
57 #define VMIC_OUTPUT_EW1 VMIC_OUTPUT_1
58 #define VMIC_OUTPUT_EW2 VMIC_OUTPUT_2
59 #define VMIC_OUTPUT_LATCH_RESET VMIC_OUTPUT_3
60 #define VMIC_OUTPUT_CAENandCOMP VMIC_OUTPUT_4
61 #define VMIC_OUTPUT_CRATE4 VMIC_OUTPUT_5
62 #define VMIC_OUTPUT_SOFTSTOP VMIC_OUTPUT_6
63 #define VMIC_OUTPUT_CLOCK_RESET VMIC_OUTPUT_7
64 #define VMIC_OUTPUT_START1 (VMIC_OUTPUT_1 | VMIC_OUTPUT_4)
65 #define VMIC_OUTPUT_START2 (VMIC_OUTPUT_2 | VMIC_OUTPUT_4)
70 #define VMIC_INPUT_END_EVENT 62
71 #define VMIC_INPUT_BLOCK 59
92 WORD low = new_value & 0xffff;
93 WORD high = (new_value >> 16) & 0xffff;
123 if ((channel >= 0) && (channel < 16)) {
126 }
else if ((channel >= 16) && (channel < 32)) {
128 mask = (1 << (channel-16));
129 }
else if ((channel >= 32) && (channel < 48)) {
131 mask = (1 << (channel-32));
132 }
else if ((channel >= 48) && (channel < 64)) {
134 mask = (1 << (channel-48));
139 if ((status & mask)==0) {
172 if(vmic_handle == NULL) {
173 diag_print(0,
"Unable to open handle for VMIC TTL I/O register\n");
181 diag_print(0,
"Unable to write CSRU value to VMIC TTL I/O register\n");
215 DWORD maybe_crate4 = 0;
222 if(block_input != 0) {
223 diag_print(0,
"BLOCK is high when it should be low!\n");
243 diag_print(0,
"END_EVENT signal not clearing with reset\n");
257 diag_print(2,
"Starting RAM %d cycle\n", ram);