<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://jackxiang.com/post//</link>
<title><![CDATA[[键盘驱动]键盘的驱动]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Tue, 09 Jan 2007 05:24:23 +0000</pubDate> 
<guid>http://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	键盘的驱动<br/><br/><br/> &nbsp; &nbsp; 键盘在所有的驱动之中最为简单的一种，但它却包含了驱动的基本框架，对以后继续深入学习其他复杂的驱动大有裨益，以下便为你逐步剖析驱动的开发。采用的是查询方式。<br/>一.内核模块的注册和撤销<br/> &nbsp; &nbsp;在加载模块的时候，首先运行的是内核模块的注册函数。它的功能包括内核注册设备以及变量的初始化。<br/>static int head,tail;<br/>int &nbsp;_init Keypad_init(void)<br/>&#123;<br/> &nbsp; int result;<br/> &nbsp; result=register_chrdev(KEY_LED_MAJOR,KEY_LED_NAME,&Keypad_fops);<br/> &nbsp;Keypad_clear();<br/> &nbsp;init_waitqueue_head(&queue);<br/> &nbsp;prink("%s %s initialized.&#92;n",KEY_LED_NAME,KEY_LED_VERSION);//不能用prinf<br/> return 0;<br/>&#125;<br/>module_init(Keypad_init);//加载模块<br/>void _exit Keypad_cleanup(void)<br/>&#123;<br/> &nbsp; del_timer(&timer);<br/> &nbsp; unregister_chrdev(KEY_LED_MAJOR,KEY_LED_NAME);<br/> &nbsp; prink("Keypad driver removed &#92;n");<br/>&#125;<br/>module_exit(Keypad_cleanup);//卸载该模块<br/>二.虚拟文件系统与硬件驱动的接口<br/>static struct file_operations Keypad_fops=&#123;<br/> &nbsp;open:Keypad_open,<br/> &nbsp;read:Keypad_read,<br/> &nbsp;poll:Keypad_poll,<br/> &nbsp;fasync:Keypad_fasync,<br/> release:Keypad_release,<br/>&#125;;<br/>该接口定义完之后一些便是对这几个具体函数的实现了！现在我们一起进入下一步吧，是不是觉得其实没什么难度的呢？别那么早开心着呢？这几个函数的实现时候，涉及到很多技术，包括内核定时器，等待队列的具体实现（阻塞方式），异步方式的具体实现技巧，循环队列。看到这么多技术你是否感到很兴奋呢？以下本人将以通俗的方式为你讲解，希望你能理解。<br/>三.设备的打开操作接口函数具体实现（Keypad_open)<br/>设备打开一般包括两大操作，一是完成设备的初始化，二是设备引用计数器加1<br/>static int Keypad_open(struct inode *inode,struct file *filp)<br/>&#123;<br/> &nbsp;read_xy();<br/> &nbsp;try_module_get(THIS_MODULE);//此函数为linux 2.6内核增加的，不同于2.4内核，功能是计数器的值加1<br/> &nbsp;return 0;<br/>&#125;<br/>static void read_xy(void)<br/>&#123;<br/> &nbsp;new_data();//获取键值函数<br/> &nbsp;keypad_starttimer（）;//开启内核定时器，在固定周期时间内获取键盘新的变化<br/>&#125;<br/>以下实现键盘键值获取函数read_xy()<br/>主要是从KEY_CS(对应的读入地址，之前可以根据具体的硬件设备定义，比如＃define kEY_CS(*<br/><br/>(volatile unsigned short *)(0xf820000))此处应该根据具体的不同而不同！<br/>将读入的键值存入buf[]缓存中,环形缓冲的写指针是head，读指针是tail，前面已经定义过了<br/>////////////////////////////////键盘事件的数据结构定义/////////////////////////////////<br/>typedef struct&#123;<br/> &nbsp;ulong status;//按键的值<br/> &nbsp;ulong click;//是否有按键按下，1表示有，0表示没有<br/>&#125;KEY_EVENT <br/>static KEY_EVENT cur_data,buf[BUFSIZE];//BUFSIZE为宏定义，用于定义环形缓冲的大小<br/>static void new_data(void)<br/>&#123;<br/> &nbsp;if((KEY_CS & 0xff)!=0xff) &nbsp;//从KEY_CS地址读入数据，若有一个为0则表示有一个按键被按下了（此处硬件电路为低电平有效）<br/> &nbsp;&#123;<br/> &nbsp; &nbsp; &nbsp; &nbsp;switch(KEY_CS & 0xff)&#123;<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case ~KEY0 & 0xff:<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cur_data.status=1;///////1被按下<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;case ~KEY1 & 0xff:<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cur_data.status=2;//2被按下<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/////////其他一样添加，懂吗？？<br/> &nbsp; &nbsp; &nbsp; &nbsp; &#125;<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cur_data.click=1;<br/> &nbsp; &nbsp; &#125;<br/> &nbsp; &nbsp; else if(KEY_CS & 0xff==0xff)&#123;<br/> &nbsp; &nbsp; &nbsp; &nbsp; cur_data.click=0;<br/> &nbsp; &nbsp; &nbsp; &nbsp;cur_data.status=0;<br/> &nbsp; &nbsp; &#125;<br/> &nbsp; &nbsp; if(head!=tail)&#123;////////循环队列缓冲区的应用在此开始了^_^<br/> &nbsp; &nbsp; &nbsp; &nbsp; int last=head--;<br/> &nbsp; &nbsp; &nbsp; &nbsp; if(last<0)////////若已经到了对首之前，则跳到队尾，以实现循环队列<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;last=BUFSIZE-1;<br/> &nbsp; &nbsp; &#125;<br/> &nbsp; &nbsp; //////按键信息存入循环队列缓冲区中<br/> &nbsp; &nbsp; buf[head]=cur_data;<br/> &nbsp; &nbsp;if(++head==BUFSIZE)<br/> &nbsp; &nbsp; &nbsp; head=0;<br/> &nbsp; &nbsp;if(head==tail && tail++=BUFSIZE)<br/> &nbsp; &nbsp; &nbsp;tail=0;<br/> &nbsp; &nbsp;if(fasync)<br/> &nbsp; &nbsp; &nbsp;kill_fasync(&fasyc,SIGIO,POLL_IN);<br/> &nbsp; &nbsp;wake_up_interruptible(&queue);<br/>&#125;<br/><br/>接下来我们介绍其他几个文件接口函数的实现<br/>四.先介绍关闭函数keypad_release(),为什么先介绍它呢？道理很简单，应该它比较简单，先让大家做下热身运动，在介绍完这个之后，继续会介绍一个比较复杂的函数.<br/> &nbsp; &nbsp;关闭操作主要实现的是：关闭设备异步通知，设备计数器减1，删除定时器信号中断<br/>static int Keypad_release(struct inode *inode,struct)<br/>&#123;<br/> &nbsp; Keypad_fasync(-1,filp,0);<br/> &nbsp;module_put(THIS_MODULE);<br/> del_timer(&timer);<br/> return 0;<br/>&#125;<br/>五.设备读取操作接口函数实现Keypad_read()<br/> &nbsp; 主要作用是从缓冲区读取键值，通过调用get_data()实现，通过copy_to_user（）函数将键值复制到用户的数据区中<br/>static ssize_t Keypad_read(struct file *filp,char *buf,ssize_t count,loff_t *l)<br/>&#123;<br/> &nbsp; DECLEARE_WAITQUEUE(wait,current);//声明等待队列，将当前进程加入到等待队列中<br/> &nbsp; KEY_EVENT t;<br/> &nbsp; ulong out_buf[2];<br/> &nbsp; if(head==tail)//当前循环队列中没有数据可以读取<br/> &nbsp; &#123;<br/> &nbsp; &nbsp; &nbsp; &nbsp;if(filp->f_flags & O_NONBLOCK)//假如用户采用的是非堵塞方式读取<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return _EAGAIN;<br/> &nbsp; &nbsp; &nbsp; add_wait_queue(&queue,&wait);//将当前进程加入等待队列<br/> &nbsp; &nbsp; &nbsp; current->state=TASK_INTERRUPTIBLE;//设置当前进程的状态<br/> &nbsp; &nbsp; &nbsp; while((head==tail)&&!signal_pending(current))//假若还没有数据到循环队列并且当前进程没有受到信号<br/> &nbsp; &nbsp; &nbsp; &nbsp;&#123;<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;shedule();//进程调度<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;current->state=TASK_INTERRUPTIBLE;<br/> &nbsp; &nbsp; &nbsp; &nbsp;&#125;<br/> &nbsp; &nbsp; &nbsp; &nbsp;current->state=TASK_RUNNING;<br/> &nbsp; &nbsp; &nbsp; &nbsp;remove_wait_queue(&queue,&wait);<br/> &nbsp; &nbsp; &nbsp; &nbsp;if(head==tail)<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return count;<br/> &nbsp; &nbsp; &nbsp; &nbsp;t=get_data();//调用get_data()函数，得到缓冲区中的数据，下面将给予详细的 介绍<br/> &nbsp; &nbsp; &nbsp; &nbsp;out_buf[0]=t.status;<br/> &nbsp; &nbsp; &nbsp; &nbsp;out_buf[1]=t.click;<br/> &nbsp; &nbsp; &nbsp; &nbsp;copy_to_user(buf,&out_buf,sizeof(out_buf));//将得到的键值拷贝到用户数据区<br/> &nbsp; &nbsp; &nbsp; &nbsp;return count;<br/> &nbsp; &nbsp; &nbsp;<br/> &nbsp; &#125;<br/>&#125;<br/>很自然我们就应该要介绍get_data()函数的实现了，该函数的功能就是从我们定义的循环队列缓冲区中读出我们要的键值，所以其实很简单的如果理解循环队列的原理，在此不多加解释，大家应该具备一般的数据结构相关的知识吧<br/>static KEY_EVENT get_data(void)<br/>&#123;<br/> &nbsp; &nbsp; int last=tail<br/> &nbsp; &nbsp; if(++tail==BUFSIZE)<br/> &nbsp; &nbsp; &nbsp; &nbsp;tail=0;<br/> &nbsp; &nbsp; return buf[last];<br/>&#125;<br/>上面如果你看得懂得话，那么可以进入下面的学习了，主要介绍的是内核定时器的使用，利用等待队列实现阻塞型I/O，poll系统调用，异步通知方式，介绍完之后，我将给出一个应用实例，对于有使用过文件操作系统调用的来说，对我们所写的键盘驱动来说，他们基本上是一样的。废话少说，我们马上开始我们精彩的驱动开发！<br/>六.内核定时器的使用<br/> &nbsp; &nbsp;在该驱动中，我们假设对键盘的获取是以0.2s为周期执行。源代码如下<br/>static struct timer_list timer;///////我们定义的定时器，也许你会问timer_list是什么来的，其实一看名称就应该就知道了，而为什么要用到list那么多定时器呢？其实在linux中还有很多相同的定义，比如说信号，我们定义的也是信号集，你可以定义该list是一个元素的，也可以是多个的。所以对于 timer_list就可以这样描述：在未来某一个特定时刻执行某一系列特定任务的功能。下面我们还会给出内核中timer_list的具体描述，<br/> static int Keypad_starttimer(void)<br/>&#123;<br/> &nbsp; &nbsp; init_timer(&timer);//初始化定时器结构<br/> &nbsp; &nbsp; timer.function=Keypad_timer;//超时服务程序<br/> &nbsp; &nbsp; timer.expires=jiffies+20;//当前时刻加0.2s<br/> &nbsp; &nbsp; add_timer(&timer);<br/> &nbsp; &nbsp; return 0;<br/>&#125;<br/>///超时服务程序<br/>static void Keypad_timer(unsigned long data)<br/>&#123;<br/> &nbsp; &nbsp;read_xy();<br/>&#125;<br/>/////////接下来说下timer-list这个数据结构，如果你不感兴趣的话可以跳过，该结构在<br/><br/>include&#92;linux&#92;timer.h中定义<br/>struct timer_list<br/>&#123;<br/> &nbsp; &nbsp; struct list_head entry;<br/> &nbsp; &nbsp; unsigned long expries;<br/> &nbsp; &nbsp;spinlock_t lock;<br/> &nbsp; &nbsp;unsigned long magic;<br/> &nbsp; &nbsp;void (*function)(unsigned long);<br/> &nbsp; &nbsp;unsigner long data;<br/> &nbsp; &nbsp;struct tvec_t_base_s *base;<br/>&#125;<br/>七.利用等待队列实现阻塞型I&#92;O<br/> &nbsp; &nbsp; 在用户程序执行读操作的时候有可能尚且没有数据可以读取，为此需要让read操作等待，直到有数据可以读取，这就是阻塞型i&#92;o，阻塞型io可以通过使用进程休眠方法实现。在无数据可以读取的时候，采用等待队列让进程休眠，直到有数据到达的时候才唤醒进程完成数据的读操作。<br/> &nbsp; &nbsp;在本驱动中的read，若循环队列缓冲区中没有数据，则进程进入休眠态，定时器函数每隔0.2s读取键值一次，将按键状态放入缓冲并且适时唤醒进程读取数据。<br/> &nbsp; 等待队列的使用流程如下：<br/> &nbsp; 1.声明一个等待队列<br/> &nbsp; 2.把当前进程加入到等待队列中<br/> &nbsp; 3.把进程的状态设置为TASK_INTERRUPTIBLE或TASK_UNINTERRUPTIBLE;<br/> &nbsp; 4.调用schedule，以让出cpu<br/> &nbsp;5.检测所需要的资源是否可用，若是，把当前进程从等待队列中删除，否则转3循环<br/>接下来我们在对read中有关等待队列阻塞实现做具体的解释<br/>static ssize_t Keypad_read(struct file *filp,char *buf,ssize_t count,loff_t *l)<br/>&#123;<br/> &nbsp; DECLEARE_WAITQUEUE(wait,current);//声明等待队列，将当前进程加入到等待队列中<br/> &nbsp; KEY_EVENT t;<br/> &nbsp; ulong out_buf[2];<br/> &nbsp; if(head==tail)//当前循环队列中没有数据可以读取<br/> &nbsp; &#123;<br/> &nbsp; &nbsp; &nbsp; &nbsp;if(filp->f_flags & O_NONBLOCK)//假如用户采用的是非堵塞方式读取<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return _EAGAIN;<br/> &nbsp; &nbsp; &nbsp; add_wait_queue(&queue,&wait);//将当前进程加入等待队列<br/> &nbsp; &nbsp; &nbsp; current->state=TASK_INTERRUPTIBLE;//设置当前进程的状态<br/> &nbsp; &nbsp; &nbsp; while((head==tail)&&!signal_pending(current))//假若还没有数据到循环队列并且当前进程没有受到信号（该类信号具体来说是未决的休眠）<br/> &nbsp; &nbsp; &nbsp; &nbsp;&#123;<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;shedule();//进程调度<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;current->state=TASK_INTERRUPTIBLE;<br/> &nbsp; &nbsp; &nbsp; &nbsp;&#125;<br/> &nbsp; &nbsp; &nbsp; &nbsp;current->state=TASK_RUNNING;//该进程恢复执行<br/> &nbsp; &nbsp; &nbsp; &nbsp;remove_wait_queue(&queue,&wait);//移出等待队列<br/> &nbsp; &nbsp; &nbsp; &nbsp;if(head==tail)<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return count;<br/> &nbsp; &nbsp; &nbsp; &nbsp;t=get_data();//调用get_data()函数，得到缓冲区中的数据，下面将给予详细的 介绍<br/> &nbsp; &nbsp; &nbsp; &nbsp;out_buf[0]=t.status;<br/> &nbsp; &nbsp; &nbsp; &nbsp;out_buf[1]=t.click;<br/> &nbsp; &nbsp; &nbsp; &nbsp;copy_to_user(buf,&out_buf,sizeof(out_buf));//将得到的键值拷贝到用户数据区<br/> &nbsp; &nbsp; &nbsp; &nbsp;return count;<br/> &nbsp; &nbsp; &nbsp;<br/> &nbsp; &#125;<br/>&#125;<br/>八.poll系统调用操作接口函数<br/> &nbsp; 当程序需要进行对多个文件读写时，如果某个文件没有准备好，则系统就会处于读写阻塞的状态，这影响了其他文件的读写，为了避免读写阻塞，一般可以在应用程序中使用poll或者select函数。当poll函数返回时，会给出一个文件是否可读写的标志，应用程序根据不同的标志读写相应的文件，实现非阻塞的读写，poll（）函数通过poll系统调用，调用对应设备驱动的poll（）接口函数，poll返回不同的标志，告诉主进程文件是否可以读写，这些返回标志存放在include&#92;asm&#92;poll.h中<br/> <br/> 标志 &nbsp;含义<br/> POLLIN &nbsp;如果设备无阻塞的读，就返回该值<br/> POLLRDNORM &nbsp;通常的数据已经准备好，可以读了，就返回<br/>该值。通常的做法是会返回（POLLLIN&#124;POLLRDNORA）<br/> POLLRDBAND &nbsp;如果可以从设备读出带外数据，就返回该值，它只可在linux内核的某些网络代码中使用，通常不用在设备驱动程序中<br/> POLLPRI &nbsp;如果可以无阻塞的读取高优先级（带外）数据，就返回该值，返回该值会导致select<br/><br/>报告文件发生异常，以为select八带外数据当作异常处理POLLHUP &nbsp;当读设备的进程到达文件尾时，驱动程序必须返回该值，依照select的功能描述，调用select的进程被告知进程时可读的。<br/> POLLERR &nbsp;如果设备发生错误，就返回该值。<br/> POLLOUT &nbsp;如果设备可以无阻塞地些，就返回该值<br/> POLLWRNORM &nbsp;设备已经准备好，可以写了，就返回该值。通常地做法是（POLLOUT&#124;POLLNORM）<br/> POLLWRBAND &nbsp;于POLLRDBAND类似<br/>在本章地驱动程序中，Keypad_poll（）函数在缓冲区有新数据时（当head！＝tail），返回一个<br/><br/>POLLIN&#124;POLLRDNORM，告诉主进程有新的<br/><br/>九.在设备驱动中实现异步通知<br/> &nbsp; 虽然大多数时候阻塞型和非阻塞型操作的组合及poll方法可以有效查询设备是否可以读写，但是如果驱动程序能避免主动的查询，改主动为被动的信号通知触发，则可以提高程序的效率，这也就是异步通知的目的。异步通知向进程发送SIGIO信号，通知访问设备的进程，表示该设备已经准备好IO读写了。<br/> &nbsp;之后就是如何实现异步通知的问题了，要启动异步通知，必须执行两个步骤：首先，须要制定某个作为文件的“属主”。文件属主的进程ID保存在filp- >f_owner中，这可以通过fcntl()系统调用执行F_SETOWN命令设置。此外，用户程序还必须曙色之设备的FASYNC标志，以真正启动异步通知机制。这里的FASYNC标志也使用fcntl（）设置。<br/> &nbsp;在完成这两个步骤之后，当新数据到达时就会产生一个SIGNO信号，此信号发送到存放在filp->owner中的进程。<br/> &nbsp;从驱动的角度看，则主要时通过调用两个内核提供的函数来实现就是了。他们分别是：int<br/><br/>fasync_helper()和void kill_fasync();这两个函数定义在：include&#92;linux&#92;fs&#92;fcntl.h<br/> &nbsp; &nbsp;要实现异步，驱动中只要如下编写即可<br/>static struct fasync_struct *fasync;//首先是定义一个结构体<br/>static int Keypad_release(struct inode *inode,struct file *filp)<br/>&#123;<br/> &nbsp; Keypad_fasync(-1,filp,0);//这是一个异步通知<br/> 。。。。。。。<br/>&#125;<br/>static int Keypad_fasync(int fd,struct file *filp,int on)<br/>&#123;<br/> &nbsp; int retval;<br/> &nbsp;retval=fasync_helper(fd,filp,on,&fasync);<br/> &nbsp;if(retval<0)<br/> &nbsp; &nbsp; return retval;<br/> &nbsp;return 0;<br/>&#125;<br/>到此为止，键盘驱动已经介绍完了，接下来就介绍下一个利用使用驱动的应用实例了。<br/>以下程序的主体是一个条件循环，每次循环执行一次，就读取一次键值。<br/>1。打开Keypad设备<br/> #define DEV_NAME "/dev/Keypad"<br/>int fb=0;<br/>fb=open(DEV_NAME,O_RNONLY);<br/>if(!fb)&#123;<br/> &nbsp; &nbsp;printf("Error:cannot open Keypad device.&#92;n");<br/> &nbsp; exit(1);<br/>&#125;<br/>printf("The Keypad device was opened successfully.&#92;n");<br/>&#125;<br/>2.读取键值<br/>unsigned long keydata[2];<br/>int input=1;<br/>while(input!=0)<br/>&#123;<br/> &nbsp; &nbsp;if(read(fd,(char*)keydata,sizeof(keydata))==-1)&#123;<br/> &nbsp; &nbsp; &nbsp; printf("Error reading the keypad data");<br/> &nbsp; &nbsp; &nbsp; close(fb);<br/> &nbsp; &nbsp; &nbsp; exit(2);<br/> &nbsp; &nbsp; &#125;<br/> &nbsp; &nbsp; if(keydata[0])&#123;<br/> &nbsp; &nbsp; &nbsp;switch(keydata[1])&#123;<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;case 1:printf("KEYPUSED 1");//1键被按下<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;input=0;////下此循环退出<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;。。。。。。。。。。。。。。。。。。<br/> &nbsp; &nbsp; &nbsp;&#125;<br/> &nbsp; &nbsp;&#125;<br/>&#125;<br/>3。关闭Keypad设备<br/>close(fb);<br/>printf("Good bye Keypad");<br/> <br/>键盘驱动到此介绍完毕！！
]]>
</description>
</item><item>
<link>http://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [键盘驱动]键盘的驱动]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>