65 lines
1.1 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef _USART_H
#define _USART_H
#include "sys.h"
#include "stdio.h"
//////////////////////////////////////////////////////////////////////////////////
// STM32H7开发板
//串口1初始化
//STM32H7工程模板-HAL库函数版本
//DevEBox 大越创新
//淘宝店铺mcudev.taobao.com
//淘宝店铺shop389957290.taobao.com
//////////////////////////////////////////////////////////////////////////////////
#define USART_REC_LEN 200 //定义最大接收字节数 200
#define EN_USART1_RX 1 //使能1/禁止0串口1接收
extern u8 USART_RX_BUF[USART_REC_LEN]; //接收缓冲,最大USART_REC_LEN个字节.末字节为换行符
extern u16 USART_RX_STA; //接收状态标记
extern UART_HandleTypeDef UART1_Handler; //UART句柄
#define RXBUFFERSIZE 1 //缓存大小
extern u8 aRxBuffer[RXBUFFERSIZE]; //HAL库USART接收Buffer
//如果想串口中断接收,请不要注释以下宏定义
void uart_init(u32 bound);
#endif
//STM32H7工程模板-HAL库函数版本
//DevEBox 大越创新
//淘宝店铺mcudev.taobao.com
//淘宝店铺shop389957290.taobao.com