CAEN FERS Library v1.3.0
SDK for FERS systems
Loading...
Searching...
No Matches
FERS_Registers_520X.h
Go to the documentation of this file.
1
16
17#ifndef _REGISTERS_H
18#define _REGISTERS_H // Protect against multiple inclusion
19
20
21// ############################################################################################
22// FPGA REGISTERS
23// ############################################################################################
24
25
26// *****************************************************************
27// Individual Channel and Broadcast address converter
28// *****************************************************************
29#define INDIV_ADDR(addr, ch) (0x02000000 | ((addr) & 0xFFFF) | ((ch)<<16))
30#define BCAST_ADDR(addr) (0x03000000 | ((addr) & 0xFFFF))
31
37// *****************************************************************
38// FPGA Register Address Map common
39// *****************************************************************
40#define a_acq_ctrl 0x01000000
41#define a_run_mask 0x01000004
42#define a_trg_mask 0x01000008
43#define a_tref_mask 0x0100000C
44#define a_t0_out_mask 0x01000014
45#define a_t1_out_mask 0x01000018
46#define a_veto_mask 0x0100001C
47#define a_tref_delay 0x01000048
48#define a_tref_window 0x0100004C
49#define a_dwell_time 0x01000050
50#define a_list_size 0x01000054
51#define a_pck_maxcnt 0x01000064
52#define a_channel_mask_0 0x01000100
53#define a_channel_mask_1 0x01000104
54#define a_fw_rev 0x01000300
55#define a_acq_status 0x01000304
56#define a_real_time 0x01000308
57#define a_dead_time 0x01000310
58#define a_board_temp 0x01000340
59#define a_fpga_temp 0x01000348
60#define a_pid 0x01000400
61#define a_pcb_rev 0x01000404
62#define a_fers_code 0x01000408
63#define a_rebootfpga 0x0100FFF0
64#define a_test_led 0x01000228
65#define a_tdc_mode 0x0100022C
66#define a_tdc_data 0x01000230
67
68#define a_sw_compatib 0x01004000
69#define a_commands 0x01008000
70
71// *****************************************************************
72// FPGA Register Address Map 5202 Only
73// *****************************************************************
74#define a_validation_mask 0x01000010
75#define a_acq_ctrl2 0x01000020
76#define a_dprobe_5202 0x01000068
77#define a_citiroc_cfg 0x01000108
78#define a_citiroc_en 0x0100010C
79#define a_citiroc_probe 0x01000110
80#define a_qd_coarse_thr 0x01000114
81#define a_td_coarse_thr 0x01000118
82#define a_lg_sh_time 0x0100011C
83#define a_hg_sh_time 0x01000120
84#define a_hold_delay 0x01000124
85#define a_amux_seq_ctrl 0x01000128
86#define a_wave_length 0x0100012C
87#define a_scbs_ctrl 0x01000130
88#define a_scbs_data 0x01000134
89#define a_qdiscr_mask_0 0x01000138
90#define a_qdiscr_mask_1 0x0100013C
91#define a_tdiscr_mask_0 0x01000140
92#define a_tdiscr_mask_1 0x01000144
93#define a_tpulse_ctrl 0x01000200
94#define a_tpulse_dac 0x01000204
95#define a_hv_regaddr 0x01000210
96#define a_hv_regdata 0x01000214
97#define a_trgho 0x01000218
98#define a_dc_offset 0x01000220
99#define a_spi_data 0x01000224
100#define a_test_led 0x01000228
101#define a_tdc_mode 0x0100022C
102#define a_tdc_data 0x01000230
103#define a_tlogic_def 0x01000234
104#define a_tlogic_width 0x0100023C
105#define a_hit_width 0x01000238
106#define a_i2c_addr_5202 0x01000240
107#define a_i2c_data_5202 0x01000244
108#define a_t_or_cnt 0x01000350
109#define a_q_or_cnt 0x01000354
110#define a_hv_Vmon 0x01000356
111#define a_hv_Imon 0x01000358
112#define a_hv_status 0x01000360
113#define a_uC_status 0x01000600
114#define a_uC_shutdown 0x01000604
115#define a_zs_lgthr 0x02000000
116#define a_zs_hgthr 0x02000004
117#define a_qd_fine_thr 0x02000008
118#define a_td_fine_thr 0x0200000C
119#define a_lg_gain 0x02000010
120#define a_hg_gain 0x02000014
121#define a_hv_adj 0x02000018
122#define a_hitcnt 0x02000800
123
124// *****************************************************************
125// FPGA Register Address Map 5203 Only
126// *****************************************************************
127#define a_io_ctrl 0x01000020
128#define a_trg_delay 0x01000060
129#define a_dprobe_5203 0x01000110
130#define a_lsof_almfull_bsy 0x01000068
131#define a_lsof_almfull_skp 0x0100006C
132#define a_trgf_almfull 0x01000070
133#define a_tot_rej_lthr 0x01000074
134#define a_tot_rej_hthr 0x01000078
135#define a_trg_hold_off 0x0100007A
136#define a_strm_ptrg 0x0100007C
137#define a_i2c_addr_5203 0x01000200
138#define a_i2c_data_5203 0x01000204
139#define a_trg_cnt 0x01000318
140#define a_tdcro_status 0x0100031A
141#define a_rej_trg_cnt 0x0100031C
142#define a_zs_trg_cnt 0x01000320
143#define a_clk_out_phase 0x01000330
144#define a_tdc0_temp 0x01000354
145#define a_tdc1_temp 0x01000358
146#define a_spi_data 0x01000224
147
148// *****************************************************************
149// FPGA Register Address Map 5204 Only
150// *****************************************************************
151#define a_tlogic_mask_0 0x01000140
152#define a_tlogic_mask_1 0x01000144
153
155
156// *****************************************************************
157// FPGA Register Bit Fields
158// *****************************************************************
159// Status Register
160#define STATUS_READY (1 << 0)
161#define STATUS_FAIL (1 << 1)
162#define STATUS_RUNNING (1 << 2)
163#define STATUS_TDL_SYNC (1 << 3)
164#define STATUS_FPGA_OVERTEMP (1 << 4)
165#define STATUS_TDC_RO_ERR (1 << 5)
166#define STATUS_TDLINK_LOL (1 << 6)
167#define STATUS_TDC0_LOL (1 << 7)
168#define STATUS_TDC1_LOL (1 << 8)
169#define STATUS_RO_CLK_LOL (1 << 9)
170#define STATUS_TDL_DISABLED (1 << 10)
171#define STATUS_TDC0_OVERTEMP (1 << 11)
172#define STATUS_TDC1_OVERTEMP (1 << 12)
173#define STATUS_BOARD_OVERTEMP (1 << 13)
174#define STATUS_CRC_ERROR (1 << 14)
175#define STATUS_UNUSED_15 (1 << 15)
176#define STATUS_SPI_BUSY (1 << 16)
177#define STATUS_I2C_BUSY (1 << 17)
178#define STATUS_I2C_FAIL (1 << 18)
179
180
181// *****************************************************************
182// FPGA Commands
183// *****************************************************************
189#define CMD_TIME_RESET 0x11
190#define CMD_ACQ_START 0x12
191#define CMD_ACQ_STOP 0x13
192#define CMD_TRG 0x14
193#define CMD_RESET 0x15
194#define CMD_TPULSE 0x16
195#define CMD_RES_PTRG 0x17
196#define CMD_CLEAR 0x18
197#define CMD_VALIDATION 0x19
198#define CMD_SET_VETO 0x1A
199#define CMD_CLEAR_VETO 0x1B
200#define CMD_TDL_SYNC 0x1C
201#define CMD_USE_ICLK 0x1E
202#define CMD_USE_ECLK 0x1F
203#define CMD_CFG_ASIC 0x20
205
206// ############################################################################################
207// CITIROC REGISTERS
208// ############################################################################################
209
210#define crcfg_qdiscr_latch 0
211#define crcfg_sca_bias 1
212#define crcfg_pdet_mode_hg 2
213#define crcfg_pdet_mode_lg 3
214#define crcfg_ps_ctrl_logic 4
215#define crcfg_ps_trg_source 5
216#define crcfg_lg_pa_bias 6
217#define crcfg_pa_fast_sh 7
218#define crcfg_8bit_dac_ref 8
219#define crcfg_ota_bias 9
220#define crcfg_trg_polarity 10
221#define crcfg_enable_chtrg 11
222#define crcfg_enable_gtrg 16
223#define crcfg_enable_veto 17
224#define crcfg_repeat_raz 18
225
226#define SHAPING_TIME_12_5NS 6
227#define SHAPING_TIME_25NS 5
228#define SHAPING_TIME_37_5NS 4
229#define SHAPING_TIME_50NS 3
230#define SHAPING_TIME_62_5NS 2
231#define SHAPING_TIME_75NS 1
232#define SHAPING_TIME_87_5NS 0
233
234#define TEST_PULSE_SOURCE_EXT 0
235#define TEST_PULSE_SOURCE_T0_IN 1
236#define TEST_PULSE_SOURCE_T1_IN 2
237#define TEST_PULSE_SOURCE_PTRG 3
238#define TEST_PULSE_SOURCE_SW_CMD 4
239
240#define TEST_PULSE_PREAMP_LG 1
241#define TEST_PULSE_PREAMP_HG 2
242#define TEST_PULSE_PREAMP_BOTH 3
243
244#define TEST_PULSE_DEST_ALL 1
245#define TEST_PULSE_DEST_EVEN 2
246#define TEST_PULSE_DEST_ODD 3
247#define TEST_PULSE_DEST_NONE 4
248
249#define DPROBE_OFF 0
250#define DPROBE_PEAK_LG 1
251#define DPROBE_PEAK_HG 2
252#define DPROBE_HOLD 3
253#define DPROBE_START_CONV 4
254#define DPROBE_DATA_COMMIT 5
255#define DPROBE_DATA_VALID 6
256#define DPROBE_CLK_1024 7
257#define DPROBE_VAL_WINDOW 8
258#define DPROBE_T_OR 9
259#define DPROBE_Q_OR 10
260#define DPROBE_XROC_TRG 11
261
262#define GAIN_SEL_AUTO 0
263#define GAIN_SEL_HIGH 1
264#define GAIN_SEL_LOW 2
265#define GAIN_SEL_BOTH 3
266
267#define FAST_SHAPER_INPUT_HGPA 0
268#define FAST_SHAPER_INPUT_LGPA 1
269
270
271
272
273// ############################################################################################
274// RADIOROC REGISTERS
275// ############################################################################################
276
277// *****************************************************************
278// XROC register map
279// *****************************************************************
280#define a_XR_ChControl(i) (0x0000 + (63-i))
281#define a_XR_ASIC_bias 0x0040
282#define a_XR_common_cfg 0x0041
283#define a_XR_out_cfg 0x0042
284#define a_XR_event_val 0x0043
285
286// *****************************************************************
287// XROC reg data struct
288// *****************************************************************
289typedef struct {
290 struct { // Addr - SubAddr
291 uint8_t r0_inDAC; // 0+CH - 0
292 uint8_t r1_pat_Gain_Comp; // 0+CH - 1
293 uint8_t r2_LG_HG_Gain; // 0+CH - 2
294 uint8_t r3_LG_HG_Tau; // 0+CH - 3
295 uint8_t r4_calibDacT1; // 0+CH - 4
296 uint8_t r5_calibDacT2; // 0+CH - 5
297 uint8_t r6_EnMask1; // 0+CH - 6
298 uint8_t r7_EnMask2; // 0+CH - 7
299 uint8_t r66_ProbeSwitchCmd; // 0+CH - 66
300 } ChControl[64];
301 struct { // Addr - SubAddr
302 uint8_t r0_inDAC0; // 64 - 0
303 uint8_t r1_inDAC1; // 64 - 1
304 uint8_t r2_calDAC_paT; // 64 - 2
305 uint8_t r3_pa_LG_HG; // 64 - 3
306 uint8_t r4_sh_HG; // 64 - 4
307 uint8_t r5_sh_LG; // 64 - 5
308 uint8_t r6_pdbuff_pdetect; // 64 - 6
309 uint8_t r7_FCNpdet_FCPpdet; // 64 - 7
310 uint8_t r8_FCNpbuf_FCPpbuf; // 64 - 8
311 uint8_t r9_dis1a; // 64 - 9
312 uint8_t r10_dis1b_dis2a; // 64 - 10
313 uint8_t r11_dis2b; // 64 - 11
314 uint8_t r12_dis_charge; // 64 - 12
315 uint8_t r13_EnMask1; // 64 - 13
316 uint8_t r14_EnMask2; // 64 - 14
317 } ASICBias;
318 struct { // Addr - SubAddr
319 uint8_t r0_BandGap; // 65 - 0
320 uint8_t r1_DAC1a; // 65 - 1
321 uint8_t r2_DAC1b_DAC2a; // 65 - 2
322 uint8_t r3_DAC2b_DACqa; // 65 - 3
323 uint8_t r4_DACqb; // 65 - 4
324 uint8_t r5_Ib_thrDac; // 65 - 5
325 uint8_t r6_Ib_thrDac; // 65 - 6
326 uint8_t r7_EnMask; // 65 - 7
327 uint8_t r8_delay; // 65 - 8
328 uint8_t r9_; // 65 - 9
329 uint8_t r10_; // 65 - 10
330 uint8_t r11_; // 65 - 11
331 uint8_t r12_; // 65 - 12
332 uint8_t r66_; // 65 - 66
333 } Common;
334 struct { // Addr - SubAddr
335 uint8_t r0_BandGap; // 65 - 0
336 uint8_t r1_DAC1a; // 65 - 1
337 uint8_t r2_DAC1b_DAC2a; // 65 - 2
338 uint8_t r3_DAC2b_DACqa; // 65 - 3
339 uint8_t r4_DACqb; // 65 - 4
340 uint8_t r5_Ib_thrDac; // 65 - 5
341 uint8_t r6_Ib_thrDac; // 65 - 6
342 uint8_t r7_EnMask; // 65 - 7
343 uint8_t r8_delay; // 65 - 8
344 uint8_t r9_; // 65 - 9
345 uint8_t r10_; // 65 - 10
346 uint8_t r11_; // 65 - 11
347 uint8_t r12_; // 65 - 12
348 uint8_t r66_; // 65 - 66
349 } Outing;
350
351} XR_Cfg_t;
352
353
354
355// ############################################################################################
356// PICOTDC REGISTERS
357// ############################################################################################
358
359// *****************************************************************
360// picoTDC register Map
361// *****************************************************************
362#define a_pTDC_Control 0x0004
363#define a_pTDC_Enable 0x0008
364#define a_pTDC_Header 0x000C
365#define a_pTDC_TrgWindow 0x0010
366#define a_pTDC_Trg0Del_ToT 0x0014
367#define a_pTDC_BunchCount 0x0018
368#define a_pTDC_EventID 0x001C
369#define a_pTDC_Ch_Control(i) (0x0020 + (i)*4)
370#define a_pTDC_Buffers 0x0120
371#define a_pTDC_Hit_RX_TX 0x0124
372#define a_pTDC_DLL_TG 0x0128
373#define a_pTDC_PLL1 0x0130
374#define a_pTDC_PLL2 0x0134
375#define a_pTDC_Clocks 0x0138 // R/W -
376#define a_pTDC_ClockShift 0x013C // R/W -
377#define a_pTDC_Hit_RXen_T 0x0140 // R/W -
378#define a_pTDC_Hit_RXen_B 0x0144 // R/W -
379#define a_pTDC_PulseGen1 0x0148 // R/W -
380#define a_pTDC_PulseGen2 0x014C // R/W -
381#define a_pTDC_PulseGen3 0x0150 // R/W -
382#define a_pTDC_ErrorFlagCtrl 0x0154 // R/W -
383#define a_pTDC_Ch_Status(i) (0x0160 + (i)*4) // R -
384#define a_pTDC_Trg_Status(i) (0x0260 + (i)*4) // R -
385#define a_pTDC_RO_Status(i) (0x0270 + (i)*4) // R -
386#define a_pTDC_Cfg_Parity(i) (0x0280 + (i)*4) // R -
387#define a_pTDC_PLL_Caps 0x28C // R -
388#define a_pTDC_DelayAdjust 0xFFFC // W -
389
390// *****************************************************************
391// picoTDC Data Structures
392// *****************************************************************
393
394typedef struct {
395 // ------------------------------------------------ Control
396 union {
397 struct {
398 uint32_t magic_word : 8;
399 uint32_t digital_reset : 1;
400 uint32_t bunchcount_reset : 1;
401 uint32_t eventid_reset : 1;
402 uint32_t dropcnts_reset : 1;
403 uint32_t errorcnts_reset : 1;
404 uint32_t trigger_create : 1;
406 uint32_t reserved1 : 17;
407 } bits;
408 uint32_t reg;
409 } Control;
410 // ------------------------------------------------ Enable
411 union {
412 struct {
413 uint32_t reserved1 : 1;
414 uint32_t falling_en : 1;
415 uint32_t single_readout_en : 1;
416 uint32_t reserved2 : 2;
417 uint32_t highres_en : 1;
418 uint32_t dig_rst_ext_en : 1;
419 uint32_t bx_rst_ext_en : 1;
420 uint32_t eid_rst_ext_en : 1;
421 uint32_t reserved3 : 8;
422 uint32_t crossing_en : 1;
423 uint32_t rx_en_extref : 1;
424 uint32_t rx_en_bxrst : 1;
425 uint32_t rx_en_eidrst : 1;
426 uint32_t rx_en_trigger : 1;
427 uint32_t rx_en_reset : 1;
428 uint32_t left_suppress : 1;
429 uint32_t channel_split2 : 1;
430 uint32_t channel_split4 : 1;
431 uint32_t reserved4 : 6;
432 } bits;
433 uint32_t reg;
434 } Enable;
435 // ------------------------------------------------ Header
436 union {
437 struct {
438 uint32_t untriggered : 1;
439 uint32_t reserved1 : 1;
440 uint32_t relative : 1;
441 uint32_t second_header : 1;
442 uint32_t full_events : 1;
443 uint32_t trigger_ch0_en : 1;
444 uint32_t reserved2 : 2;
445 uint32_t header_fields0 : 3;
446 uint32_t reserved3 : 1;
447 uint32_t header_fields1 : 3;
448 uint32_t reserved4 : 1;
449 uint32_t header_fields2 : 3;
450 uint32_t reserved5 : 1;
451 uint32_t header_fields3 : 3;
452 uint32_t reserved6 : 1;
453 uint32_t max_eventsize : 8;
454 } bits;
455 uint32_t reg;
456 } Header;
457 // ------------------------------------------------ TrgWindow
458 union {
459 struct {
460 uint32_t trigger_latency : 13;
461 uint32_t reserved1 : 3;
462 uint32_t trigger_window : 13;
463 uint32_t reserved2 : 3;
464 } bits;
465 uint32_t reg;
466 } TrgWindow;
467
468 // ------------------------------------------------ Trg0Del_ToT
469 union {
470 struct {
471 uint32_t trg_ch0_delay : 13;
472 uint32_t reserved1 : 3;
473 uint32_t tot : 1;
474 uint32_t tot_8bit : 1;
475 uint32_t tot_startbit : 5;
476 uint32_t tot_saturate : 1;
478 uint32_t reserved2 : 4;
479 } bits;
480 uint32_t reg;
481 } Trg0Del_ToT;
482 // ------------------------------------------------ BunchCount
483 union {
484 struct {
485 uint32_t bunchcount_overflow : 13;
486 uint32_t reserved1 : 3;
487 uint32_t bunchcount_offset : 13;
488 uint32_t reserved2 : 3;
489 } bits;
490 uint32_t reg;
491 } BunchCount;
492 // ------------------------------------------------ EventID
493 union {
494 struct {
495 uint32_t eventid_overflow : 13;
496 uint32_t reserved1 : 3;
497 uint32_t eventid_offset : 13;
498 uint32_t reserved2 : 3;
499 } bits;
500 uint32_t reg;
501 } EventID;
502 // ------------------------------------------------ Ch_Control[64]
503 union {
504 struct {
505 uint32_t channel_offset : 26;
506 uint32_t falling_en_tm : 1;
507 uint32_t highres_en_tm : 1;
508 uint32_t scan_en_tm : 1;
509 uint32_t scan_in_tm : 1;
510 uint32_t reserved1 : 1;
511 uint32_t channel_enable : 1;
512 } bits;
513 uint32_t reg;
514 } Ch_Control[64];
515 // ------------------------------------------------ Buffers
516 union {
517 struct {
521 uint32_t disable_ro_reject : 1;
522 uint32_t errorcnts_saturate : 1;
523 uint32_t reserved1 : 2;
524 uint32_t max_grouphits : 8;
525 uint32_t reserved2 : 8;
526 } bits;
527 uint32_t reg;
528 } Buffers;
529 // ------------------------------------------------ Hit_RX_TX
530 union {
531 struct {
532 uint32_t hrx_top_delay : 4;
533 uint32_t hrx_top_bias : 4;
536 uint32_t hrx_top_en_r : 1;
537 uint32_t hrx_top_en : 1;
538 uint32_t hrx_bot_delay : 4;
539 uint32_t hrx_bot_bias : 4;
542 uint32_t hrx_bot_en_r : 1;
543 uint32_t hrx_bot_en : 1;
544 uint32_t tx_strenght : 2;
545 uint32_t reserved1 : 6;
546 } bits;
547 uint32_t reg;
548 } Hit_RX_TX;
549 // ------------------------------------------------ DLL_TG
550 union {
551 struct {
552 uint32_t dll_bias_val : 7;
553 uint32_t dll_bias_cal : 5;
554 uint32_t dll_cp_comp : 3;
555 uint32_t dll_ctrlval : 4;
556 uint32_t dll_fixctrl : 1;
557 uint32_t dll_extctrl : 1;
558 uint32_t dll_cp_comp_dir : 1;
559 uint32_t dll_en_bias_cal : 1;
560 uint32_t tg_bot_nen_fine : 1;
561 uint32_t tg_bot_nen_coarse : 1;
562 uint32_t tg_top_nen_fine : 1;
563 uint32_t tg_top_nen_coarse : 1;
564 uint32_t tg_cal_nrst : 1;
565 uint32_t tg_cal_parity_in : 1;
566 uint32_t reserved1 : 3;
567 } bits;
568 uint32_t reg;
569 } DLL_TG;
570 // ------------------------------------------------ PLL1
571 union {
572 struct {
573 uint32_t pll_cp_ce : 1;
574 uint32_t pll_cp_dacset : 7;
575 uint32_t pll_cp_irefcpset : 5;
576 uint32_t pll_cp_mmcomp : 3;
577 uint32_t pll_cp_mmdir : 1;
578 uint32_t pll_pfd_enspfd : 1;
579 uint32_t pll_resistor : 5;
580 uint32_t pll_sw_ext : 1;
581 uint32_t pll_vco_dacsel : 1;
582 uint32_t pll_vco_dacset : 7;
583 } bits;
584 uint32_t reg;
585 } PLL1;
586 // ------------------------------------------------ PLL2
587 union {
588 struct {
589 uint32_t pll_vco_dac_ce : 1;
590 uint32_t pll_vco_igen_start : 1;
591 uint32_t pll_railmode_vco : 1;
592 uint32_t pll_abuffdacset : 5;
593 uint32_t pll_buffce : 1;
594 uint32_t pll_afcvcal : 4;
595 uint32_t pll_afcstart : 1;
596 uint32_t pll_afcrst : 1;
597 uint32_t pll_afc_override : 1;
598 uint32_t pll_bt0 : 1;
601 uint32_t reserved1 : 10;
602 } bits;
603 uint32_t reg;
604 } PLL2;
605
606 // ------------------------------------------------ Clocks
607 union {
608 struct {
609 uint32_t hit_phase : 2;
610 uint32_t reserved1 : 2;
611 uint32_t trig_phase : 3;
612 uint32_t reserved2 : 1;
613 uint32_t bx_rst_phase : 3;
614 uint32_t reserved3 : 1;
615 uint32_t eid_rst_phase : 3;
616 uint32_t reserved4 : 1;
617 uint32_t par_speed : 2;
618 uint32_t reserved5 : 2;
619 uint32_t par_phase : 3;
620 uint32_t sync_clock : 1;
621 uint32_t ext_clk_dll : 1;
622 uint32_t reserved6 : 7;
623 } bits;
624 uint32_t reg;
625 } Clocks;
626 // ------------------------------------------------ ClockShift
627 union {
628 struct {
629 uint32_t reserved1 : 4;
630 uint32_t shift_clk1G28 : 4;
631 uint32_t shift_clk640M : 4;
632 uint32_t shift_clk320M : 4;
633 uint32_t shift_clk320M_ref : 4;
634 uint32_t shift_clk160M : 4;
635 uint32_t shift_clk80M : 4;
636 uint32_t shift_clk40M : 4;
637 } bits;
638 uint32_t reg;
639 } ClockShift;
640 // ------------------------------------------------ Hit_RXen_T
641 union {
642 struct {
643 uint32_t hrx_enable_t : 32;
644 } bits;
645 uint32_t reg;
646 } Hit_RXen_T;
647 // ------------------------------------------------ Hit_RXen_B
648 union {
649 struct {
650 uint32_t hrx_enable_b : 32;
651 } bits;
652 uint32_t reg;
653 } Hit_RXen_B;
654 // ------------------------------------------------ PulseGen1
655 union {
656 struct {
657 uint32_t pg_run : 1;
658 uint32_t pg_rep : 1;
659 uint32_t pg_direct : 1;
660 uint32_t pg_ini : 1;
661 uint32_t pg_en : 1;
662 uint32_t pg_strength : 2;
663 uint32_t reserved1 : 1;
664 uint32_t pg_rising : 18;
665 uint32_t reserved2 : 6;
666 } bits;
667 uint32_t reg;
668 } PulseGen1;
669 // ------------------------------------------------ PulseGen2
670 union {
671 struct {
672 uint32_t pg_phase : 8;
673 uint32_t pg_falling : 18;
674 uint32_t reserved1 : 6;
675 } bits;
676 uint32_t reg;
677 } PulseGen2;
678 // ------------------------------------------------ PulseGen3
679 union {
680 struct {
681 uint32_t pg_reload : 18;
682 uint32_t reserved2 : 14;
683 } bits;
684 uint32_t reg;
685 } PulseGen3;
686 // ------------------------------------------------ ErrorFlagCtrl
687 union {
688 struct {
689 uint32_t error_flags_1 : 10;
690 uint32_t error_flags_2 : 10;
691 uint32_t error_flags_3 : 10;
692 uint32_t reserved1 : 2;
693 } bits;
694 uint32_t reg;
695 } ErrorFlagCtrl;
696 // ------------------------------------------------ DelayAdjust
697 union {
698 struct {
699 uint32_t tg_delay_taps : 8;
700 uint32_t reserved1 : 24;
701 } bits;
702 uint32_t reg;
703 } DelayAdjust;
704
705 // ************************************************
706 // Status Regs (read only)
707 // ************************************************
708 // ------------------------------------------------ Ch_Status[64]
709 union {
710 struct {
711 uint32_t ch_fillgrade : 8;
712 uint32_t ch_dropped : 8;
713 uint32_t ch_parity : 4;
714 uint32_t scan_out : 1;
715 uint32_t reserved1 : 2;
716 uint32_t ch_stateerr : 1;
717 uint32_t reserved2 : 8;
718 } bits;
719 uint32_t reg;
720 } Ch_Status[64];
721 // ------------------------------------------------ Trg_Status[4]
722 union {
723 struct {
724 uint32_t tr_fillgrade : 8;
725 uint32_t tr_dropped : 8;
726 uint32_t tr_parity : 4;
727 uint32_t reserved1 : 3;
728 uint32_t tr_stateerr : 1;
729 uint32_t reserved2 : 8;
730
731 } bits;
732 uint32_t reg;
733 } Trg_Status[4];
734 // ------------------------------------------------ RO_Status[4]
735 union {
736 struct {
737 uint32_t ro_fillgrade : 8;
738 uint32_t ro_dropped : 8;
739 uint32_t ro_corrected : 4;
740 uint32_t reserved1 : 3;
741 uint32_t ro_multibiterr : 4;
742 uint32_t reserved2 : 5;
743
744 } bits;
745 uint32_t reg;
746 } RO_Status[4];
747 // ------------------------------------------------ Cfg_Parity[3]
748 union {
749 struct {
750 uint32_t parity : 32;
751 } bits;
752 uint32_t reg;
753 } Cfg_Parity[3];
754 // ------------------------------------------------ PLL_Caps
755 union {
756 struct {
757 uint32_t pll_selectedcap : 24;
758 uint32_t reserved1 : 8;
759 } bits;
760 uint32_t reg;
761 } PLL_Caps;
762
764
765
766// *****************************************************************
767// Address of I2C devices
768// *****************************************************************
769#define I2C_ADDR_TDC(i) (0x63 - (i))
770#define I2C_ADDR_PLL0 0x68
771#define I2C_ADDR_PLL1 0x69
772#define I2C_ADDR_PLL2 0x70
773#define I2C_ADDR_EEPROM_MEM 0x57
774#define I2C_ADDR_XR 0x78 // weeroc ASIC
775
776#endif
777
778
779
uint8_t r66_ProbeSwitchCmd
uint8_t r2_calDAC_paT
uint8_t r3_DAC2b_DACqa
uint8_t r2_LG_HG_Gain
uint8_t r5_calibDacT2
uint8_t r7_FCNpdet_FCPpdet
uint8_t r4_calibDacT1
uint8_t r8_FCNpbuf_FCPpbuf
uint8_t r6_pdbuff_pdetect
uint8_t r2_DAC1b_DAC2a
uint8_t r12_dis_charge
uint8_t r1_pat_Gain_Comp
uint8_t r10_dis1b_dis2a
uint32_t hrx_bot_filter_leading
uint32_t hrx_bot_filter_trailing
uint32_t hrx_top_filter_trailing
uint32_t hrx_top_filter_leading
uint32_t trigger_create_single