comedi_board_info: Moved man page into ../man
[comedilib.git] / include / comedilib_scxi.h
1 /*
2     include/comedilib_scxi.h
3     header file for the comedi scxi library routines
4
5     Copyright (C) 2004 Caleb Tennis
6
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.
11
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.
16
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.
20
21 */
22
23 #ifndef _COMEDILIB_SCXI_H
24 #define _COMEDILIB_SCXI_H
25
26 #include <comedilib.h>
27
28 #define SLOT0_INTERVAL  1200
29 #define FAST_INTERVAL   1200
30 #define MEDIUM_INTERVAL 10000
31 #define SLOW_INTERVAL   30000
32
33 #define SCXI_LINE_MOSI 0
34 #define SCXI_LINE_DA   1
35 #define SCXI_LINE_SS   2
36 #define SCXI_LINE_MISO 4
37
38 #define SCXI_DIO_NONE 0
39 #define SCXI_DIO_DO   1
40 #define SCXI_DIO_DI   2
41
42 #define SCXI_AIO_NONE 0
43 #define SCXI_AIO_AO   1
44 #define SCXI_AIO_AI   2
45
46 #define REG_PARK 0x0FFFF
47
48 struct scxi_board_struct {
49         unsigned int device_id;
50         char name[12];
51         int modclass;
52         unsigned int clock_interval;
53         int dio_type, aio_type, channels, status_reg, data_reg;
54         int config_reg, eeprom_reg, gain_reg;
55 };
56
57 typedef struct scxi_board_struct scxi_board_t;
58
59 #define n_scxi_boards ((sizeof(scxi_boards)/sizeof(scxi_boards[0])))
60
61 struct scxi_module_struct {
62         comedi_t *dev;
63         unsigned int board;
64         unsigned int dio_subdev, ser_subdev;
65         unsigned int chassis, slot;
66 };
67
68 typedef struct scxi_module_struct scxi_mod_t;
69
70 #ifdef __cplusplus
71 extern "C" {
72 #endif
73
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);
78
79 #ifdef __cplusplus
80 }
81 #endif
82
83 #endif  // _COMEDILIB_SCXI_H