⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gpio_keys_input_test.c

📁 ixp425 linux2.6 gpio 中断驱动及测试
💻 C
字号:
#include <stdio.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <linux/input.h>int main( int argc, char *argv[] ){	int fd, i;	struct input_event x;	system("/bin/mknod /dev/event0 c 13 64");	fd = open("/dev/event0", O_RDONLY);	if( fd < 0 ) {		perror("open");		goto END;	}	for(;;) {	printf("read gpio \n");		if(read( fd, &x, sizeof(x))) {			printf("------------------%d %d %d\n", x.type, x.code, x.value);		}	}END:	return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -