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