STM32 UASRT串口1,2,3测试

STM32F103x的USART1,2,3的收发测试

//main.c

/*----------------------------------------------------------------------------------------------------

名称:串口测试

编写:mingzhang.zhao

内容:测试stm32f103vct6的USART1、USART2及USART3

注意事项:

http://www.wendangwang.comART1:PA9为TX,PA10为RX

http://www.wendangwang.comART2:PA2为TX,PA3为RX

http://www.wendangwang.comART3:PB10为TX,PB11为RX

同时用两个串口助手观测,一个为A,一个为B,一个为C

----------------------------------------------------------------------------------------------------*/

/* Includes ------------------------------------------------------------------*/

#include "stm32f10x.h"

#include "stm32_eval.h"

#include <stdio.h>

/** @addtogroup STM32F10x_StdPeriph_Examples

* @{

*/

/** @addtogroup USART_Printf

* @{

*/

/* Private typedef -----------------------------------------------------------*/

/* Private define ------------------------------------------------------------*/

/* Private macro -------------------------------------------------------------*/

/* Private variables ---------------------------------------------------------*/

USART_InitTypeDef USART_InitStructure;

/* Private function prototypes -----------------------------------------------*/

void Delay(__IO uint32_t t);

#ifdef __GNUC__

/* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Small printf set to 'Yes') calls __io_putchar() */

#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)

#else

#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)

#endif /* __GNUC__ */

Word文档免费下载Word文档免费下载:STM32 UASRT串口1,2,3测试 (共4页,当前第1页)

STM32 UASRT串口1,2,3测试相关文档

最新文档

返回顶部