how to get access to GPIO in user space from c coding

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

how to get access to GPIO in user space from c coding

跳至解决方案
2,082 次查看
sachindhoundiya
Contributor II

hello all,

I have get the access of GPIO from terminal and check the value in CRO

example :

echo 19 >/sys/class/gpio/export
echo out >/sys/class/gpio/gpio19/direction
echo 1 >/sys/class/gpio/gpio19/value
echo 0 >/sys/class/gpio/gpio19/value
echo 19 >/sys/class/gpio/unexport

but can any suggest me how to write c code and compile it on imx6ulevk board from user space.

what is to done i want to make a recipes or it will be done by simple make-file. 

0 项奖励
回复
1 解答
1,430 次查看
Yuri
NXP Employee
NXP Employee

Hello,

  You may look at the following:

Introduction to accessing the Raspberry Pi's GPIO in C++ (sysfs) · Hertaville.com 

Have a great day,
Yuri

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

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,431 次查看
Yuri
NXP Employee
NXP Employee

Hello,

  You may look at the following:

Introduction to accessing the Raspberry Pi's GPIO in C++ (sysfs) · Hertaville.com 

Have a great day,
Yuri

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

0 项奖励
回复