On 08/12/2015 06:51 PM, Maro wrote:
> So the goal is almost identical to the generic_buffer.c application
> referenced on this wiki [
> http://processors.wiki.ti.com/index.php/AM335x_ADC_Driver's_Guide] 
> 

It shouldn't matter, but if you are willing to upgrade the kernel (ubuntu 
14.04, Linux kernel 4.1.4-ti-r9), 
you could follow the updated version instead:

http://processors.wiki.ti.com/index.php/Linux_Core_ADC_User's_Guide

I just used Robert Nelson kernel (linux-image-4.1.4-ti-r9) and updated/added 
the required entry 
to the device tree:

                tscadc@44e0d000 {
                        compatible = "ti,am3359-tscadc";
                        reg = <0x44e0d000 0x1000>;
                        interrupt-parent = <0x1>;
                        interrupts = <0x10>;
                        ti,hwmods = "adc_tsc";
                        status = "okay";
                        linux,phandle = <0xc5>;
                        phandle = <0xc5>;

                        tsc {
                                compatible = "ti,am3359-tsc";
                        };

                        adc {
                                #io-channel-cells = <0x1>;
                                compatible = "ti,am3359-adc";
                                linux,phandle = <0xc6>;
                                phandle = <0xc6>;
                                ti,adc-channels = <0 1 2 3 4 5 6 7>;
                        };
                };



I didn't try with the .c application with this version yet, but I can read the 
raw values directly:

(AN4 connected to the board analog ground)

~$ cat /sys/bus/iio/devices/iio\:device0/in_voltage4_raw 
12

(AN4 connected to the board 1.8V )

~$ cat /sys/bus/iio/devices/iio\:device0/in_voltage4_raw 
4083


cheers,
Nuno

-- 

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to