fixing end of scan events in some drivers
[comedi.git] / comedi / drivers / comedi_fc.h
1 /*
2     cfc.h
3
4     This is a place for code driver writers wish to share between
5     two or more drivers.
6     If it ever grows beyond a couple inline functions, I'll make
7     a cfc.o module to go with this header file.  cfc is short
8     for comedi-frank-common.
9
10     Author:  Frank Mori Hess <fmhess@users.sourceforge.net>
11     Copyright (C) 2002 Frank Mori Hess
12
13     This program is free software; you can redistribute it and/or modify
14     it under the terms of the GNU General Public License as published by
15     the Free Software Foundation; either version 2 of the License, or
16     (at your option) any later version.
17
18     This program is distributed in the hope that it will be useful,
19     but WITHOUT ANY WARRANTY; without even the implied warranty of
20     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21     GNU General Public License for more details.
22
23     You should have received a copy of the GNU General Public License
24     along with this program; if not, write to the Free Software
25     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26
27 ************************************************************************/
28
29 #include "linux/comedidev.h"
30
31 /* Writes an array of data points to comedi's buffer */
32 unsigned int cfc_write_array_to_buffer( comedi_subdevice *subd, void *data,
33         unsigned int num_bytes );
34
35 inline unsigned int cfc_write_to_buffer( comedi_subdevice *subd, sampl_t data )
36 {
37         return cfc_write_array_to_buffer( subd, &data, sizeof( data ) );
38 };
39
40 inline unsigned int cfc_write_long_to_buffer( comedi_subdevice *subd, lsampl_t data )
41 {
42         return cfc_write_array_to_buffer( subd, &data, sizeof( data ) );
43 };
44
45 unsigned int cfc_read_array_from_buffer( comedi_subdevice *subd, void *data,
46         unsigned int num_bytes );