Android 5.0.2 GPIO

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Android 5.0.2 GPIO

跳至解决方案
1,938 次查看
kamilbystryk
Contributor III

I'm trying set 1 input (GPIO 5.12) and one output (GPIO 1.18) on i.MX6 Solo. What exatly i should set on *.dtsi file, to get GPIO access on sys/class/gpio?

0 项奖励
回复
1 解答
1,683 次查看
CarlosCasillas
NXP Employee
NXP Employee

Hi Kamil,

In this case, you could use as reference the thread below:

DTS tree changes to access GPIO from linux on IMX6SL-EVK Board


Hope this will be useful for you.
Best regards!
/Carlos

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

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,683 次查看
CarlosCasillas
NXP Employee
NXP Employee

Hi Kamil,

You could refer to the following thread, which provides tips regarding GPIO usage on Android:

How do I map Android GPIO to actual i.MX6 hardware pins


Hope this will be useful for you.
Best regards!
/Carlos

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

0 项奖励
回复
1,683 次查看
kamilbystryk
Contributor III

Hello Carlos,

This link shows how to use defined GPIO. I know how use GPIO when he shows in /sys/class/gpio path, however I don't have idea how configure GPIO in kernel (what in resul give access in class/gpio).

I found some configuration in *.dtsi file, but i don't know how configure specific lines.

0 项奖励
回复
1,684 次查看
CarlosCasillas
NXP Employee
NXP Employee

Hi Kamil,

In this case, you could use as reference the thread below:

DTS tree changes to access GPIO from linux on IMX6SL-EVK Board


Hope this will be useful for you.
Best regards!
/Carlos

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

0 项奖励
回复
1,683 次查看
kamilbystryk
Contributor III

Hello Carlos.

At now, i can correctly add GPIO to filesystem, however i can't use GPIO as output (input works fine).

I define GPIO as:
MX6QDL_PAD_DISP0_DAT18__GPIO5_IO12 0x17059

I think, problem is in 0x17059 definition, but i don't know what is this "magic number"?

Second question - where i can put code to automaticly export and set GPIO at startup?

0 项奖励
回复