Commit | Line | Data |
---|---|---|
15d8826a GKH |
1 | /* |
2 | * Copyright (C) 2004,2005 ADDI-DATA GmbH for the source code of this module. | |
3 | * | |
4 | * ADDI-DATA GmbH | |
5 | * Dieselstrasse 3 | |
6 | * D-77833 Ottersweier | |
7 | * Tel: +19(0)7223/9493-0 | |
8 | * Fax: +49(0)7223/9493-92 | |
9 | * http://www.addi-data-com | |
10 | * info@addi-data.com | |
11 | * | |
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) | |
15 | * any later version. | |
16 | */ | |
17 | ||
18 | /* Card Specific information */ | |
19 | #define APCI035_BOARD_VENDOR_ID 0x15B8 | |
20 | #define APCI035_ADDRESS_RANGE 255 | |
c995fe94 ADG |
21 | |
22 | INT i_TW_Number; | |
23 | struct { | |
24 | INT i_Gain; | |
25 | INT i_Polarity; | |
26 | INT i_OffsetRange; | |
27 | INT i_Coupling; | |
28 | INT i_SingleDiff; | |
29 | INT i_AutoCalibration; | |
30 | UINT ui_ReloadValue; | |
31 | UINT ui_TimeUnitReloadVal; | |
32 | INT i_Interrupt; | |
33 | INT i_ModuleSelection; | |
34 | } Config_Parameters_Main; | |
35 | ||
15d8826a | 36 | /* ANALOG INPUT RANGE */ |
9ced1de6 | 37 | struct comedi_lrange range_apci035_ai = { 8, { |
15d8826a GKH |
38 | BIP_RANGE(10), |
39 | BIP_RANGE(5), | |
40 | BIP_RANGE(2), | |
41 | BIP_RANGE(1), | |
42 | UNI_RANGE(10), | |
43 | UNI_RANGE(5), | |
44 | UNI_RANGE(2), | |
45 | UNI_RANGE(1) | |
46 | } | |
c995fe94 ADG |
47 | }; |
48 | ||
15d8826a GKH |
49 | /* Timer / Watchdog Related Defines */ |
50 | #define APCI035_TCW_SYNC_ENABLEDISABLE 0 | |
51 | #define APCI035_TCW_RELOAD_VALUE 4 | |
52 | #define APCI035_TCW_TIMEBASE 8 | |
53 | #define APCI035_TCW_PROG 12 | |
54 | #define APCI035_TCW_TRIG_STATUS 16 | |
55 | #define APCI035_TCW_IRQ 20 | |
56 | #define APCI035_TCW_WARN_TIMEVAL 24 | |
57 | #define APCI035_TCW_WARN_TIMEBASE 28 | |
c995fe94 | 58 | |
15d8826a GKH |
59 | #define ADDIDATA_TIMER 0 |
60 | /* #define ADDIDATA_WATCHDOG 1 */ | |
c995fe94 ADG |
61 | |
62 | #define APCI035_TW1 0 | |
63 | #define APCI035_TW2 32 | |
64 | #define APCI035_TW3 64 | |
65 | #define APCI035_TW4 96 | |
66 | ||
67 | #define APCI035_AI_OFFSET 0 | |
68 | #define APCI035_TEMP 128 | |
69 | #define APCI035_ALR_SEQ 4 | |
70 | #define APCI035_START_STOP_INDEX 8 | |
71 | #define APCI035_ALR_START_STOP 12 | |
72 | #define APCI035_ALR_IRQ 16 | |
73 | #define APCI035_EOS 20 | |
74 | #define APCI035_CHAN_NO 24 | |
75 | #define APCI035_CHAN_VAL 28 | |
15d8826a GKH |
76 | #define APCI035_CONV_TIME_TIME_BASE 36 |
77 | #define APCI035_RELOAD_CONV_TIME_VAL 32 | |
78 | #define APCI035_DELAY_TIME_TIME_BASE 44 | |
79 | #define APCI035_RELOAD_DELAY_TIME_VAL 40 | |
80 | #define ENABLE_EXT_TRIG 1 | |
81 | #define ENABLE_EXT_GATE 2 | |
82 | #define ENABLE_EXT_TRIG_GATE 3 | |
c995fe94 | 83 | |
15d8826a GKH |
84 | #define ANALOG_INPUT 0 |
85 | #define TEMPERATURE 1 | |
86 | #define RESISTANCE 2 | |
c995fe94 | 87 | |
15d8826a GKH |
88 | #define ADDIDATA_GREATER_THAN_TEST 0 |
89 | #define ADDIDATA_LESS_THAN_TEST 1 | |
c995fe94 ADG |
90 | |
91 | #define APCI035_MAXVOLT 2.5 | |
92 | ||
93 | #define ADDIDATA_UNIPOLAR 1 | |
94 | #define ADDIDATA_BIPOLAR 2 | |
95 | ||
15d8826a GKH |
96 | /* ADDIDATA Enable Disable */ |
97 | #define ADDIDATA_ENABLE 1 | |
98 | #define ADDIDATA_DISABLE 0 | |
c995fe94 | 99 | |
15d8826a | 100 | /* Hardware Layer functions for Apci035 */ |
c995fe94 | 101 | |
15d8826a GKH |
102 | /* TIMER */ |
103 | /* timer value is passed as u seconds */ | |
34c43922 | 104 | INT i_APCI035_ConfigTimerWatchdog(struct comedi_device *dev, struct comedi_subdevice *s, |
790c5541 | 105 | comedi_insn *insn, unsigned int *data); |
71b5f4f1 | 106 | INT i_APCI035_StartStopWriteTimerWatchdog(struct comedi_device *dev, |
34c43922 | 107 | struct comedi_subdevice *s, |
790c5541 | 108 | comedi_insn *insn, unsigned int *data); |
34c43922 | 109 | INT i_APCI035_ReadTimerWatchdog(struct comedi_device *dev, struct comedi_subdevice *s, |
790c5541 | 110 | comedi_insn *insn, unsigned int *data); |
c995fe94 | 111 | |
15d8826a | 112 | /* Temperature Related Defines (Analog Input Subdevice) */ |
c995fe94 | 113 | |
34c43922 | 114 | INT i_APCI035_ConfigAnalogInput(struct comedi_device *dev, struct comedi_subdevice *s, |
790c5541 | 115 | comedi_insn *insn, unsigned int *data); |
34c43922 | 116 | INT i_APCI035_ReadAnalogInput(struct comedi_device *dev, struct comedi_subdevice *s, |
790c5541 | 117 | comedi_insn *insn, unsigned int *data); |
c995fe94 | 118 | |
15d8826a | 119 | /* Interrupt */ |
c995fe94 ADG |
120 | static void v_APCI035_Interrupt(int irq, void *d); |
121 | ||
15d8826a | 122 | /* Reset functions */ |
71b5f4f1 | 123 | INT i_APCI035_Reset(struct comedi_device *dev); |