hwdrv_apci16xx.h revision c995fe9475e062bab6f5a45ed28cd2d3d955ef43
1/**
2@verbatim
3
4Copyright (C) 2004,2005  ADDI-DATA GmbH for the source code of this module.
5
6        ADDI-DATA GmbH
7        Dieselstrasse 3
8        D-77833 Ottersweier
9        Tel: +19(0)7223/9493-0
10        Fax: +49(0)7223/9493-92
11        http://www.addi-data-com
12        info@addi-data.com
13
14This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
15
16This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
20You shoud also find the complete GPL in the COPYING file accompanying this source code.
21
22@endverbatim
23*/
24
25#ifndef COMEDI_SUBD_TTLIO
26#define COMEDI_SUBD_TTLIO   11	/* Digital Input Output But TTL */
27#endif
28
29#ifndef ADDIDATA_ENABLE
30#define ADDIDATA_ENABLE  1
31#define ADDIDATA_DISABLE 0
32#endif
33
34#define APCI16XX_TTL_INIT           0
35#define APCI16XX_TTL_INITDIRECTION  1
36#define APCI16XX_TTL_OUTPUTMEMORY   2
37
38#define APCI16XX_TTL_READCHANNEL            0
39#define APCI16XX_TTL_READPORT               1
40
41#define APCI16XX_TTL_WRITECHANNEL_ON        0
42#define APCI16XX_TTL_WRITECHANNEL_OFF       1
43#define APCI16XX_TTL_WRITEPORT_ON           2
44#define APCI16XX_TTL_WRITEPORT_OFF          3
45
46#define APCI16XX_TTL_READ_ALL_INPUTS        0
47#define APCI16XX_TTL_READ_ALL_OUTPUTS       1
48
49#ifdef __KERNEL__
50
51static const comedi_lrange range_apci16xx_ttl = { 12,
52	{BIP_RANGE(1),
53			BIP_RANGE(1),
54			BIP_RANGE(1),
55			BIP_RANGE(1),
56			BIP_RANGE(1),
57			BIP_RANGE(1),
58			BIP_RANGE(1),
59			BIP_RANGE(1),
60			BIP_RANGE(1),
61			BIP_RANGE(1),
62			BIP_RANGE(1),
63		BIP_RANGE(1)}
64};
65
66/*
67+----------------------------------------------------------------------------+
68|                       TTL INISIALISATION FUNCTION                          |
69+----------------------------------------------------------------------------+
70*/
71
72int i_APCI16XX_InsnConfigInitTTLIO(comedi_device * dev,
73	comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
74
75/*
76+----------------------------------------------------------------------------+
77|                       TTL INPUT FUNCTION                                   |
78+----------------------------------------------------------------------------+
79*/
80
81int i_APCI16XX_InsnBitsReadTTLIO(comedi_device * dev,
82	comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
83
84int i_APCI16XX_InsnReadTTLIOAllPortValue(comedi_device * dev,
85	comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
86
87/*
88+----------------------------------------------------------------------------+
89|                            TTL OUTPUT FUNCTIONS                            |
90+----------------------------------------------------------------------------+
91*/
92
93int i_APCI16XX_InsnBitsWriteTTLIO(comedi_device * dev,
94	comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
95
96int i_APCI16XX_Reset(comedi_device * dev);
97#endif
98