首页 理论教育 Linux驱动程序开发实例:键盘输入设备驱动程序

Linux驱动程序开发实例:键盘输入设备驱动程序

时间:2023-10-19 理论教育 版权反馈
【摘要】:例10.2 S3C6410X键盘输入驱动程序代码见\samples\10input\10-1Button。这里针对第6章的键盘电路编写一个输入设备形式的驱动程序。[root@urbetter/home]#./demotesttime:1086222460.263859type 1 code 5 value 1time:1086222460.263878type 1 code 5 value 0time:1086222461.898843type 1 code 2 value 1time:1086222461.898863type 1 code 2 value 0time:1086222464.753842type 1 code 3 value 1time:1086222464.753861type 1 code 3 value 0time:1086222466.788851type 1 code 4 value 1time:1086222466.788870type 1 code 4 value 0time:1086222469.023849type 1 code 6 value 1time:1086222469.023868type 1 code 6 value 0time:1086222470.133852type 1 code 7 value 1time:1086222470.133871type 1 code 7 value 0

Linux驱动程序开发实例:键盘输入设备驱动程序

例10.2 S3C6410X键盘输入驱动程序

代码见\samples\10input\10-1Button。这里针对第6章的键盘电路编写一个输入设备形式的驱动程序。核心代码如下:

应用层测试代码如下:

本例测试结果如下:

[root@urbetter/home]#insmod button.ko

initialize button...

input:simplekey as/class/input/input3

initialize button ok!

[root@urbetter/home]#./demotest

time:1086222460.263859(s)type 1 code 5 value 1

time:1086222460.263878(s)type 1 code 5 value 0(www.xing528.com)

time:1086222461.898843(s)type 1 code 2 value 1

time:1086222461.898863(s)type 1 code 2 value 0

time:1086222464.753842(s)type 1 code 3 value 1

time:1086222464.753861(s)type 1 code 3 value 0

time:1086222466.788851(s)type 1 code 4 value 1

time:1086222466.788870(s)type 1 code 4 value 0

time:1086222469.023849(s)type 1 code 6 value 1

time:1086222469.023868(s)type 1 code 6 value 0

time:1086222470.133852(s)type 1 code 7 value 1

time:1086222470.133871(s)type 1 code 7 value 0

免责声明:以上内容源自网络,版权归原作者所有,如有侵犯您的原创版权请告知,我们将尽快删除相关内容。

我要反馈