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

📄 test.c

📁 《ARM嵌入式Linux设备驱动实例开发》
💻 C
字号:
/*
 * File Name: test.c
 *
 * Descriptions: 
 *		The test code of buttons module driver.
 *
 * Author: 
 *		Mike Lee
 * Kernel Version: 2.6.20
 *
 * Update:
 * 		-	2007.07.23	Mike Lee	 Creat this file
 */#include <sys/stat.h>#include <fcntl.h>#include <stdio.h>#include <sys/time.h>#include <sys/types.h>#include <unistd.h>main(){   int fileno;   int number;   fileno = open("/dev/buttons",O_RDWR);   if (fileno == -1)   {   	printf("open buttons device errr!\n");	return 0;   }   while(1)    {   	read(fileno,&number,1);   	printf("key=0x%x\n",number);   }   close(fileno);   return 0;}

⌨️ 快捷键说明

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