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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
1,369 Views
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 Kudos
1 Solution
717 Views
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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
1 Reply
718 Views
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 Kudos