Re: Usage of comedi_dio_bitfield

Quoting John Sims <john_at_coherentimaging.com>:

> On Wed, 2002-10-02 at 06:54, Mats Luspa wrote:
> > Hello!
> > 
> > Can someone explain the usage of comedi_dio_bitfield?
> Hello Mats,
> The comedi_dio_bitfield is a mechanism to write or read simultaneously
> multiple bit positions on your parallel digital interface.  Whether the
> operation is a read or write depends on the specific device and
> subdevice you are using.  
> 
> I hope this helps,
> John Sims
> > 

Thank you for the answer. I know the what the function do but I'm not sure about
the parameters to the function. Below you can see how I've used the function,
but it doesn't seem to work. What's the error?

unsigned int bits[32];

for (i=0; i<=3; i++) {
      comedi_dio_config(it, 0, i, COMEDI_INPUT);
      bits[i] = 0;
}
comedi_dio_bitfield(it, 0, 0, bits);
for (i=0; i<=3; i++)
      printf("channel %d = %d\n", i, bits[i]);

/Regards Mats

-- 
Mats Luspa                              Phone: +46 (0)980 79 022
Institutet foer Rymdfysik               Fax: +46 (0)980 79 050
Swedish Institute of Space Physics      email: mats.luspa_at_irf.se
Box 812
SE-981 28 Kiruna, Sweden

Received on 2002-10-02Z13:05:42