Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
hwdrv_apci1500.h
Go to the documentation of this file.
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
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 /********* Definitions for APCI-1500 card *****/
19 
20 /* Card Specific information */
21 #define APCI1500_BOARD_VENDOR_ID 0x10e8
22 #define APCI1500_ADDRESS_RANGE 4
23 
24 /* DIGITAL INPUT-OUTPUT DEFINE */
25 
26 #define APCI1500_DIGITAL_OP 2
27 #define APCI1500_DIGITAL_IP 0
28 #define APCI1500_AND 2
29 #define APCI1500_OR 4
30 #define APCI1500_OR_PRIORITY 6
31 #define APCI1500_CLK_SELECT 0
32 #define COUNTER1 0
33 #define COUNTER2 1
34 #define COUNTER3 2
35 #define APCI1500_COUNTER 0x20
36 #define APCI1500_TIMER 0
37 #define APCI1500_WATCHDOG 0
38 #define APCI1500_SINGLE 0
39 #define APCI1500_CONTINUOUS 0x80
40 #define APCI1500_DISABLE 0
41 #define APCI1500_ENABLE 1
42 #define APCI1500_SOFTWARE_TRIGGER 0x4
43 #define APCI1500_HARDWARE_TRIGGER 0x10
44 #define APCI1500_SOFTWARE_GATE 0
45 #define APCI1500_HARDWARE_GATE 0x8
46 #define START 0
47 #define STOP 1
48 #define TRIGGER 2
49 
50 /*
51  * Zillog I/O enumeration
52  */
53 enum {
58 };
59 
60 /*
61  * Z8536 CIO Internal Address
62  */
63 enum {
72 
81 
98 
107 
116 };
117 
118  /*----------DIGITAL INPUT----------------*/
119 static int i_APCI1500_Initialisation(struct comedi_device *dev, struct comedi_subdevice *s,
120  struct comedi_insn *insn, unsigned int *data);
121 static int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device *dev,
122  struct comedi_subdevice *s,
123  struct comedi_insn *insn,
124  unsigned int *data);
125 
126 static int i_APCI1500_StartStopInputEvent(struct comedi_device *dev,
127  struct comedi_subdevice *s,
128  struct comedi_insn *insn, unsigned int *data);
129 static int i_APCI1500_ReadMoreDigitalInput(struct comedi_device *dev,
130  struct comedi_subdevice *s,
131  struct comedi_insn *insn, unsigned int *data);
132 
133 /*---------- DIGITAL OUTPUT------------*/
134 static int i_APCI1500_ConfigDigitalOutputErrorInterrupt(struct comedi_device *dev,
135  struct comedi_subdevice *s,
136  struct comedi_insn *insn,
137  unsigned int *data);
138 static int i_APCI1500_WriteDigitalOutput(struct comedi_device *dev,
139  struct comedi_subdevice *s,
140  struct comedi_insn *insn, unsigned int *data);
141 
142 /*----------TIMER----------------*/
143 static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev,
144  struct comedi_subdevice *s,
145  struct comedi_insn *insn,
146  unsigned int *data);
147 static int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device *dev,
148  struct comedi_subdevice *s,
149  struct comedi_insn *insn,
150  unsigned int *data);
151 static int i_APCI1500_ReadCounterTimerWatchdog(struct comedi_device *dev,
152  struct comedi_subdevice *s,
153  struct comedi_insn *insn,
154  unsigned int *data);
155 static int i_APCI1500_ReadInterruptMask(struct comedi_device *dev,
156  struct comedi_subdevice *s,
157  struct comedi_insn *insn, unsigned int *data);
158 
159 /*----------INTERRUPT HANDLER------*/
160 static void v_APCI1500_Interrupt(int irq, void *d);
161 static int i_APCI1500_ConfigureInterrupt(struct comedi_device *dev,
162  struct comedi_subdevice *s,
163  struct comedi_insn *insn, unsigned int *data);
164 /*----------RESET---------------*/
165 static int i_APCI1500_Reset(struct comedi_device *dev);