STM32-矩阵键盘程序4×.docxVIP

  • 26
  • 0
  • 约5.55千字
  • 约 11页
  • 2020-07-28 发布于天津
  • 举报
矩阵键盘驱动 矩阵键盘驱动 /* *文件: *编写人:LiuHui *描述:扫描4x4矩阵键盘输入,并返回键值 *适用范围:驱动采用库编写,适用于 STM32F10X系列单片机 *所用引脚:PA0-PA7 *编写时间:2014年5月20日 */ #i nclude #i nclude #i nclude /* 矩阵键盘初始化 * 功能:初始化stm32单片机 GPIO//PAO-PA7 *参数传递: *输入:无 *返回值:无 */ voidKeyBoard」nit(void) GPIO_InitTypeDefGPIO_InitStructure; =GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3; =GPIO_Speed_10MHz; =GPIO_Mode_Out_PP; GPIO_Init(GPIOA,GPIO_InitStructure); =GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7; =GPIO_Speed_10MHz; =GPIO_Mode_IPD; GPIO_Init(GPIOA,GPIO_InitStructure); GPIO_SetBits(GPIOA,GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3); GPIO_ResetBits

文档评论(0)

1亿VIP精品文档

相关文档