标题: STM32f373串口通讯源码 [打印本页]

作者: 苍穹great    时间: 2019-10-18 09:26
标题: STM32f373串口通讯源码
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)



作者: lb635378984@126    时间: 2020-6-23 16:13
学习一下,感谢分享!
作者: joion    时间: 2020-11-25 10:01
感谢分享,兄弟有整套资料吗?最近在用这个芯片,但不太熟悉




欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1