Robert Nelson <robertcnel...@gmail.com> wrote:
> On Fri, Aug 7, 2015 at 11:36 AM,  <c...@isbd.net> wrote:
> > I have a BBB running Debian GNU/Linux 7, 3.8.13-bone47 kernel.  I.e.
> > pretty standard.
> >
> > My raw ADC files are to be found at:-
> >
> >     /sys/devices/ocp.3/44e0d000.tscadc/tiadc/iio:device0/in_voltage0_raw
> >     /sys/devices/ocp.3/44e0d000.tscadc/tiadc/iio:device0/in_voltage1_raw
> >     /sys/devices/ocp.3/44e0d000.tscadc/tiadc/iio:device0/in_voltage2_raw
> >     /sys/devices/ocp.3/44e0d000.tscadc/tiadc/iio:device0/in_voltage3_raw
> >     /sys/devices/ocp.3/44e0d000.tscadc/tiadc/iio:device0/in_voltage4_raw
> >     /sys/devices/ocp.3/44e0d000.tscadc/tiadc/iio:device0/in_voltage5_raw
> >     /sys/devices/ocp.3/44e0d000.tscadc/tiadc/iio:device0/in_voltage6_raw
> >     /sys/devices/ocp.3/44e0d000.tscadc/tiadc/iio:device0/in_voltage7_raw
> >
> > Currently I use a find() function written in python which walks the
> > /sys/devices tree to find these files, but it's very slow.  If I hard
> > code the file names how often, if at all, will they need changing?
> >
> > ... and/or is there an easier way to find them, i.e. is there a
> > configuration file somewhere that tells me where they are (or at least
> > the non-constant bits of the path)?
> 
> You should also see them here:
> 
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/ABI/testing/sysfs-bus-iio#n91
>  
> 
> 
> What: /sys/bus/iio/devices/iio:deviceX/in_voltageY-voltageZ_raw
> KernelVersion: 2.6.35
> Contact: linux-...@vger.kernel.org
> Description:
> Raw (unscaled) differential voltage measurement equivalent to
> channel Y - channel Z where these channel numbers apply to the
> physically equivalent inputs when non differential readings are
> separately available. In differential only parts, then all that
> is required is a consistent labeling.  Units after application
> of scale and offset are millivolts.
> 
That isn't really what I was asking for Robert.  

Yes, the above tells me how the directory name is generated but I
don't think it gives me a clue what its actual value is for any
particular case.  If it *does* tell me how to work out (by program)
the directory name can you explain how to do it please.

I want to either hard-code the address in my Python program (if it's
not likely to change) or I want somewhere *in the BBB* where I can
find the address so the Python program can get it quickly.

It's easy enough for me to find the full directory path to the values
I want (using 'find' or whatever) but I want an efficient programmatic
way of doing it - or I want to know that it isn't going to change and
thus I can hard-code it.

-- 
Chris Green
ยท

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to