6 #define HEADER_MASK 0xFE000000 // hit word & EOE word, 32-bit word, 7-bit
7 #define HEADER_26_MASK 0x02000000 // hit word & EOE word, 26-bit word, 1-bit
8 #define L1ID_MASK 0x00000F00 // EOE word
9 #define BCID_3_0_MASK 0x01E00000 // hit word & EOE word
10 #define BCID_7_4_MASK 0x000000F0 // EOE word
11 #define WARN_MASK 0x0000000F // EOE word
12 #define FLAG_MASK 0x001FE000 // EOE word
13 #define FLAG_NO_ERROR_MASK 0x001E0000 // EOE word, flag with no error
14 #define FLAG_ERROR_1_MASK 0x001C2000 // EOE word, flag with error n=1
15 #define FLAG_ERROR_2_MASK 0x001C4000 // EOE word, flag with error n=2
16 #define FLAG_ERROR_4_MASK 0x001C8000 // EOE word, flag with error n=4
17 #define FLAG_ERROR_8_MASK 0x001D0000 // EOE word, flag with error n=8
18 #define ROW_MASK 0x001FE000 // hit word, 0 - 159
19 #define COL_MASK 0x00001F00 // hit word, 0 - 17
20 #define TOT_MASK 0x000000FF // hit word, 8-bit, HitParity disabled
21 #define TOTPARITY_MASK 0x0000007F // hit word, 7-bit, HitParity enabled
22 #define EOEPARITY_MASK 0x00001000 // EOE word
23 #define HITPARITY_MASK 0x00000080 // hit word
25 #define FLAG_WO_STATUS 0xE0 // flag without error status
26 #define FLAG_NO_ERROR 0xF0 // flag with no error
27 #define FLAG_ERROR_1 0xE1 // flag with error n=1
28 #define FLAG_ERROR_2 0xE2 // flag with error n=2
29 #define FLAG_ERROR_4 0xE4 // flag with error n=4
30 #define FLAG_ERROR_8 0xE8 // flag with error n=8
76 #define TRIGGER_WORD_HEADER_MASK 0x80000000 // trigger header
77 #define TRIGGER_NUMBER_MASK 0x7FFFFF00 // trigger number
78 #define EXT_TRIGGER_MODE_MASK 0x00000007 // trigger number
79 #define TRIGGER_WORD_ERROR_MASK 0x000000F8 // trigger number
80 #define L_TOTAL_TIME_OUT_MASK 0x00000004 // trigger number
81 #define EOE_WORD_WRONG_NUMBER_MASK 0x00000010 // trigger number
82 #define UNKNOWN_WORD_MASK 0x00000020 // trigger number
83 #define EOE_WORD_WARNING_MASK 0x00000040 // trigger number
84 #define EOE_WORD_ERROR_MASK 0x00000080 // trigger number
88 #define HEADER_MACRO(X) ((HEADER_MASK & X) >> 25)
89 #define FLAG_MACRO(X) ((FLAG_MASK & X) >> 13)
90 #define ROW_MACRO(X) ((ROW_MASK & X) >> 13)
91 #define COL_MACRO(X) ((COL_MASK & X) >> 8)
92 #define BCID_3_0_MACRO(X) ((BCID_3_0_MASK & X) >> 21)
93 #define L1ID_MACRO(X) ((L1ID_MASK & X) >> 8)
94 #define BCID_MACRO(X) (((BCID_3_0_MASK & X) >> 21) | (BCID_7_4_MASK & X))
95 #define TOT_MACRO(X) (TOT_MASK & X)
96 #define WARN_MACRO(X) (WARN_MASK & X)
98 #define TRIGGER_WORD_HEADER_MACRO(X) ((TRIGGER_WORD_HEADER_MASK & X) >> 31)
99 #define TRIGGER_NUMBER_MACRO(X) ((TRIGGER_NUMBER_MASK & X) >> 8)
100 #define TRIGGER_MODE_MACRO(X) (EXT_TRIGGER_MODE_MASK & X)
101 #define TRIGGER_WORD_ERROR_MACRO(X) ((TRIGGER_WORD_ERROR_MASK & X) >> 3)
103 #endif // USBPIX_I3_H