Low-Energy Muon (LEM) Experiment  0.5.2
sis3820.h
Go to the documentation of this file.
1 /***************************************************************************/
2 /* */
3 /* Filename: sis3820.h */
4 /* */
5 /* Funktion: headerfile for SIS3820 */
6 /* */
7 /* Autor: TH */
8 /* date: 13.06.2003 */
9 /* last modification: 08.12.2003 */
10 /* */
11 /* ----------------------------------------------------------------------- */
12 /* */
13 /* SIS Struck Innovative Systeme GmbH */
14 /* */
15 /* Harksheider Str. 102A */
16 /* 22399 Hamburg */
17 /* */
18 /* Tel. +49 (0)40 60 87 305 0 */
19 /* Fax +49 (0)40 60 87 305 20 */
20 /* */
21 /* http://www.struck.de */
22 /* */
23 /* 2003 */
24 /* */
25 /***************************************************************************/
26 
27 
28 /* addresses */
29 
30 #define SIS3820_CONTROL_STATUS 0x0 /* read/write; D32 */
31 #define SIS3820_MODID 0x4 /* read only; D32 */
32 #define SIS3820_IRQ_CONFIG 0x8 /* read/write; D32 */
33 #define SIS3820_IRQ_CONTROL 0xC /* read/write; D32 */
34 
35 #define SIS3820_ACQUISITION_PRESET 0x10 /* read/write; D32 */
36 #define SIS3820_ACQUISITION_COUNT 0x14 /* read D32 */
37 
38 #define SIS3820_LNE_PRESCALE 0x18 /* read/write; D32 */
39 
40 
41 #define SIS3820_PRESET_GROUP1 0x20 /* read/write; D32 */
42 #define SIS3820_PRESET_GROUP2 0x24 /* read/write; D32 */
43 #define SIS3820_PRESET_ENABLE_HIT 0x28 /* read/write; D32 */
44 
45 #define SIS3820_CBLT_BROADCAST_SETUP 0x30 /* read/write; D32 */
46 #define SIS3820_SDRAM_PAGE 0x34 /* read/write; D32 */
47 #define SIS3820_FIFO_WORDCOUNTER 0x38 /* read; D32 */
48 #define SIS3820_FIFO_WORDCOUNT_THRESHOLD 0x3C /* read/write; D32 */
49 
50 #define SIS3820_HISCAL_START_PRESET 0x40 /* read/write; D32 */
51 #define SIS3820_HISCAL_COUNT 0x44 /* read D32 */
52 #define SIS3820_HISCAL_LAST_ACQ_COUNT 0x48 /* read D32 */
53 
54 #define SIS3820_OPERATION_MODE 0x100 /* read/write; D32 */
55 #define SIS3820_COPY_DISABLE 0x104 /* read/write; D32 */
56 #define SIS3820_LNE_CHANNEL_SELECT 0x108 /* read/write; D32 */
57 #define SIS3820_PRESET_CHANNEL_SELECT 0x10C /* read/write; D32 */
58 
59 #define SIS3820_COUNTER_INHIBIT 0x200 /* read/write; D32 */
60 #define SIS3820_COUNTER_CLEAR 0x204 /* write only; D32 */
61 #define SIS3820_COUNTER_OVERFLOW 0x208 /* read/write; D32 */
62 
63 #define SIS3820_SDRAM_EEPROM_CTRL_STAT 0x300 /* read/write; D32 */
64 
65 #define SIS3820_JTAG_TEST 0x310
66 #define SIS3820_JTAG_CONTROL 0x314
67 #define SIS3820_JTAG_DATA_IN 0x310
68 
69 #define SIS3820_KEY_RESET 0x400
70 #define SIS3820_KEY_SDRAM_FIFO_RESET 0x404
71 #define SIS3820_KEY_TEST_PULS 0x408
72 #define SIS3820_KEY_COUNTER_CLEAR 0x40C
73 
74 #define SIS3820_KEY_LNE_PULS 0x410
75 #define SIS3820_KEY_OPERATION_ARM 0x414
76 #define SIS3820_KEY_OPERATION_ENABLE 0x418
77 #define SIS3820_KEY_OPERATION_DISABLE 0x41C
78 
79 #define SIS3820_KEY_HISCAL_START_PULS 0x420
80 #define SIS3820_KEY_HISCAL_ENABLE_LNE_ARM 0x424
81 #define SIS3820_KEY_HISCAL_ENABLE_LNE_ENABLE 0x428
82 #define SIS3820_KEY_HISCAL_DISABLE 0x42C
83 
84 #define SIS3820_COUNTER_SHADOW_CH1 0x800
85 #define SIS3820_COUNTER_CH1 0xA00
86 
87 #define SIS3820_FIFO_BASE 0x800000
88 #define SIS3820_SDRAM_BASE 0x800000
89 
90 /* version and default values */
91 #define SIS3820_ACTUAL_VERSION 0x38200101
92 #define SIS3820_ACTUAL_VERSION_38200102 0x38200102
93 
94 /* bit definitions */
95 #define SIS3820_IRQ_SOURCE0_ENABLE 0x1
96 #define SIS3820_IRQ_SOURCE1_ENABLE 0x2
97 #define SIS3820_IRQ_SOURCE2_ENABLE 0x4
98 #define SIS3820_IRQ_SOURCE3_ENABLE 0x8
99 #define SIS3820_IRQ_SOURCE4_ENABLE 0x10
100 #define SIS3820_IRQ_SOURCE5_ENABLE 0x20
101 #define SIS3820_IRQ_SOURCE6_ENABLE 0x40
102 #define SIS3820_IRQ_SOURCE7_ENABLE 0x80
103 
104 #define SIS3820_IRQ_SOURCE0_DISABLE 0x100
105 #define SIS3820_IRQ_SOURCE1_DISABLE 0x200
106 #define SIS3820_IRQ_SOURCE2_DISABLE 0x400
107 #define SIS3820_IRQ_SOURCE3_DISABLE 0x800
108 #define SIS3820_IRQ_SOURCE4_DISABLE 0x1000
109 #define SIS3820_IRQ_SOURCE5_DISABLE 0x2000
110 #define SIS3820_IRQ_SOURCE6_DISABLE 0x4000
111 #define SIS3820_IRQ_SOURCE7_DISABLE 0x8000
112 
113 #define SIS3820_IRQ_SOURCE0_CLEAR 0x10000
114 #define SIS3820_IRQ_SOURCE1_CLEAR 0x20000
115 #define SIS3820_IRQ_SOURCE2_CLEAR 0x40000
116 #define SIS3820_IRQ_SOURCE3_CLEAR 0x80000
117 #define SIS3820_IRQ_SOURCE4_CLEAR 0x100000
118 #define SIS3820_IRQ_SOURCE5_CLEAR 0x200000
119 #define SIS3820_IRQ_SOURCE6_CLEAR 0x400000
120 #define SIS3820_IRQ_SOURCE7_CLEAR 0x800000
121 
122 #define SIS3820_IRQ_SOURCE0_FLAG 0x1000000
123 #define SIS3820_IRQ_SOURCE1_FLAG 0x2000000
124 #define SIS3820_IRQ_SOURCE2_FLAG 0x4000000
125 #define SIS3820_IRQ_SOURCE3_FLAG 0x8000000
126 #define SIS3820_IRQ_SOURCE4_FLAG 0x10000000
127 #define SIS3820_IRQ_SOURCE5_FLAG 0x20000000
128 #define SIS3820_IRQ_SOURCE6_FLAG 0x40000000
129 #define SIS3820_IRQ_SOURCE7_FLAG 0x80000000
130 
131 #define SIS3820_FLAG_SOURCE0 0x10000
132 #define SIS3820_FLAG_SOURCE1 0x20000
133 #define SIS3820_FLAG_SOURCE2 0x40000
134 #define SIS3820_FLAG_SOURCE3 0x80000
135 #define SIS3820_FLAG_SOURCE4 0x100000
136 #define SIS3820_FLAG_SOURCE5 0x200000
137 #define SIS3820_FLAG_SOURCE6 0x400000
138 #define SIS3820_FLAG_SOURCE7 0x800000
139 
140 /* Control register bit defintions */
141 #define CTRL_USER_LED_OFF 0x10000 /* default after Reset */
142 #define CTRL_USER_LED_ON 0x1
143 #define CTRL_COUNTER_TEST_25MHZ_DISABLE 0x100000
144 #define CTRL_COUNTER_TEST_25MHZ_ENABLE 0x10
145 #define CTRL_COUNTER_TEST_MODE_DISABLE 0x200000
146 #define CTRL_COUNTER_TEST_MODE_ENABLE 0x20
147 #define CTRL_REFERENCE_CH1_DISABLE 0x400000
148 #define CTRL_REFERENCE_CH1_ENABLE 0x40
149 
150 /* Status register bit defintions */
151 #define STAT_OPERATION_SCALER_ENABLED 0x10000
152 #define STAT_OPERATION_MCS_ENABLED 0x40000
153 #define STAT_OPERATION_VME_WRITE_ENABLED 0x800000
154 
155 /* Acqusition / Mode register bit defintions */
156 #define SIS3820_CLEARING_MODE 0x0
157 #define SIS3820_NON_CLEARING_MODE 0x1
158 #define SIS3820_MCS_DATA_FORMAT_32BIT 0x0
159 #define SIS3820_MCS_DATA_FORMAT_24BIT 0x4
160 #define SIS3820_MCS_DATA_FORMAT_16BIT 0x8
161 #define SIS3820_MCS_DATA_FORMAT_8BIT 0xC
162 #define SIS3820_SCALER_DATA_FORMAT_32BIT 0x0
163 #define SIS3820_SCALER_DATA_FORMAT_24BIT 0x4
164 #define SIS3820_LNE_SOURCE_VME 0x0
165 #define SIS3820_LNE_SOURCE_CONTROL_SIGNAL 0x10
166 #define SIS3820_LNE_SOURCE_INTERNAL_10MHZ 0x20
167 #define SIS3820_LNE_SOURCE_CHANNEL_N 0x30
168 #define SIS3820_LNE_SOURCE_PRESET 0x40
169 #define SIS3820_ARM_ENABLE_CONTROL_SIGNAL 0x000
170 #define SIS3820_ARM_ENABLE_CHANNEL_N 0x100
171 #define SIS3820_FIFO_MODE 0x0000
172 #define SIS3820_SDRAM_MODE 0x1000
173 #define SIS3820_SDRAM_ADD_MODE 0x2000
174 #define SIS3820_HISCAL_START_SOURCE_VME 0x0000
175 #define SIS3820_HISCAL_START_SOURCE_EXTERN 0x4000
176 #define SIS3820_CONTROL_INPUT_MODE0 0x00000
177 #define SIS3820_CONTROL_INPUT_MODE1 0x10000
178 #define SIS3820_CONTROL_INPUT_MODE2 0x20000
179 #define SIS3820_CONTROL_INPUT_MODE3 0x30000
180 #define SIS3820_CONTROL_INPUT_MODE4 0x40000
181 #define SIS3820_CONTROL_INPUT_MODE5 0x50000
182 #define SIS3820_CONTROL_INPUTS_INVERT 0x80000
183 #define SIS3820_CONTROL_OUTPUT_MODE0 0x000000
184 #define SIS3820_CONTROL_OUTPUT_MODE1 0x100000
185 #define SIS3820_CONTROL_OUTPUTS_INVERT 0x800000
186 #define SIS3820_OP_MODE_SCALER 0x00000000
187 #define SIS3820_OP_MODE_MULTI_CHANNEL_SCALER 0x20000000
188 #define SIS3820_OP_MODE_VME_FIFO_WRITE 0x70000000
189 
190 /* preset enable/hit register */
191 #define SIS3820_PRESET_STATUS_ENABLE_GROUP1 0x1
192 #define SIS3820_PRESET_REACHED_GROUP1 0x2
193 #define SIS3820_PRESET_LNELATCHED_REACHED_GROUP1 0x4
194 #define SIS3820_PRESET_STATUS_ENABLE_GROUP2 0x10000
195 #define SIS3820_PRESET_REACHED_GROUP2 0x20000
196 #define SIS3820_PRESET_LNELATCHED_REACHED_GROUP2 0x40000
197 
198 /* preset enable/hit register */
199 #define SIS3820_SDRAM_EEPROM_SCL 0x1
200 #define SIS3820_SDRAM_EEPROM_SDA_OUT 0x2
201 #define SIS3820_SDRAM_EEPROM_SDA_OE 0x4
202 #define SIS3820_SDRAM_EEPROM_SDA_IN 0x100
203 
204 /* readout mode */
205 
206 #define A32BLT32 1
207 #define A32MBLT64 2
208 #define A32_2eVME 3
209 
210 /* functions */
211 int sis3820_key_reset( int device, u_int32_t sis3820_base) ;
212 int sis3820_key_enable( int device, u_int32_t sis3820_base) ;
213 int sis3820_key_disable(int device, u_int32_t sis3820_base) ;
214 int sis3820_control_read(int device, u_int32_t sis3820_base, u_int32_t* control_status) ;
215 int sis3820_control_write(int device, u_int32_t sis3820_base, u_int32_t control_status) ;
216 int sis3820_modid_read(int device, u_int32_t sis3820_base, u_int32_t* modid) ;
217 int sis3820_operation_mode_read(int device, u_int32_t sis3820_base, u_int32_t* mode) ;
218 int sis3820_operation_mode_write(int device, u_int32_t sis3820_base, u_int32_t mode) ;
219 int sis3820_copy_disable_channel(int device, u_int32_t sis3820_base, u_int32_t channel_disable) ;
220 int sis3820_scaler_read(int device, u_int32_t sis3820_base, int mode, int nwords, u_int32_t* data) ;
221 
int sis3820_key_disable(int device, u_int32_t sis3820_base)
Definition: sis3820.c:84
int sis3820_key_enable(int device, u_int32_t sis3820_base)
Definition: sis3820.c:62
INT mode
scaler mode, see scaler_mode()
Definition: vme_fe.cxx:290
int sis3820_operation_mode_read(int device, u_int32_t sis3820_base, u_int32_t *mode)
Definition: sis3820.c:97
int sis3820_operation_mode_write(int device, u_int32_t sis3820_base, u_int32_t mode)
Definition: sis3820.c:165
int sis3820_control_read(int device, u_int32_t sis3820_base, u_int32_t *control_status)
Definition: sis3820.c:191
int sis3820_copy_disable_channel(int device, u_int32_t sis3820_base, u_int32_t channel_disable)
Definition: sis3820.c:253
int sis3820_key_reset(int device, u_int32_t sis3820_base)
Definition: sis3820.c:39
int sis3820_scaler_read(int device, u_int32_t sis3820_base, int mode, int nwords, u_int32_t *data)
Definition: sis3820.c:281
int sis3820_modid_read(int device, u_int32_t sis3820_base, u_int32_t *modid)
Definition: sis3820.c:178
int sis3820_control_write(int device, u_int32_t sis3820_base, u_int32_t control_status)
Definition: sis3820.c:229