Read ADC on mx28evk

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Read ADC on mx28evk

Jump to solution
1,729 Views
JeromeBaron
Contributor II

Hi everyone,

I want to do a simple read on the lradc pins on the mx28evk. I have read a lot of threads but I could not find the answer to my question or could wrap my head around what I'm missing there.

- In the kernel menuconfig, I have "Low Resolution ADC support" checked, which set CONFIG_MXS_LRADC=y.

- In the target filesystem, I have some files related to lradc:

/sys/devices/platform/mxs-lradc.0

/sys/devices/system/mxs-lradc

/sys/devices/system/mxs-lradc/mxs-lradc-1

/sys/bus/platform/devices/mxs-lradc.0

/sys/bus/platform/drivers/mxs-lradc

/sys/bus/platform/drivers/mxs-lradc/mxs-lradc.0

- I have one dev related to that: /dev/input/ts0

Now, can I, in the filesystem, read the ADCs?

If not, should I do a simple program that use ioctl of a driver? Which driver file?

Regards,

Jerome

Labels (1)
0 Kudos
Reply
1 Solution
1,101 Views
pt
Senior Contributor I

Hi

I have found adc test code on the following thread.

https://community.freescale.com/message/313683#313683

Regards

Pt

View solution in original post

0 Kudos
Reply
4 Replies
1,102 Views
pt
Senior Contributor I

Hi

I have found adc test code on the following thread.

https://community.freescale.com/message/313683#313683

Regards

Pt

0 Kudos
Reply
1,101 Views
JeromeBaron
Contributor II

Thanks everyone for your answers. I think I'll go with the register access way like suggested by Pt. I already have a section in my code where I rewrite the PINMUX registers so I'll just do the same for the ADC.

0 Kudos
Reply
1,101 Views
fabio_estevam
NXP Employee
NXP Employee

On a 3.17 kernel you can read the ADC by doing:

root@freescale /$ cat /sys/bus/iio/devices/iio:device0/in_voltage0_raw    

4095 

0 Kudos
Reply
1,101 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi,

There is no driver of ADC in user space. But you can use as reference the touchscreen driver  source code to develop your own ADC driver in user space.

If you want to check the touchscreen funcionality in user space you can type:

cat /dev/input/touchscreen0

It seems that there is  customer's example at

LRADC with IMX28

Best Regards,

Alejandro