Click here to Skip to main content
15,867,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone,

I am using qt to develop an c++ embedded application and i have to control the gpio's with my application.

I was researching and come acroos with the "linux/gpio.h" this has every function that i need, but when i include it

C++
#include <linux/gpio.h>


it gave this error

C++
Could not find the linux/gpio.h


Is there other way to control gpio's or is there solution for my problem.

Thanks in advance.
Posted
Comments
Amir Mahfoozi 30-Jan-12 4:46am    
If you know where the gpio.h is located then change #include <linux/gpio.h> to #include "gpio.h" and use -I [gpio.h path] when calling make.

As far as I know gpio.h is available only for kernel space code, see the following discussion Gpio from userspace in c++[^].
 
Share this answer
 
Comments
hilmisu 30-Jan-12 8:08am    
Thanks for your answer! but i found this very similar to your answer http://www.avrfreaks.net/wiki/index.php/Documentation:Linux/GPIO
it is very helpfull.
Read the documentation of your embedded device. It should contain a section about the setup of the Linux development environment for your device. This is necessary to have the matching header files for hardware and kernel version used by your device. It may be also necessary to install a cross compiler and build tools.

The documentation should also contain a simple example on building applications for your device. Use this as a base for your application. With proper setup, the gpio.h header file will be found.
 
Share this answer
 
Comments
hilmisu 30-Jan-12 8:07am    
Thanks ! but i found this http://www.avrfreaks.net/wiki/index.php/Documentation:Linux/GPIO
it is very helpfull.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900