4 Header for das08.c and das08_cs.c
6 Copyright (C) 2003 Frank Mori Hess <fmhess@users.sourceforge.net>
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.
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.
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.
27 enum das08_bustype
{ isa
, pci
, pcmcia
, pc104
};
28 /* different ways ai data is encoded in first two registers */
29 enum das08_ai_encoding
{ das08_encode12
, das08_encode16
, das08_pcm_encode12
};
30 enum das08_lrange
{ das08_pg_none
, das08_bipolar5
, das08_pgh
, das08_pgl
,
34 struct das08_board_struct
{
36 unsigned int id
; /* id for pci/pcmcia boards */
37 enum das08_bustype bustype
;
39 unsigned int ai_nbits
;
40 enum das08_lrange ai_pg
;
41 enum das08_ai_encoding ai_encoding
;
43 unsigned int ao_nbits
;
46 unsigned int do_nchan
;
47 unsigned int i8255_offset
;
48 unsigned int i8254_offset
;
49 unsigned int iosize
; /* number of ioports used */
53 int channels
; /* available channels. Some could be used internally. */
54 int logic2phys
[3]; /* to know which physical channel is. */
55 int mode
[3]; /* the index is the real counter. */
64 struct das08_private_struct
{
65 unsigned int do_mux_bits
; /* bits for do/mux register on boards without separate do register */
66 unsigned int do_bits
; /* bits for do register on boards with register dedicated to digital out only */
67 const unsigned int *pg_gainlist
;
68 struct pci_dev
*pdev
; /* struct for pci-das08 */
69 unsigned int pci_iobase
; /* additional base address for pci-das08 */
70 struct i8254_struct i8254
;
73 #define NUM_DAS08_CS_BOARDS 2
74 extern struct das08_board_struct das08_cs_boards
[NUM_DAS08_CS_BOARDS
];
76 int das08_common_attach(struct comedi_device
*dev
, unsigned long iobase
);
77 int das08_common_detach(struct comedi_device
*dev
);