当前位置:文档下载 > 所有分类 > 工程科技 > 电子/电路 > STM32 UASRT串口1,2,3测试
侵权投诉

STM32 UASRT串口1,2,3测试

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

//main.c

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

名称:串口测试

编写:mingzhang.zhao

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

注意事项:

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

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

http://www.wendangxiazai.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__ */

第1页

猜你喜欢

返回顶部