1COMEDI_DIO_BITFIELD2(3)        Comedi reference        COMEDI_DIO_BITFIELD2(3)
2
3
4

NAME

6       comedi_dio_bitfield2 - read/write multiple digital channels
7

SYNOPSIS

9       #include <comedilib.h>
10
11       int comedi_dio_bitfield2(comedi_t * device, unsigned int subdevice,
12                                unsigned int write_mask, unsigned int * bits,
13                                unsigned int base_channel);
14

DESCRIPTION

16       The function comedi_dio_bitfield2 allows multiple channels to be read
17       or written together on a digital input, output, or configurable digital
18       I/O device. The parameter write_mask and the value pointed to by bits
19       are interpreted as bit fields, with the least significant bit
20       representing channel base_channel. For each bit in write_mask that is
21       set to 1, the corresponding bit in *bits is written to the digital
22       output channel. After writing all the output channels, each channel is
23       read, and the result placed in the approprate bits in *bits. The result
24       of reading an output channel is the last value written to the output
25       channel.
26
27       All the channels might not be read or written at the exact same time.
28       For example, the driver may need to sequentially write to several
29       registers in order to set all the digital channels specified by the
30       write_mask and base_channel parameters.
31

RETURN VALUE

33       If successful, 0 is returned, otherwise -1.
34

AUTHORS

36       David Schleef <ds@schleef.org>
37           Author.
38
39       Frank Mori Hess <fmhess@users.sourceforge.net>
40           Author.
41
42       Herman Bruyninckx <Herman.Bruyninckx@mech.kuleuven.ac.be>
43           Author.
44
45       Bernd Porr <tech@linux-usb-daq.co.uk>
46           Author.
47
48       Ian Abbott <abbotti@mev.co.uk>
49           Author.
50
51       Éric Piel <piel@delmic.com>
52           Author.
53
55       Copyright © 1998-2003 David Schleef
56       Copyright © 2001-2003, 2005, 2008 Frank Mori Hess
57       Copyright © 2002-2003 Herman Bruyninckx
58       Copyright © 2012 Bernd Porr
59       Copyright © 2012 Ian Abbott
60       Copyright © 2012, 2015 Éric Piel
61
62       This document is part of Comedilib. In the context of this document,
63       the term "source code" as defined by the license is interpreted as the
64       XML source.
65
66       This library is free software; you can redistribute it and/or modify it
67       under the terms of the GNU Lesser General Public License as published
68       by the Free Software Foundation, version 2.1 of the License.
69
70       This library is distributed in the hope that it will be useful, but
71       WITHOUT ANY WARRANTY; without even the implied warranty of
72       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
73       General Public License for more details.
74
75       You should have received a copy of the GNU Lesser General Public
76       License along with this library; if not, write to the Free Software
77       Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
78       USA.
79
80
81
82
83Comedi                            05/11/2017           COMEDI_DIO_BITFIELD2(3)
Impressum