ADC value read from user space

cancel
Showing results for 
Search instead for 
Did you mean: 

ADC value read from user space

70 Views
Contributor III

Hi Everyone,

I want to read the ADC value for the below pin ADC1_IN0 that we can read from the user space. my expetion is to get interface like sysfs gpio so i can export and use it.

Since this pin marked as Input so anyone suggest me how to read the value for this pin from userspace.

pastedImage_1.png

running linux (yocto zeus) on the imx board. One can access the datasheet from below link

https://www.nxp.com/docs/en/data-sheet/IMX6SXAEC.pdf  (Page 137 Table 113).

Labels (3)
0 Kudos
3 Replies

7 Views
Contributor III

Hi Igor1z‌,

Thanks for your reply. we are thinking to use three other gpio pins to meet our requirement. they are

NAND_DATA04 W7 NVCC_NAND GPIO ALT5 GPIO4_IO08 Input Keeper

QSPI1B_SS1_B F15 NVCC_QSPI GPIO ALT5 GPIO4_IO31 Input Keeper

SD2_DATA1 E14 NVCC_SD2 GPIO ALT5 GPIO6_IO09 Input Keeper

Could you please confirm in above three which one we can choose to read the gpio value for /sys/gpio/export functionality.

Also i would like to know how to calculate the GPIO no for above pins so i can control them using sysfs.

Thanks,

Nikhil

0 Kudos

7 Views
NXP TechSupport
NXP TechSupport

Hi Nikhil

yes these pins can be used to read the gpio value for /sys/gpio/export functionality,

examples can be found on:

Definitive GPIO guide - Studio Kousagi Wiki 

https://community.nxp.com/thread/381277 

Best regards
igor

0 Kudos

7 Views
NXP TechSupport
NXP TechSupport

Hi Nikhil

unfortunately for i.MX6SX there is no linux adc support in nxp bsps and one can use FreeRTOS:

Alternatively one can try to reuse i.MX7D linux adc driver, it is described in

sect.4.1.3 ADC Driver Overview i.MX Linux Reference Manual


Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos