pxar
 All Classes Namespaces Functions Variables Typedefs Friends
constants.h
1 
7 #ifndef PXAR_CONSTANTS_H
8 #define PXAR_CONSTANTS_H
9 
10 namespace pxar {
11 
12 // --- Data Transmission settings & flags --------------------------------------
13 #define DTB_SOURCE_BLOCK_SIZE 8192
14 #define DTB_SOURCE_BUFFER_SIZE 50000000
15 #define DTB_DAQ_FIFO_OVFL 4 // bit 2 = DAQ fast HW FIFO overflow
16 #define DTB_DAQ_MEM_OVFL 2 // bit 1 = DAQ RAM FIFO overflow
17 #define DTB_DAQ_STOPPED 1 // bit 0 = DAQ stopped (because of overflow)
18 
19 
20 // --- TBM Types ---------------------------------------------------------------
21 #define TBM_08 0x11
22 #define TBM_08A 0x12
23 #define TBM_08B 0x13
24 #define TBM_09 0x14
25 
26 
27 // --- TBM Register -----------------------------------------------------------
28 // These register addresses give the position relative to the base of the cores
29 // To actually program the TBM the base has to be added, e.g.
30 // Register 0x04 + Base -> 0xE4 or 0xF4
31 #define TBM_REG_COUNTER_SWITCHES 0x00
32 #define TBM_REG_SET_MODE 0x02
33 #define TBM_REG_CLEAR_INJECT 0x04
34 #define TBM_REG_SET_PKAM_COUNTER 0x08
35 #define TBM_REG_SET_DELAYS 0x0A
36 #define TBM_REG_TEMPERATURE_CONTROL 0x0C
37 #define TBM_REG_CORES_A_B 0x0E
38 
39 
40 // --- ROC Size ---------------------------------------------------------------
41 #define ROC_NUMROWS 80
42 #define ROC_NUMCOLS 52
43 #define MOD_NUMROCS 16
44 
45 // --- ROC Types ---------------------------------------------------------------
46 #define ROC_PSI46V2 0x01
47 #define ROC_PSI46XDB 0x02
48 #define ROC_PSI46DIG 0x03
49 #define ROC_PSI46DIG_TRIG 0x04
50 #define ROC_PSI46DIGV2_B 0x05
51 #define ROC_PSI46DIGV2 0x06
52 #define ROC_PSI46DIGV21 0x07
53 #define ROC_PSI46DIGV21RESPIN 0x08
54 
55 
56 // --- ROC DACs ---------------------------------------------------------------
57 #define ROC_DAC_Vdig 0x01
58 #define ROC_DAC_Vana 0x02
59 #define ROC_DAC_Vsh 0x03
60 #define ROC_DAC_Vcomp 0x04
61 #define ROC_DAC_Vleak_comp 0x05
62 #define ROC_DAC_VrgPr 0x06
63 #define ROC_DAC_VwllPr 0x07
64 #define ROC_DAC_VrgSh 0x08
65 #define ROC_DAC_VwllSh 0x09
66 #define ROC_DAC_VhldDel 0x0A
67 #define ROC_DAC_Vtrim 0x0B
68 #define ROC_DAC_VthrComp 0x0C
69 #define ROC_DAC_VIBias_Bus 0x0D
70 #define ROC_DAC_Vbias_sf 0x0E
71 #define ROC_DAC_VoffsetOp 0x0F
72 #define ROC_DAC_VIbiasOp 0x10
73 #define ROC_DAC_VoffsetRO 0x11
74 #define ROC_DAC_VIon 0x12
75 #define ROC_DAC_VIbias_PH 0x13
76 #define ROC_DAC_VIbias_DAC 0x14
77 #define ROC_DAC_VIbias_roc 0x15
78 #define ROC_DAC_VIColOr 0x16
79 #define ROC_DAC_Vnpix 0x17
80 #define ROC_DAC_VsumCol 0x18
81 #define ROC_DAC_Vcal 0x19
82 #define ROC_DAC_CalDel 0x1A
83 #define ROC_DAC_CtrlReg 0xFD
84 #define ROC_DAC_WBC 0xFE
85 #define ROC_DAC_Readback 0xFF
86 
87 
88 // --- Testboard Signal Delay -------------------------------------------------
89 #define SIG_CLK 0
90 #define SIG_CTR 1
91 #define SIG_SDA 2
92 #define SIG_TIN 3
93 #define SIG_RDA_TOUT 4
94 
95 #define SIG_LEVEL 0xFC
96 #define SIG_LOOP_TRIGGER_DELAY 0xFD
97 #define SIG_DESER160PHASE 0xFE
98 
99 #define SIG_MODE_NORMAL 0
100 #define SIG_MODE_LO 1
101 #define SIG_MODE_HI 2
102 
103 
104 // --- Testboard Clock / Timing -----------------------------------------------
105 #define CLK_SRC_INT 0
106 #define CLK_SRC_EXT 1
107 
108 // --- Clock Stretch and Clock Divider settings -------------------------------
109 #define STRETCH_AFTER_TRG 0
110 #define STRETCH_AFTER_CAL 1
111 #define STRETCH_AFTER_RES 2
112 #define STRETCH_AFTER_SYNC 3
113 
114 #define MHZ_1_25 5
115 #define MHZ_2_5 4
116 #define MHZ_5 3
117 #define MHZ_10 2
118 #define MHZ_20 1
119 #define MHZ_40 0
120 
121 
122 // --- Testboard digital signal probe -----------------------------------------
123 #define PROBE_OFF 0
124 #define PROBE_CLK 1
125 #define PROBE_SDA 2
126 #define PROBE_SDA_SEND 3
127 #define PROBE_PG_TOK 4
128 #define PROBE_PG_TRG 5
129 #define PROBE_PG_CAL 6
130 #define PROBE_PG_RES_ROC 7
131 #define PROBE_PG_RES_TBM 8
132 #define PROBE_PG_SYNC 9
133 #define PROBE_CTR 10
134 #define PROBE_TIN 11
135 #define PROBE_TOUT 12
136 #define PROBE_CLK_PRESEN 13
137 #define PROBE_CLK_GOOD 14
138 #define PROBE_DAQ0_WR 15
139 #define PROBE_CRC 16
140 #define PROBE_ADC_RUNNING 19
141 #define PROBE_ADC_RUN 20
142 #define PROBE_ADC_PGATE 21
143 #define PROBE_ADC_START 22
144 #define PROBE_ADC_SGATE 23
145 #define PROBE_ADC_S 24
146 
147 #define PROBE_TBM0_GATE 100
148 #define PROBE_TBM0_DATA 101
149 #define PROBE_TBM0_TBMHDR 102
150 #define PROBE_TBM0_ROCHDR 103
151 #define PROBE_TBM0_TBMTRL 104
152 
153 #define PROBE_TBM1_GATE 105
154 #define PROBE_TBM1_DATA 106
155 #define PROBE_TBM1_TBMHDR 107
156 #define PROBE_TBM1_ROCHDR 108
157 #define PROBE_TBM1_TBMTRL 109
158 
159 #define PROBE_TBM2_GATE 110
160 #define PROBE_TBM2_DATA 111
161 #define PROBE_TBM2_TBMHDR 112
162 #define PROBE_TBM2_ROCHDR 113
163 #define PROBE_TBM2_TBMTRL 114
164 
165 #define PROBE_TBM3_GATE 115
166 #define PROBE_TBM3_DATA 116
167 #define PROBE_TBM3_TBMHDR 117
168 #define PROBE_TBM3_ROCHDR 118
169 #define PROBE_TBM3_TBMTRL 119
170 
171 #define PROBE_TBM4_GATE 120
172 #define PROBE_TBM4_DATA 121
173 #define PROBE_TBM4_TBMHDR 122
174 #define PROBE_TBM4_ROCHDR 123
175 #define PROBE_TBM4_TBMTRL 124
176 
177 #define PROBE_TBM5_GATE 125
178 #define PROBE_TBM5_DATA 126
179 #define PROBE_TBM5_TBMHDR 127
180 #define PROBE_TBM5_ROCHDR 128
181 #define PROBE_TBM5_TBMTRL 129
182 
183 
184 // --- Testboard analog signal probe ------------------------------------------
185 #define PROBEA_TIN 0
186 #define PROBEA_SDATA1 1
187 #define PROBEA_SDATA2 2
188 #define PROBEA_CTR 3
189 #define PROBEA_CLK 4
190 #define PROBEA_SDA 5
191 #define PROBEA_TOUT 6
192 #define PROBEA_OFF 7
193 
194 #define GAIN_1 0
195 #define GAIN_2 1
196 #define GAIN_3 2
197 #define GAIN_4 3
198 
199 
200 // --- Testboard pulse pattern generator --------------------------------------
201 #define PG_NONE 0x0000
202 #define PG_TOK 0x0100
203 #define PG_TRG 0x0200
204 #define PG_CAL 0x0400
205 #define PG_RESR 0x0800
206 #define PG_REST 0x1000
207 #define PG_SYNC 0x2000
208 
209 } //namespace pxar
210 
211 #endif /* PXAR_CONSTANTS_H */