]> git.karo-electronics.de Git - karo-tx-linux.git/blob - drivers/staging/comedi/drivers/rtd520.h
Merge tag 'late-omap' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[karo-tx-linux.git] / drivers / staging / comedi / drivers / rtd520.h
1 /*
2     comedi/drivers/rtd520.h
3     Comedi driver defines for Real Time Devices (RTD) PCI4520/DM7520
4
5     COMEDI - Linux Control and Measurement Device Interface
6     Copyright (C) 2001 David A. Schleef <ds@schleef.org>
7
8     This program is free software; you can redistribute it and/or modify
9     it under the terms of the GNU General Public License as published by
10     the Free Software Foundation; either version 2 of the License, or
11     (at your option) any later version.
12
13     This program is distributed in the hope that it will be useful,
14     but WITHOUT ANY WARRANTY; without even the implied warranty of
15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16     GNU General Public License for more details.
17
18     You should have received a copy of the GNU General Public License
19     along with this program; if not, write to the Free Software
20     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23 /*
24     Created by Dan Christian, NASA Ames Research Center.
25     See board notes in rtd520.c
26 */
27
28 /*
29  * Local Address Space 0 Offsets
30  */
31 #define LAS0_USER_IO            0x0008  /* User I/O */
32 #define LAS0_ADC                0x0010  /* FIFO Status/Software A/D Start */
33 #define LAS0_DAC1               0x0014  /* Software D/A1 Update (w) */
34 #define LAS0_DAC2               0x0018  /* Software D/A2 Update (w) */
35 #define LAS0_DAC                0x0024  /* Software Simultaneous Update (w) */
36 #define LAS0_PACER              0x0028  /* Software Pacer Start/Stop */
37 #define LAS0_TIMER              0x002c  /* Timer Status/HDIN Software Trig. */
38 #define LAS0_IT                 0x0030  /* Interrupt Status/Enable */
39 #define LAS0_CLEAR              0x0034  /* Clear/Set Interrupt Clear Mask */
40 #define LAS0_OVERRUN            0x0038  /* Pending interrupts/Clear Overrun */
41 #define LAS0_PCLK               0x0040  /* Pacer Clock (24bit) */
42 #define LAS0_BCLK               0x0044  /* Burst Clock (10bit) */
43 #define LAS0_ADC_SCNT           0x0048  /* A/D Sample counter (10bit) */
44 #define LAS0_DAC1_UCNT          0x004c  /* D/A1 Update counter (10 bit) */
45 #define LAS0_DAC2_UCNT          0x0050  /* D/A2 Update counter (10 bit) */
46 #define LAS0_DCNT               0x0054  /* Delay counter (16 bit) */
47 #define LAS0_ACNT               0x0058  /* About counter (16 bit) */
48 #define LAS0_DAC_CLK            0x005c  /* DAC clock (16bit) */
49 #define LAS0_UTC0               0x0060  /* 8254 TC Counter 0 */
50 #define LAS0_UTC1               0x0064  /* 8254 TC Counter 1 */
51 #define LAS0_UTC2               0x0068  /* 8254 TC Counter 2 */
52 #define LAS0_UTC_CTRL           0x006c  /* 8254 TC Control */
53 #define LAS0_DIO0               0x0070  /* Digital I/O Port 0 */
54 #define LAS0_DIO1               0x0074  /* Digital I/O Port 1 */
55 #define LAS0_DIO0_CTRL          0x0078  /* Digital I/O Control */
56 #define LAS0_DIO_STATUS         0x007c  /* Digital I/O Status */
57 #define LAS0_BOARD_RESET        0x0100  /* Board reset */
58 #define LAS0_DMA0_SRC           0x0104  /* DMA 0 Sources select */
59 #define LAS0_DMA1_SRC           0x0108  /* DMA 1 Sources select */
60 #define LAS0_ADC_CONVERSION     0x010c  /* A/D Conversion Signal select */
61 #define LAS0_BURST_START        0x0110  /* Burst Clock Start Trigger select */
62 #define LAS0_PACER_START        0x0114  /* Pacer Clock Start Trigger select */
63 #define LAS0_PACER_STOP         0x0118  /* Pacer Clock Stop Trigger select */
64 #define LAS0_ACNT_STOP_ENABLE   0x011c  /* About Counter Stop Enable */
65 #define LAS0_PACER_REPEAT       0x0120  /* Pacer Start Trigger Mode select */
66 #define LAS0_DIN_START          0x0124  /* HiSpd DI Sampling Signal select */
67 #define LAS0_DIN_FIFO_CLEAR     0x0128  /* Digital Input FIFO Clear */
68 #define LAS0_ADC_FIFO_CLEAR     0x012c  /* A/D FIFO Clear */
69 #define LAS0_CGT_WRITE          0x0130  /* Channel Gain Table Write */
70 #define LAS0_CGL_WRITE          0x0134  /* Channel Gain Latch Write */
71 #define LAS0_CG_DATA            0x0138  /* Digital Table Write */
72 #define LAS0_CGT_ENABLE         0x013c  /* Channel Gain Table Enable */
73 #define LAS0_CG_ENABLE          0x0140  /* Digital Table Enable */
74 #define LAS0_CGT_PAUSE          0x0144  /* Table Pause Enable */
75 #define LAS0_CGT_RESET          0x0148  /* Reset Channel Gain Table */
76 #define LAS0_CGT_CLEAR          0x014c  /* Clear Channel Gain Table */
77 #define LAS0_DAC1_CTRL          0x0150  /* D/A1 output type/range */
78 #define LAS0_DAC1_SRC           0x0154  /* D/A1 update source */
79 #define LAS0_DAC1_CYCLE         0x0158  /* D/A1 cycle mode */
80 #define LAS0_DAC1_RESET         0x015c  /* D/A1 FIFO reset */
81 #define LAS0_DAC1_FIFO_CLEAR    0x0160  /* D/A1 FIFO clear */
82 #define LAS0_DAC2_CTRL          0x0164  /* D/A2 output type/range */
83 #define LAS0_DAC2_SRC           0x0168  /* D/A2 update source */
84 #define LAS0_DAC2_CYCLE         0x016c  /* D/A2 cycle mode */
85 #define LAS0_DAC2_RESET         0x0170  /* D/A2 FIFO reset */
86 #define LAS0_DAC2_FIFO_CLEAR    0x0174  /* D/A2 FIFO clear */
87 #define LAS0_ADC_SCNT_SRC       0x0178  /* A/D Sample Counter Source select */
88 #define LAS0_PACER_SELECT       0x0180  /* Pacer Clock select */
89 #define LAS0_SBUS0_SRC          0x0184  /* SyncBus 0 Source select */
90 #define LAS0_SBUS0_ENABLE       0x0188  /* SyncBus 0 enable */
91 #define LAS0_SBUS1_SRC          0x018c  /* SyncBus 1 Source select */
92 #define LAS0_SBUS1_ENABLE       0x0190  /* SyncBus 1 enable */
93 #define LAS0_SBUS2_SRC          0x0198  /* SyncBus 2 Source select */
94 #define LAS0_SBUS2_ENABLE       0x019c  /* SyncBus 2 enable */
95 #define LAS0_ETRG_POLARITY      0x01a4  /* Ext. Trigger polarity select */
96 #define LAS0_EINT_POLARITY      0x01a8  /* Ext. Interrupt polarity select */
97 #define LAS0_UTC0_CLOCK         0x01ac  /* UTC0 Clock select */
98 #define LAS0_UTC0_GATE          0x01b0  /* UTC0 Gate select */
99 #define LAS0_UTC1_CLOCK         0x01b4  /* UTC1 Clock select */
100 #define LAS0_UTC1_GATE          0x01b8  /* UTC1 Gate select */
101 #define LAS0_UTC2_CLOCK         0x01bc  /* UTC2 Clock select */
102 #define LAS0_UTC2_GATE          0x01c0  /* UTC2 Gate select */
103 #define LAS0_UOUT0_SELECT       0x01c4  /* User Output 0 source select */
104 #define LAS0_UOUT1_SELECT       0x01c8  /* User Output 1 source select */
105 #define LAS0_DMA0_RESET         0x01cc  /* DMA0 Request state machine reset */
106 #define LAS0_DMA1_RESET         0x01d0  /* DMA1 Request state machine reset */
107
108 /*
109  * Local Address Space 1 Offsets
110  */
111 #define LAS1_ADC_FIFO           0x0000  /* A/D FIFO (16bit) */
112 #define LAS1_HDIO_FIFO          0x0004  /* HiSpd DI FIFO (16bit) */
113 #define LAS1_DAC1_FIFO          0x0008  /* D/A1 FIFO (16bit) */
114 #define LAS1_DAC2_FIFO          0x000c  /* D/A2 FIFO (16bit) */
115
116 /*
117  * PLX 9080 local config & runtime registers
118  */
119 #define LCFG_ITCSR              0x0068  /* Interrupt Control/Status */
120 #define LCFG_DMAMODE0           0x0080  /* DMA0 Mode */
121 #define LCFG_DMAPADR0           0x0084  /* DMA0 PCI Address */
122 #define LCFG_DMALADR0           0x0088  /* DMA0 Local Address */
123 #define LCFG_DMASIZ0            0x008c  /* DMA0 Transfer Size (Bytes) */
124 #define LCFG_DMADPR0            0x0090  /* DMA0 Descriptor Pointer */
125 #define LCFG_DMAMODE1           0x0094  /* DMA1 Mode */
126 #define LCFG_DMAPADR1           0x0098  /* DMA1 PCI Address */
127 #define LCFG_DMALADR1           0x009c  /* DMA1 Local Address */
128 #define LCFG_DMASIZ1            0x00a0  /* DMA1 Transfer Size (Bytes) */
129 #define LCFG_DMADPR1            0x00a4  /* DMA1 Descriptor Pointer */
130 #define LCFG_DMACSR0            0x00a8  /* DMA0 Command/Status */
131 #define LCFG_DMACSR1            0x00a9  /* DMA0 Command/Status */
132 #define LCFG_DMAARB             0x00ac  /* DMA Arbitration */
133 #define LCFG_DMATHR             0x00b0  /* DMA Threshold */
134
135 /*  FIFO Status Word Bits (RtdFifoStatus) */
136 #define FS_DAC1_NOT_EMPTY       (1 << 0)  /* DAC1 FIFO not empty */
137 #define FS_DAC1_HEMPTY          (1 << 1)  /* DAC1 FIFO half empty */
138 #define FS_DAC1_NOT_FULL        (1 << 2)  /* DAC1 FIFO not full */
139 #define FS_DAC2_NOT_EMPTY       (1 << 4)  /* DAC2 FIFO not empty */
140 #define FS_DAC2_HEMPTY          (1 << 5)  /* DAC2 FIFO half empty */
141 #define FS_DAC2_NOT_FULL        (1 << 6)  /* DAC2 FIFO not full */
142 #define FS_ADC_NOT_EMPTY        (1 << 8)  /* ADC FIFO not empty */
143 #define FS_ADC_HEMPTY           (1 << 9)  /* ADC FIFO half empty */
144 #define FS_ADC_NOT_FULL         (1 << 10) /* ADC FIFO not full */
145 #define FS_DIN_NOT_EMPTY        (1 << 12) /* DIN FIFO not empty */
146 #define FS_DIN_HEMPTY           (1 << 13) /* DIN FIFO half empty */
147 #define FS_DIN_NOT_FULL         (1 << 14) /* DIN FIFO not full */
148
149 /*  Timer Status Word Bits (GetTimerStatus) */
150 #define TS_PCLK_GATE            (1 << 0)  /* Pacer Clock Gate enabled */
151 #define TS_BCLK_GATE            (1 << 1)  /* Burst Clock Gate running */
152 #define TS_DCNT_GATE            (1 << 2)  /* Pacer Clock Delayed Start Trig. */
153 #define TS_ACNT_GATE            (1 << 3)  /* Pacer Clock About Trig. */
154 #define TS_PCLK_RUN             (1 << 4)  /* Pacer Clock Shutdown Flag */
155
156 /*  External Trigger polarity select */
157 /*  External Interrupt polarity select */
158 #define POL_POSITIVE         0x0        /*  positive edge */
159 #define POL_NEGATIVE         0x1        /*  negative edge */
160
161 /*  User Output Signal select (SetUout0Source, SetUout1Source) */
162 #define UOUT_ADC                0x0     /*  A/D Conversion Signal */
163 #define UOUT_DAC1               0x1     /*  D/A1 Update */
164 #define UOUT_DAC2               0x2     /*  D/A2 Update */
165 #define UOUT_SOFTWARE           0x3     /*  Software Programmable */
166
167 /*  Pacer clock select (SetPacerSource) */
168 #define PCLK_INTERNAL           1       /*  Internal Pacer Clock */
169 #define PCLK_EXTERNAL           0       /*  External Pacer Clock */
170
171 /*  A/D Sample Counter Sources (SetAdcntSource, SetupSampleCounter) */
172 #define ADC_SCNT_CGT_RESET         0x0  /*  needs restart with StartPacer */
173 #define ADC_SCNT_FIFO_WRITE        0x1
174
175 /*  A/D Conversion Signal Select (for SetConversionSelect) */
176 #define ADC_START_SOFTWARE         0x0  /*  Software A/D Start */
177 #define ADC_START_PCLK             0x1  /*  Pacer Clock (Ext. Int. see Func.509) */
178 #define ADC_START_BCLK             0x2  /*  Burst Clock */
179 #define ADC_START_DIGITAL_IT       0x3  /*  Digital Interrupt */
180 #define ADC_START_DAC1_MARKER1     0x4  /*  D/A 1 Data Marker 1 */
181 #define ADC_START_DAC2_MARKER1     0x5  /*  D/A 2 Data Marker 1 */
182 #define ADC_START_SBUS0            0x6  /*  SyncBus 0 */
183 #define ADC_START_SBUS1            0x7  /*  SyncBus 1 */
184 #define ADC_START_SBUS2            0x8  /*  SyncBus 2 */
185
186 /*  Burst Clock start trigger select (SetBurstStart) */
187 #define BCLK_START_SOFTWARE        0x0  /*  Software A/D Start (StartBurst) */
188 #define BCLK_START_PCLK            0x1  /*  Pacer Clock */
189 #define BCLK_START_ETRIG           0x2  /*  External Trigger */
190 #define BCLK_START_DIGITAL_IT      0x3  /*  Digital Interrupt */
191 #define BCLK_START_SBUS0           0x4  /*  SyncBus 0 */
192 #define BCLK_START_SBUS1           0x5  /*  SyncBus 1 */
193 #define BCLK_START_SBUS2           0x6  /*  SyncBus 2 */
194
195 /*  Pacer Clock start trigger select (SetPacerStart) */
196 #define PCLK_START_SOFTWARE        0x0  /*  Software Pacer Start (StartPacer) */
197 #define PCLK_START_ETRIG           0x1  /*  External trigger */
198 #define PCLK_START_DIGITAL_IT      0x2  /*  Digital interrupt */
199 #define PCLK_START_UTC2            0x3  /*  User TC 2 out */
200 #define PCLK_START_SBUS0           0x4  /*  SyncBus 0 */
201 #define PCLK_START_SBUS1           0x5  /*  SyncBus 1 */
202 #define PCLK_START_SBUS2           0x6  /*  SyncBus 2 */
203 #define PCLK_START_D_SOFTWARE      0x8  /*  Delayed Software Pacer Start */
204 #define PCLK_START_D_ETRIG         0x9  /*  Delayed external trigger */
205 #define PCLK_START_D_DIGITAL_IT    0xA  /*  Delayed digital interrupt */
206 #define PCLK_START_D_UTC2          0xB  /*  Delayed User TC 2 out */
207 #define PCLK_START_D_SBUS0         0xC  /*  Delayed SyncBus 0 */
208 #define PCLK_START_D_SBUS1         0xD  /*  Delayed SyncBus 1 */
209 #define PCLK_START_D_SBUS2         0xE  /*  Delayed SyncBus 2 */
210 #define PCLK_START_ETRIG_GATED     0xF  /*  External Trigger Gated controlled mode */
211
212 /*  Pacer Clock Stop Trigger select (SetPacerStop) */
213 #define PCLK_STOP_SOFTWARE         0x0  /*  Software Pacer Stop (StopPacer) */
214 #define PCLK_STOP_ETRIG            0x1  /*  External Trigger */
215 #define PCLK_STOP_DIGITAL_IT       0x2  /*  Digital Interrupt */
216 #define PCLK_STOP_ACNT             0x3  /*  About Counter */
217 #define PCLK_STOP_UTC2             0x4  /*  User TC2 out */
218 #define PCLK_STOP_SBUS0            0x5  /*  SyncBus 0 */
219 #define PCLK_STOP_SBUS1            0x6  /*  SyncBus 1 */
220 #define PCLK_STOP_SBUS2            0x7  /*  SyncBus 2 */
221 #define PCLK_STOP_A_SOFTWARE       0x8  /*  About Software Pacer Stop */
222 #define PCLK_STOP_A_ETRIG          0x9  /*  About External Trigger */
223 #define PCLK_STOP_A_DIGITAL_IT     0xA  /*  About Digital Interrupt */
224 #define PCLK_STOP_A_UTC2           0xC  /*  About User TC2 out */
225 #define PCLK_STOP_A_SBUS0          0xD  /*  About SyncBus 0 */
226 #define PCLK_STOP_A_SBUS1          0xE  /*  About SyncBus 1 */
227 #define PCLK_STOP_A_SBUS2          0xF  /*  About SyncBus 2 */
228
229 /*  About Counter Stop Enable */
230 #define ACNT_STOP                  0x0  /*  stop enable */
231 #define ACNT_NO_STOP               0x1  /*  stop disabled */
232
233 /*  DAC update source (SetDAC1Start & SetDAC2Start) */
234 #define DAC_START_SOFTWARE         0x0  /*  Software Update */
235 #define DAC_START_CGT              0x1  /*  CGT controlled Update */
236 #define DAC_START_DAC_CLK          0x2  /*  D/A Clock */
237 #define DAC_START_EPCLK            0x3  /*  External Pacer Clock */
238 #define DAC_START_SBUS0            0x4  /*  SyncBus 0 */
239 #define DAC_START_SBUS1            0x5  /*  SyncBus 1 */
240 #define DAC_START_SBUS2            0x6  /*  SyncBus 2 */
241
242 /*  DAC Cycle Mode (SetDAC1Cycle, SetDAC2Cycle, SetupDAC) */
243 #define DAC_CYCLE_SINGLE           0x0  /*  not cycle */
244 #define DAC_CYCLE_MULTI            0x1  /*  cycle */
245
246 /*  8254 Operation Modes (Set8254Mode, SetupTimerCounter) */
247 #define M8254_EVENT_COUNTER        0    /*  Event Counter */
248 #define M8254_HW_ONE_SHOT          1    /*  Hardware-Retriggerable One-Shot */
249 #define M8254_RATE_GENERATOR       2    /*  Rate Generator */
250 #define M8254_SQUARE_WAVE          3    /*  Square Wave Mode */
251 #define M8254_SW_STROBE            4    /*  Software Triggered Strobe */
252 #define M8254_HW_STROBE            5    /*  Hardware Triggered Strobe (Retriggerable) */
253
254 /*  User Timer/Counter 0 Clock Select (SetUtc0Clock) */
255 #define CUTC0_8MHZ                 0x0  /*  8MHz */
256 #define CUTC0_EXT_TC_CLOCK1        0x1  /*  Ext. TC Clock 1 */
257 #define CUTC0_EXT_TC_CLOCK2        0x2  /*  Ext. TC Clock 2 */
258 #define CUTC0_EXT_PCLK             0x3  /*  Ext. Pacer Clock */
259
260 /*  User Timer/Counter 1 Clock Select (SetUtc1Clock) */
261 #define CUTC1_8MHZ                 0x0  /*  8MHz */
262 #define CUTC1_EXT_TC_CLOCK1        0x1  /*  Ext. TC Clock 1 */
263 #define CUTC1_EXT_TC_CLOCK2        0x2  /*  Ext. TC Clock 2 */
264 #define CUTC1_EXT_PCLK             0x3  /*  Ext. Pacer Clock */
265 #define CUTC1_UTC0_OUT             0x4  /*  User Timer/Counter 0 out */
266 #define CUTC1_DIN_SIGNAL           0x5  /*  High-Speed Digital Input   Sampling signal */
267
268 /*  User Timer/Counter 2 Clock Select (SetUtc2Clock) */
269 #define CUTC2_8MHZ                 0x0  /*  8MHz */
270 #define CUTC2_EXT_TC_CLOCK1        0x1  /*  Ext. TC Clock 1 */
271 #define CUTC2_EXT_TC_CLOCK2        0x2  /*  Ext. TC Clock 2 */
272 #define CUTC2_EXT_PCLK             0x3  /*  Ext. Pacer Clock */
273 #define CUTC2_UTC1_OUT             0x4  /*  User Timer/Counter 1 out */
274
275 /*  User Timer/Counter 0 Gate Select (SetUtc0Gate) */
276 #define GUTC0_NOT_GATED            0x0  /*  Not gated */
277 #define GUTC0_GATED                0x1  /*  Gated */
278 #define GUTC0_EXT_TC_GATE1         0x2  /*  Ext. TC Gate 1 */
279 #define GUTC0_EXT_TC_GATE2         0x3  /*  Ext. TC Gate 2 */
280
281 /*  User Timer/Counter 1 Gate Select (SetUtc1Gate) */
282 #define GUTC1_NOT_GATED            0x0  /*  Not gated */
283 #define GUTC1_GATED                0x1  /*  Gated */
284 #define GUTC1_EXT_TC_GATE1         0x2  /*  Ext. TC Gate 1 */
285 #define GUTC1_EXT_TC_GATE2         0x3  /*  Ext. TC Gate 2 */
286 #define GUTC1_UTC0_OUT             0x4  /*  User Timer/Counter 0 out */
287
288 /*  User Timer/Counter 2 Gate Select (SetUtc2Gate) */
289 #define GUTC2_NOT_GATED            0x0  /*  Not gated */
290 #define GUTC2_GATED                0x1  /*  Gated */
291 #define GUTC2_EXT_TC_GATE1         0x2  /*  Ext. TC Gate 1 */
292 #define GUTC2_EXT_TC_GATE2         0x3  /*  Ext. TC Gate 2 */
293 #define GUTC2_UTC1_OUT             0x4  /*  User Timer/Counter 1 out */
294
295 /*  Interrupt Source Masks (SetITMask, ClearITMask, GetITStatus) */
296 #define IRQM_ADC_FIFO_WRITE        0x0001       /*  ADC FIFO Write */
297 #define IRQM_CGT_RESET             0x0002       /*  Reset CGT */
298 #define IRQM_CGT_PAUSE             0x0008       /*  Pause CGT */
299 #define IRQM_ADC_ABOUT_CNT         0x0010       /*  About Counter out */
300 #define IRQM_ADC_DELAY_CNT         0x0020       /*  Delay Counter out */
301 #define IRQM_ADC_SAMPLE_CNT        0x0040       /*  ADC Sample Counter */
302 #define IRQM_DAC1_UCNT             0x0080       /*  DAC1 Update Counter */
303 #define IRQM_DAC2_UCNT             0x0100       /*  DAC2 Update Counter */
304 #define IRQM_UTC1                  0x0200       /*  User TC1 out */
305 #define IRQM_UTC1_INV              0x0400       /*  User TC1 out, inverted */
306 #define IRQM_UTC2                  0x0800       /*  User TC2 out */
307 #define IRQM_DIGITAL_IT            0x1000       /*  Digital Interrupt */
308 #define IRQM_EXTERNAL_IT           0x2000       /*  External Interrupt */
309 #define IRQM_ETRIG_RISING          0x4000       /*  External Trigger rising-edge */
310 #define IRQM_ETRIG_FALLING         0x8000       /*  External Trigger falling-edge */
311
312 /*  DMA Request Sources (LAS0) */
313 #define DMAS_DISABLED              0x0  /*  DMA Disabled */
314 #define DMAS_ADC_SCNT              0x1  /*  ADC Sample Counter */
315 #define DMAS_DAC1_UCNT             0x2  /*  D/A1 Update Counter */
316 #define DMAS_DAC2_UCNT             0x3  /*  D/A2 Update Counter */
317 #define DMAS_UTC1                  0x4  /*  User TC1 out */
318 #define DMAS_ADFIFO_HALF_FULL      0x8  /*  A/D FIFO half full */
319 #define DMAS_DAC1_FIFO_HALF_EMPTY  0x9  /*  D/A1 FIFO half empty */
320 #define DMAS_DAC2_FIFO_HALF_EMPTY  0xA  /*  D/A2 FIFO half empty */
321
322 /*  DMA Local Addresses   (0x40000000+LAS1 offset) */
323 #define DMALADDR_ADC       0x40000000   /*  A/D FIFO */
324 #define DMALADDR_HDIN      0x40000004   /*  High Speed Digital Input FIFO */
325 #define DMALADDR_DAC1      0x40000008   /*  D/A1 FIFO */
326 #define DMALADDR_DAC2      0x4000000C   /*  D/A2 FIFO */
327
328 /*  Port 0 compare modes (SetDIO0CompareMode) */
329 #define DIO_MODE_EVENT     0    /*  Event Mode */
330 #define DIO_MODE_MATCH     1    /*  Match Mode */
331
332 /*  Digital Table Enable (Port 1 disable) */
333 #define DTBL_DISABLE       0    /*  Enable Digital Table */
334 #define DTBL_ENABLE        1    /*  Disable Digital Table */
335
336 /*  Sampling Signal for High Speed Digital Input (SetHdinStart) */
337 #define HDIN_SOFTWARE      0x0  /*  Software Trigger */
338 #define HDIN_ADC           0x1  /*  A/D Conversion Signal */
339 #define HDIN_UTC0          0x2  /*  User TC out 0 */
340 #define HDIN_UTC1          0x3  /*  User TC out 1 */
341 #define HDIN_UTC2          0x4  /*  User TC out 2 */
342 #define HDIN_EPCLK         0x5  /*  External Pacer Clock */
343 #define HDIN_ETRG          0x6  /*  External Trigger */
344
345 /*  Channel Gain Table / Channel Gain Latch */
346 #define CSC_LATCH          0    /*  Channel Gain Latch mode */
347 #define CSC_CGT            1    /*  Channel Gain Table mode */
348
349 /*  Channel Gain Table Pause Enable */
350 #define CGT_PAUSE_DISABLE  0    /*  Channel Gain Table Pause Disable */
351 #define CGT_PAUSE_ENABLE   1    /*  Channel Gain Table Pause Enable */
352
353 /*  DAC output type/range (p63) */
354 #define AOUT_UNIP5         0    /*  0..+5 Volt */
355 #define AOUT_UNIP10        1    /*  0..+10 Volt */
356 #define AOUT_BIP5          2    /*  -5..+5 Volt */
357 #define AOUT_BIP10         3    /*  -10..+10 Volt */
358
359 /*  Ghannel Gain Table field definitions (p61) */
360 /*  Gain */
361 #define GAIN1              0
362 #define GAIN2              1
363 #define GAIN4              2
364 #define GAIN8              3
365 #define GAIN16             4
366 #define GAIN32             5
367 #define GAIN64             6
368 #define GAIN128            7
369
370 /*  Input range/polarity */
371 #define AIN_BIP5           0    /*  -5..+5 Volt */
372 #define AIN_BIP10          1    /*  -10..+10 Volt */
373 #define AIN_UNIP10         2    /*  0..+10 Volt */
374
375 /*  non referenced single ended select bit */
376 #define NRSE_AGND          0    /*  AGND referenced SE input */
377 #define NRSE_AINS          1    /*  AIN SENSE referenced SE input */
378
379 /*  single ended vs differential */
380 #define GND_SE          0       /*  Single-Ended */
381 #define GND_DIFF        1       /*  Differential */