3 Header file for NI general purpose counter support code (ni_tio.c)
5 COMEDI - Linux Control and Measurement Device Interface
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU 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 _COMEDI_NI_TIO_H
24 #define _COMEDI_NI_TIO_H
26 #include <linux/comedidev.h>
28 // forward declarations
33 NITIO_G0_Autoincrement_Reg,
34 NITIO_G1_Autoincrement_Reg,
35 NITIO_G2_Autoincrement_Reg,
36 NITIO_G3_Autoincrement_Reg,
61 NITIO_G0_Input_Select_Reg,
62 NITIO_G1_Input_Select_Reg,
63 NITIO_G2_Input_Select_Reg,
64 NITIO_G3_Input_Select_Reg,
65 NITIO_G0_Counting_Mode_Reg,
66 NITIO_G1_Counting_Mode_Reg,
67 NITIO_G2_Counting_Mode_Reg,
68 NITIO_G3_Counting_Mode_Reg,
69 NITIO_G0_Second_Gate_Reg,
70 NITIO_G1_Second_Gate_Reg,
71 NITIO_G2_Second_Gate_Reg,
72 NITIO_G3_Second_Gate_Reg,
75 NITIO_G01_Joint_Reset_Reg,
76 NITIO_G23_Joint_Reset_Reg,
77 NITIO_G01_Joint_Status1_Reg,
78 NITIO_G23_Joint_Status1_Reg,
79 NITIO_G01_Joint_Status2_Reg,
80 NITIO_G23_Joint_Status2_Reg,
81 NITIO_G0_DMA_Config_Reg,
82 NITIO_G1_DMA_Config_Reg,
83 NITIO_G2_DMA_Config_Reg,
84 NITIO_G3_DMA_Config_Reg,
85 NITIO_G0_DMA_Status_Reg,
86 NITIO_G1_DMA_Status_Reg,
87 NITIO_G2_DMA_Status_Reg,
88 NITIO_G3_DMA_Status_Reg,
96 ni_gpct_variant_e_series,
97 ni_gpct_variant_m_series,
101 #define MAX_NUM_NITIO_REGS 0x40
105 unsigned counter_index;
107 void (*write_register)(struct ni_gpct *this, unsigned bits, enum ni_gpct_register reg);
108 unsigned (*read_register)(struct ni_gpct *this, enum ni_gpct_register reg);
109 enum ni_gpct_variant variant;
110 uint64_t clock_period_ps; /* clock period in picoseconds */
111 struct mite_channel *mite_chan;
112 unsigned regs[MAX_NUM_NITIO_REGS];
115 extern void ni_tio_init_counter(struct ni_gpct *counter);
116 extern int ni_tio_rinsn(struct ni_gpct *counter,
119 extern int ni_tio_insn_config(struct ni_gpct *counter,
122 extern int ni_tio_winsn(struct ni_gpct *counter,
125 extern int ni_tio_cmd(struct ni_gpct *counter, comedi_async *async);
126 extern int ni_tio_cmdtest(struct ni_gpct *counter);
127 extern int ni_tio_cancel(struct ni_gpct *counter);
129 #endif /* _COMEDI_NI_TIO_H */