实验六、键盘驱动实践.docVIP

  • 1
  • 0
  • 约1.22千字
  • 约 7页
  • 2020-07-21 发布于湖北
  • 举报
图键盘接口电路 图中S11~S44是4*4的键盘矩阵。它的四根行扫描线为Scanl_1~ Scanl_4,分别接 GPE5~GPE8。四根列扫描线分别经过一个二极管并接在一起,再通过对一个开关电路 为开关的控制,向处理器报告按键中断。另外,每根列扫描线与一根行扫描线之间还有一个二极管连接。 该电路的工作原理及扫描过程如下: 初始化时置所有行扫描线为低电平,配置中断引脚KB_INT1为外部中断功能,并且允KB_INT1中断; 当没有键按下时,所有二极管都处于截止状态,那么Q6的基极通过上拉电阻 setenv serverip 192.168.4.X setenv ipaddr 30 tftp nand erase 0x30000 0x190000 nand write 00x30000 0x190000 go 0进入#提示符后,再输入下面的命令 重新启动启动开发箱后,在开发箱的控制台中输入: insmod /usr/kb/driver/kb.ko insmod /usr/dled/driver/dled.ko (9)运行测试程序 在开发箱的控制台中输入: /usr/kb/test/kb_dled 可以看到控制台会打印出一行信息: test show. press ctrl+c to exit ” 按目标机的 4*4 “kb 。 键盘中有数字的键,在选定的数码管上显示相应的数字。同时终端会打印如下信息:(led0 代表测试程序中选定第一个数码管。 / # ./usr/kb/test/kb_dled kb_dled test show. press ctrl+c to exit the key value 1 will be display on the leds the key value 2 will be display on the leds the key value 3 will be display on the leds the key value 4 will be display on the leds the key value 5 will be display on the leds the key value 6 will be display on the leds the key value 7 will be display on the leds the key value 8 will be display on the leds the key value 9 will be display on the leds the key value 0 will be display on the leds 按“ctrl+c”可以退出测试程序 (9)卸载模块 rmmod /dev/kb rmmod /dev/dled

文档评论(0)

1亿VIP精品文档

相关文档