Read ADC on mx28evk

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,418件の閲覧回数
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

ラベル(1)
0 件の賞賛
1 解決策
790件の閲覧回数
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 件の賞賛
4 返答(返信)
791件の閲覧回数
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 件の賞賛
790件の閲覧回数
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 件の賞賛
790件の閲覧回数
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 件の賞賛
790件の閲覧回数
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