新聞中心

EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > Stm32串口發(fā)送字節(jié)數(shù)據(jù)

Stm32串口發(fā)送字節(jié)數(shù)據(jù)

作者: 時(shí)間:2016-11-09 來(lái)源:網(wǎng)絡(luò) 收藏
說(shuō)明:每發(fā)送一次數(shù)據(jù),LED等閃爍一下

本文引用地址:http://m.butianyuan.cn/article/201611/318055.htm
/**說(shuō)明:*PA0:KEY1;PA1:KEY2;*PA2:LED1;PA3:LED2;*PA9:USART1_TX;PA10:USART1_RX*/#include "stm32f10x.h"#include "stm32f10x_rcc.h"#include "stm32f10x_gpio.h"#include "stm32f10x_usart.h"#include "system_stm32f10x.h"#include "stdio.h"#define PUTCHAR_PROTOTYPE int __io_putchar(int ch) void RCC_Configuration(void);void GPIO_Configuration(void); void delay_ms(u16 time);void USART_Configuration(void);int main(){SystemInit();RCC_Configuration();GPIO_Configuration(); USART_Configuration();while(1)                                           //循環(huán)逐字輸出,到結(jié)束字