logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

comedi_dio_bitfield2 - read/write multiple digital channels

Authors

DavidSchleef <ds@schleef.org>
           Author.

       FrankMoriHess <fmhess@users.sourceforge.net>
           Author.

       HermanBruyninckx <Herman.Bruyninckx@mech.kuleuven.ac.be>
           Author.

       BerndPorr <tech@linux-usb-daq.co.uk>
           Author.

       IanAbbott <abbotti@mev.co.uk>
           Author.

       ÉricPiel <piel@delmic.com>
           Author.

Description

       The function comedi_dio_bitfield2 allows multiple channels to be read or written together on a digital
       input, output, or configurable digital I/O device. The parameter write_mask and the value pointed to by
       bits are interpreted as bit fields, with the least significant bit representing channel base_channel. For
       each bit in write_mask that is set to 1, the corresponding bit in *bits is written to the digital output
       channel. After writing all the output channels, each channel is read, and the result placed in the
       approprate bits in *bits. The result of reading an output channel is the last value written to the output
       channel.

       All the channels might not be read or written at the exact same time. For example, the driver may need to
       sequentially write to several registers in order to set all the digital channels specified by the
       write_mask and base_channel parameters.

Name

       comedi_dio_bitfield2 - read/write multiple digital channels

Return Value

       If successful, 0 is returned, otherwise -1.

Synopsis

#include<comedilib.h>intcomedi_dio_bitfield2(comedi_t*device,unsignedintsubdevice,unsignedintwrite_mask,unsignedint*bits,unsignedintbase_channel);

See Also