/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file usart.h * @brief This file contains all the function prototypes for * the usart.c file ****************************************************************************** * @attention * * Copyright (c) 2024 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __USART_H__ #define __USART_H__ #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "main.h" /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ extern UART_HandleTypeDef huart1; extern UART_HandleTypeDef huart2; extern UART_HandleTypeDef huart3; /* USER CODE BEGIN Private defines */ #define USART3_REC_LEN (1024) /* 定义最大接收字节数 200 */ #define USART2_REC_LEN (200) /* 定义最大接收字节数 200 */ /* USER CODE END Private defines */ void MX_USART1_UART_Init(void); void MX_USART2_UART_Init(void); void MX_USART3_UART_Init(void); /* USER CODE BEGIN Prototypes */ extern char g_usart3_rx_buf[USART3_REC_LEN]; /* 接收缓冲,最大USART_REC_LEN个字节.末字节为换行符 */ extern char g_usart3_rx_sta; // 接收完成标志 0x33:接收完成 extern uint8_t g_usart3_rx_len; extern DMA_HandleTypeDef hdma_usart3_tx; extern DMA_HandleTypeDef hdma_usart3_rx; extern char g_usart2_rx_buf[USART2_REC_LEN]; /* 接收缓冲,最大USART_REC_LEN个字节.末字节为换行符 */ extern char g_usart2_rx_sta; extern uint8_t g_usart2_rx_len; extern DMA_HandleTypeDef hdma_usart2_rx; extern DMA_HandleTypeDef hdma_usart2_tx; /* USER CODE END Prototypes */ #ifdef __cplusplus } #endif #endif /* __USART_H__ */