標(biāo)題: STM32f373串口通訊源碼 [打印本頁]

作者: 蒼穹great    時(shí)間: 2019-10-18 09:26
標(biāo)題: STM32f373串口通訊源碼
STM32f373串口通訊源碼

單片機(jī)源程序如下:
  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)))//計(jì)算數(shù)組內(nèi)的成員個(gè)數(shù)
  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. }
復(fù)制代碼

所有資料51hei提供下載:
串口uart.7z (530.43 KB, 下載次數(shù): 39)



作者: lb635378984@126    時(shí)間: 2020-6-23 16:13
學(xué)習(xí)一下,感謝分享!
作者: joion    時(shí)間: 2020-11-25 10:01
感謝分享,兄弟有整套資料嗎?最近在用這個(gè)芯片,但不太熟悉




歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1