2 include/comedilib_scxi.h
3 header file for the comedi scxi library routines
5 Copyright (C) 2004 Caleb Tennis
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #ifndef _COMEDILIB_SCXI_H
24 #define _COMEDILIB_SCXI_H
26 #include <comedilib.h>
28 #define SLOT0_INTERVAL 1200
29 #define FAST_INTERVAL 1200
30 #define MEDIUM_INTERVAL 10000
31 #define SLOW_INTERVAL 30000
33 #define SCXI_LINE_MOSI 0
34 #define SCXI_LINE_DA 1
35 #define SCXI_LINE_SS 2
36 #define SCXI_LINE_MISO 4
38 #define SCXI_DIO_NONE 0
42 #define SCXI_AIO_NONE 0
46 #define REG_PARK 0x0FFFF
48 struct scxi_board_struct {
49 unsigned int device_id;
52 unsigned int clock_interval;
53 int dio_type, aio_type, channels, status_reg, data_reg;
54 int config_reg, eeprom_reg, gain_reg;
57 typedef struct scxi_board_struct scxi_board_t;
59 #define n_scxi_boards ((sizeof(scxi_boards)/sizeof(scxi_boards[0])))
61 struct scxi_module_struct {
64 unsigned int dio_subdev, ser_subdev;
65 unsigned int chassis, slot;
68 typedef struct scxi_module_struct scxi_mod_t;
74 void comedi_scxi_close(scxi_mod_t *mod);
75 scxi_mod_t *comedi_scxi_open(comedi_t *dev, unsigned short chassis_address, unsigned short mod_slot);
76 int comedi_scxi_register_readwrite(scxi_mod_t *mod, unsigned short reg_address, unsigned int num_bytes,
77 unsigned char *data_out, unsigned char *data_in);
83 #endif // _COMEDILIB_SCXI_H