1 | #ifndef FADFORMAT_H_SEEN
|
---|
2 | #define FADFORMAT_H_SEEN
|
---|
3 |
|
---|
4 | #include "../drsdaq/RawDataCTX.h"
|
---|
5 |
|
---|
6 | //
|
---|
7 | // Commands for FAD
|
---|
8 | //
|
---|
9 | #define CMD_Start 0xC000 // Start Run
|
---|
10 | #define CMD_Stop 0x3000 // Stop Run
|
---|
11 | #define CMD_Trigger 0xA000 // single trigger
|
---|
12 | #define CMD_DENABLE 0x0600 // DENABLE line HIGH
|
---|
13 | #define CMD_DDISABLE 0x0700 // DENABLE line LOW
|
---|
14 | #define CMD_DWRITE_RUN 0x0800 // DWRITE possibly HIGH
|
---|
15 | #define CMD_DWRITE_STOP 0x0900 // DWRITE always LOW
|
---|
16 | #define CMD_SCLK_ON 0x1000
|
---|
17 | #define CMD_SCLK_OFF 0x1100
|
---|
18 | #define CMD_PS_DIRINC 0x1200
|
---|
19 | #define CMD_PS_DIRDEC 0x1300
|
---|
20 | #define CMD_PS_DO 0x1400
|
---|
21 | #define CMD_PS_RESET 0x1700
|
---|
22 | #define CMD_SRCLK_ON 0x1500
|
---|
23 | #define CMD_SRCLK_OFF 0x1600
|
---|
24 | #define CMD_Trigger_C 0xB000 // continous trigger
|
---|
25 | #define CMD_Trigger_S 0x2000 // stop continous trigger
|
---|
26 | #define CMD_Read 0x0A00 // read from Config-RAM
|
---|
27 | #define CMD_Write 0x0500 // write to Config-RAM
|
---|
28 |
|
---|
29 | #define CMD_TRIGGERS_ON 0x1800 // enables the trigger line -- incoming triggers can now be accepted
|
---|
30 | #define CMD_TRIGGERS_OFF 0x1900 // disables the trigger line -- no trigger will be accepted
|
---|
31 |
|
---|
32 | //
|
---|
33 | // Other definitions
|
---|
34 | //
|
---|
35 | #define MAX_ADDR 0xFF // highest address in Config-RAM
|
---|
36 | #define BADDR_ROI 0x00 // Baseaddress ROI-Values
|
---|
37 | #define BADDR_DAC 0x24 // Baseaddress DAC-Values
|
---|
38 | #define MAX_VAL 65535
|
---|
39 | #define MAX_ROIVAL 1024
|
---|
40 | #define MAX_DACVAL 65535
|
---|
41 |
|
---|
42 | const unsigned int NChannels = 9;
|
---|
43 | const unsigned int NBins = 1024;
|
---|
44 | const unsigned int NChips = 4;
|
---|
45 | const unsigned int NTemp = 4;
|
---|
46 | const unsigned int NDAC = 8;
|
---|
47 |
|
---|
48 | //
|
---|
49 | // Data structures
|
---|
50 | //
|
---|
51 | typedef struct {
|
---|
52 | unsigned short start_package_flag;
|
---|
53 | unsigned short package_length;
|
---|
54 | unsigned short version_no;
|
---|
55 | unsigned long trigger_id;
|
---|
56 | unsigned char trigger_type;
|
---|
57 | unsigned char trigger_crc;
|
---|
58 | unsigned long local_trigger_id;
|
---|
59 | unsigned char local_trigger_type;
|
---|
60 | unsigned char local_trigger_crc;
|
---|
61 | unsigned short board_id;
|
---|
62 | short drs_temperature[NTemp];
|
---|
63 | unsigned short dac[NDAC];
|
---|
64 | } __attribute__((__packed__)) PEVNT_HEADER;
|
---|
65 |
|
---|
66 | typedef struct {
|
---|
67 | unsigned short id;
|
---|
68 | unsigned short start_cell;
|
---|
69 | unsigned short roi;
|
---|
70 | unsigned short adc_data[];
|
---|
71 | } __attribute__((__packed__)) PCHANNEL;
|
---|
72 |
|
---|
73 | typedef struct {
|
---|
74 | unsigned short package_crc;
|
---|
75 | unsigned short end_package_flag;
|
---|
76 | } __attribute__((__packed__)) PEVNT_FOOTER;
|
---|
77 |
|
---|
78 | #endif
|
---|