Re: BBB IIO ADC access not working

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 19, 2015 at 02:13:10PM -0700, Greg Wilson-Lindberg wrote:
> 
> I'm not using /sys/bus/iio/devices/iio:device0/in_voltageX_raw in my program, 
> I'm using the iio buffer system.
> 
> I tried using cat /sys/bus/iio/devices/iio:device0/in_voltageX_raw while my
> program was running and it worked a couple of times, and got busy a bit also,
> then the touch screen locked up.

This is expected because when the buffer is enabled the device IS busy.
> 
> I have not tried to use /sys/bus/iio/devices/iio:device0/in_voltageX_raw from
> in my program, I was hoping for a lighter weight access that didn't require 
> so many opens & closes. I'm under the impression that I can only get one 
> reading per open if I try to read /sys/bus/iio/devices/iio:device0/in_voltageX_raw.
> Or can I get multiple readings if I do multiple reads.
>

You should be able to keep the file descriptor open and perform multiple reads.

It is necessary lseek before reading from the same channel again.

lseek(fd, 0, SEEK_SET);

You will need a separate file descriptor for each channel.
 
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux