4 Header for ni_labpc.c and ni_labpc_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.
22 #define EEPROM_SIZE 256 /* 256 byte eeprom */
23 #define NUM_AO_CHAN 2 /* boards have two analog output channels */
25 enum transfer_type
{ fifo_not_empty_transfer
, fifo_half_full_transfer
,
29 struct labpc_boardinfo
{
31 int ai_speed
; /* maximum input speed in ns */
32 unsigned ai_scan_up
:1; /* can auto scan up in ai channels */
33 unsigned has_ao
:1; /* has analog outputs */
34 unsigned is_labpc1200
:1; /* has extra regs compared to pc+ */
37 struct labpc_private
{
38 /* number of data points left to be taken */
39 unsigned long long count
;
40 /* software copy of analog output values */
41 unsigned int ao_value
[NUM_AO_CHAN
];
42 /* software copys of bits written to command registers */
49 /* store last read of board status registers */
53 * value to load into board's counter a0 (conversion pacing) for timed
56 unsigned int divisor_a0
;
58 * value to load into board's counter b0 (master) for timed conversions
60 unsigned int divisor_b0
;
62 * value to load into board's counter b1 (scan pacing) for timed
65 unsigned int divisor_b1
;
66 unsigned int dma_chan
; /* dma channel to use */
67 u16
*dma_buffer
; /* buffer ai will dma into */
69 /* transfer size in bytes for current transfer */
70 unsigned int dma_transfer_size
;
71 /* we are using dma/fifo-half-full/etc. */
72 enum transfer_type current_transfer
;
73 /* stores contents of board's eeprom */
74 unsigned int eeprom_data
[EEPROM_SIZE
];
75 /* stores settings of calibration dacs */
76 unsigned int caldac
[16];
78 * function pointers so we can use inb/outb or readb/writeb as
81 unsigned int (*read_byte
)(struct comedi_device
*, unsigned long reg
);
82 void (*write_byte
)(struct comedi_device
*,
83 unsigned int byte
, unsigned long reg
);
86 int labpc_common_attach(struct comedi_device
*dev
,
87 unsigned int irq
, unsigned long isr_flags
);
89 #endif /* _NI_LABPC_H */