source: fact/FADctrl/FADFormat.h@ 10036

Last change on this file since 10036 was 10036, checked in by ogrimm, 12 years ago
First version of FADctrl
File size: 2.0 KB
Line 
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//
30// Other definitions
31//
32#define MAX_ADDR 0xFF // highest address in Config-RAM
33#define BADDR_ROI 0x00 // Baseaddress ROI-Values
34#define BADDR_DAC 0x24 // Baseaddress DAC-Values
35#define MAX_VAL 65535
36#define MAX_ROIVAL 1024
37#define MAX_DACVAL 65535
38
39const unsigned int NChannels = 9;
40const unsigned int NBins = 1024;
41const unsigned int NChips = 4;
42const unsigned int NTemp = 4;
43const unsigned int NDAC = 8;
44
45//
46// Data structures
47//
48typedef struct {
49 unsigned short start_package_flag;
50 unsigned short package_length;
51 unsigned short version_no;
52 unsigned long trigger_id;
53 unsigned char trigger_type;
54 unsigned char trigger_crc;
55 unsigned long local_trigger_id;
56 unsigned char local_trigger_type;
57 unsigned char local_trigger_crc;
58 unsigned short board_id;
59 short drs_temperature[NTemp];
60 unsigned short dac[NDAC];
61} __attribute__((__packed__)) PEVNT_HEADER;
62
63typedef struct {
64 unsigned short id;
65 unsigned short start_cell;
66 unsigned short roi;
67 unsigned short adc_data[];
68} __attribute__((__packed__)) PCHANNEL;
69
70typedef struct {
71 unsigned short package_crc;
72 unsigned short end_package_flag;
73} __attribute__((__packed__)) PEVNT_FOOTER;
74
75#endif
Note: See TracBrowser for help on using the repository browser.