Dear all:
I use community Linux 2.6.33-rc4 on omapl137 custom board. I enabled gpio support from make menuconfig as following:
device drivers
-> * GPIO support
-> * /sys/class/gpio/... (sysfs interface)
After linux build & running, I can't see any directory or file naming gp* located in target /sys/class.
Question 1: Is the gpio function setting correctly or is there any menu item I should enabled also to use the gpio function?
Next I try to write a gpio_test app to check gpio status. The program is shown below:
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <linux/gpio.h>
int main()
{
int i,iPin;
printf("\n");
for(i=0;i<200;i++){
iPin = gpio_is_valid(i);
if(iPin != 0) printf("gpio %3d is valid\n",i);
}
printf("test over ...\n");
return 0;
}
However this program can't compile successfully due to compiler can't find include file gpio.h.
Question 2: Should I include the "gpio.h" directly by -I option ( I know where the gpio.h located) or I should collect the gpio.h file into a specific directory or there is some methods like "make install" ... to collect all the necessary include files and libraries to somewhere?
Thanks for any idea.