usart(3970).h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * @file usart.h
  5. * @brief This file contains all the function prototypes for
  6. * the usart.c file
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * Copyright (c) 2024 STMicroelectronics.
  11. * All rights reserved.
  12. *
  13. * This software is licensed under terms that can be found in the LICENSE file
  14. * in the root directory of this software component.
  15. * If no LICENSE file comes with this software, it is provided AS-IS.
  16. *
  17. ******************************************************************************
  18. */
  19. /* USER CODE END Header */
  20. /* Define to prevent recursive inclusion -------------------------------------*/
  21. #ifndef __USART_H__
  22. #define __USART_H__
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. /* Includes ------------------------------------------------------------------*/
  27. #include "main.h"
  28. /* USER CODE BEGIN Includes */
  29. /* USER CODE END Includes */
  30. extern UART_HandleTypeDef huart1;
  31. extern UART_HandleTypeDef huart2;
  32. extern UART_HandleTypeDef huart3;
  33. /* USER CODE BEGIN Private defines */
  34. #define USART3_REC_LEN (1024) /* 定义最大接收字节数 200 */
  35. /* USER CODE END Private defines */
  36. void MX_USART1_UART_Init(void);
  37. void MX_USART2_UART_Init(void);
  38. void MX_USART3_UART_Init(void);
  39. /* USER CODE BEGIN Prototypes */
  40. extern char g_usart3_rx_buf[USART3_REC_LEN]; /* 接收缓冲,最大USART_REC_LEN个字节.末字节为换行符 */
  41. extern char g_usart3_rx_sta; // 接收完成标志 0x33:接收完成
  42. extern uint8_t g_usart3_rx_len;
  43. extern DMA_HandleTypeDef hdma_usart3_tx;
  44. extern DMA_HandleTypeDef hdma_usart3_rx;
  45. /* USER CODE END Prototypes */
  46. #ifdef __cplusplus
  47. }
  48. #endif
  49. #endif /* __USART_H__ */