• 大小: 647KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-23
  • 语言: 其他
  • 标签: STM32  串口  

资源简介

STM32HAL库串口接收数据参考代码,发送ASCII码,需要回车作为结束符。博客配套资源https://blog.csdn.net/geek_monkey/article/details/89165040#comments_13986638

资源截图

代码片段和文件信息

#include “IO.h“

/**
  * @brief 按键扫描函数
  * @param None
  * @note  None
  * @retval 按下的键值
  */
u8 KEY_Scan(void)
{
  static u8 key_up=1;//按键按松开标志      
  if(key_up&&(KEY1==0||KEY2==0||KEY3==0||KEY4==0))
  {
    HAL_Delay(10);//去抖动
    key_up=0;
    if(KEY1==0)return KEY1_PRES;
    else if(KEY2==0)return KEY2_PRES;
    else if(KEY3==0)return KEY3_PRES;
    else if(KEY4==0)return KEY4_PRES;
  }else if(KEY1==1&&KEY2==1&&KEY3==1&&KEY4==1)key_up=1;         
  return 0;// 无按键按下
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        7175  2020-11-04 12:29  .mxproject
     文件         399  2018-07-27 19:21  clean.bat
     目录           0  2020-10-30 16:48  Core\
     目录           0  2020-11-04 12:29  Core\Inc\
     文件         632  2020-10-30 15:02  Core\Inc\IO.h
     文件        6151  2020-11-04 12:29  Core\Inc\main.h
     文件       20065  2020-11-04 12:29  Core\Inc\stm32f4xx_hal_conf.h
     文件        2137  2020-11-04 12:29  Core\Inc\stm32f4xx_it.h
     文件         366  2019-03-18 18:03  Core\Inc\UART.h
     目录           0  2020-11-04 12:29  Core\Src\
     文件         527  2020-10-30 14:44  Core\Src\IO.c
     文件        8042  2020-11-04 12:29  Core\Src\main.c
     文件        4286  2020-11-04 12:29  Core\Src\stm32f4xx_hal_msp.c
     文件        5895  2020-11-04 12:29  Core\Src\stm32f4xx_it.c
     文件       26457  2020-10-24 16:49  Core\Src\system_stm32f4xx.c
     文件        1034  2020-10-30 16:56  Core\Src\UART.c
     目录           0  2020-10-30 16:48  Drivers\
     目录           0  2020-11-04 12:29  Drivers\CMSIS\
     目录           0  2020-10-30 16:48  Drivers\CMSIS\Device\
     目录           0  2020-10-30 16:48  Drivers\CMSIS\Device\ST\
     目录           0  2020-11-04 12:29  Drivers\CMSIS\Device\ST\STM32F4xx\
     目录           0  2020-11-04 12:29  Drivers\CMSIS\Device\ST\STM32F4xx\Include\
     文件     1233379  2020-10-24 16:49  Drivers\CMSIS\Device\ST\STM32F4xx\Include\stm32f405xx.h
     文件        9485  2020-10-24 16:49  Drivers\CMSIS\Device\ST\STM32F4xx\Include\stm32f4xx.h
     文件        3796  2020-10-24 16:49  Drivers\CMSIS\Device\ST\STM32F4xx\Include\system_stm32f4xx.h
     目录           0  2020-11-04 12:29  Drivers\CMSIS\Device\ST\STM32F4xx\Source\
     目录           0  2020-11-04 12:29  Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\
     目录           0  2020-11-04 12:29  Drivers\CMSIS\Include\
     文件       28208  2020-10-24 16:49  Drivers\CMSIS\Include\cmsis_armcc.h
     文件       56497  2020-10-24 16:49  Drivers\CMSIS\Include\cmsis_armclang.h
     文件        9014  2020-10-24 16:49  Drivers\CMSIS\Include\cmsis_compiler.h
............此处省略76个文件信息

评论

共有 条评论