ADC IMX6UL VF610 C/C++ Example code

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

ADC IMX6UL VF610 C/C++ Example code

1,618件の閲覧回数
jmartinez1
Contributor II

Hi all,

I am developping an ADC app on Qt5 using an embedded based on IMX6UL. I would like to know how must I configure and use the driver in order to read the ADC input values programing in C or C++.

Thank you very much.

Joaquim.

ラベル(2)
0 件の賞賛
返信
2 返答(返信)

1,101件の閲覧回数
weidong_sun
NXP TechSupport
NXP TechSupport

Hello Joaquim,

  In i.MX_Linux_Reference_Manual.pdf, software interface has been described, see it, please!

Have a great day,
TIC  Weidong Sun


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

0 件の賞賛
返信

1,101件の閲覧回数
jmartinez1
Contributor II

Hi Wigros,

Thank for your answer.

When I use the console of my embedded system, I can do conversions without problems using "cat in_voltage0_raw". So I understand I have not make the menuconfig.

Before to post, I read the reference manual and I found the driver in my build directory, but in the manual there isn't any explanaition about how use the driver in C/C++. I included the VF610_adc.c file in my project, in order to see how the functions are and if there is any example of configuration/use. I can see several functions, but I looking for a main.c where can help me to see how the ADC is configured and used. The first problem I had is that the headers files included in VF610_adc.c are not found when I compile my project. Please see bellow. I have many doubts because I am not expert in linux embedded systems: the first is where I can found the headers files, and the second an example of use of the driver.

Thank you very much.

#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/io.h>
#include <linux/clk.h>
#include <linux/completion.h>
#include <linux/of.h>
#include <linux/of_irq.h>
#include <linux/regulator/consumer.h>
#include <linux/of_platform.h>
#include <linux/err.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/iio/driver.h>
0 件の賞賛
返信