找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 1598|回复: 2
收起左侧

STM32f373串口通讯源码

[复制链接]
ID:626003 发表于 2019-10-18 09:26 | 显示全部楼层 |阅读模式
STM32f373串口通讯源码

单片机源程序如下:
  1. #include "stm32f37x.h"
  2. //#include "ili9328.h"
  3. #include "uart.h"
  4. #include "led.h"
  5. #include <stdio.h>

  6. #define countof(a) (sizeof(a) / sizeof(*(a)))//计算数组内的成员个数
  7. uint8_t Tx_Buffer[] ="asdfghjkl";

  8. static void delay (int cnt)
  9. {
  10.   while (cnt--);
  11. }

  12. int main(void)
  13. {
  14. /* USART1 config 115200 8-N-1 */
  15.         //uint8_t a=0x12;
  16.         LED_Init();
  17.         //LED_Init1();
  18.   USART_Configuration();
  19.   while (1)
  20.   {
  21.    //UART_Send( Tx_Buffer, countof(Tx_Buffer)-1);
  22.                 //UART_send_byte(12);
  23.         if ((USART1->ISR)&(1<<7))  USART1->TDR=0xab;
  24.                 delay(1000);
  25.         LED_Open();//
  26.         LED_Close();//
  27.                 //vFeedExtWatchDog();
  28.   }
  29. }
复制代码

所有资料51hei提供下载:
串口uart.7z (530.43 KB, 下载次数: 39)
回复

使用道具 举报

ID:787827 发表于 2020-6-23 16:13 | 显示全部楼层
学习一下,感谢分享!
回复

使用道具 举报

ID:386683 发表于 2020-11-25 10:01 | 显示全部楼层
感谢分享,兄弟有整套资料吗?最近在用这个芯片,但不太熟悉
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表