2 * Copyright (C) 2004,2005 ADDI-DATA GmbH for the source code of this module.
7 * Tel: +19(0)7223/9493-0
8 * Fax: +49(0)7223/9493-92
9 * http://www.addi-data-com
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the Free
14 * Software Foundation; either version 2 of the License, or (at your option)
18 /* Card Specific information */
19 #define APCI035_BOARD_VENDOR_ID 0x15B8
20 #define APCI035_ADDRESS_RANGE 255
22 /* ANALOG INPUT RANGE */
23 static struct comedi_lrange range_apci035_ai = { 8, {
35 /* Timer / Watchdog Related Defines */
36 #define APCI035_TCW_SYNC_ENABLEDISABLE 0
37 #define APCI035_TCW_RELOAD_VALUE 4
38 #define APCI035_TCW_TIMEBASE 8
39 #define APCI035_TCW_PROG 12
40 #define APCI035_TCW_TRIG_STATUS 16
41 #define APCI035_TCW_IRQ 20
42 #define APCI035_TCW_WARN_TIMEVAL 24
43 #define APCI035_TCW_WARN_TIMEBASE 28
45 #define ADDIDATA_TIMER 0
46 /* #define ADDIDATA_WATCHDOG 1 */
49 #define APCI035_TW2 32
50 #define APCI035_TW3 64
51 #define APCI035_TW4 96
53 #define APCI035_AI_OFFSET 0
54 #define APCI035_TEMP 128
55 #define APCI035_ALR_SEQ 4
56 #define APCI035_START_STOP_INDEX 8
57 #define APCI035_ALR_START_STOP 12
58 #define APCI035_ALR_IRQ 16
59 #define APCI035_EOS 20
60 #define APCI035_CHAN_NO 24
61 #define APCI035_CHAN_VAL 28
62 #define APCI035_CONV_TIME_TIME_BASE 36
63 #define APCI035_RELOAD_CONV_TIME_VAL 32
64 #define APCI035_DELAY_TIME_TIME_BASE 44
65 #define APCI035_RELOAD_DELAY_TIME_VAL 40
66 #define ENABLE_EXT_TRIG 1
67 #define ENABLE_EXT_GATE 2
68 #define ENABLE_EXT_TRIG_GATE 3
70 #define ANALOG_INPUT 0
74 #define ADDIDATA_GREATER_THAN_TEST 0
75 #define ADDIDATA_LESS_THAN_TEST 1
77 #define APCI035_MAXVOLT 2.5
79 #define ADDIDATA_UNIPOLAR 1
80 #define ADDIDATA_BIPOLAR 2
82 /* ADDIDATA Enable Disable */
83 #define ADDIDATA_ENABLE 1
84 #define ADDIDATA_DISABLE 0
86 /* Hardware Layer functions for Apci035 */
89 /* timer value is passed as u seconds */
90 int i_APCI035_ConfigTimerWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
91 struct comedi_insn *insn, unsigned int *data);
92 int i_APCI035_StartStopWriteTimerWatchdog(struct comedi_device *dev,
93 struct comedi_subdevice *s,
94 struct comedi_insn *insn, unsigned int *data);
95 int i_APCI035_ReadTimerWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
96 struct comedi_insn *insn, unsigned int *data);
98 /* Temperature Related Defines (Analog Input Subdevice) */
100 int i_APCI035_ConfigAnalogInput(struct comedi_device *dev, struct comedi_subdevice *s,
101 struct comedi_insn *insn, unsigned int *data);
102 int i_APCI035_ReadAnalogInput(struct comedi_device *dev, struct comedi_subdevice *s,
103 struct comedi_insn *insn, unsigned int *data);
106 static void v_APCI035_Interrupt(int irq, void *d);
108 /* Reset functions */
109 int i_APCI035_Reset(struct comedi_device *dev);