usart.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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) 2025 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 huart2;
  31. extern UART_HandleTypeDef huart3;
  32. /* USER CODE BEGIN Private defines */
  33. #define MAX_FRAME_LENGTH_NET (1024 * 2)
  34. typedef struct _data_record_net
  35. {
  36. char frame_buf[MAX_FRAME_LENGTH_NET];
  37. uint16_t frame_len;
  38. uint8_t finished;
  39. }data_record_net;
  40. extern data_record_net usart2_tx_data;
  41. extern data_record_net usart2_rx_data;
  42. extern data_record_net usart3_tx_data;
  43. extern data_record_net usart3_rx_data;
  44. /* USER CODE END Private defines */
  45. void MX_USART2_UART_Init(void);
  46. void MX_USART3_UART_Init(void);
  47. /* USER CODE BEGIN Prototypes */
  48. void BSP_USART_Config(void);
  49. /* USER CODE END Prototypes */
  50. void UART_TX_DMA_Send(UART_HandleTypeDef* uartHandle, uint8_t *buffer, uint16_t length);
  51. #ifdef __cplusplus
  52. }
  53. #endif
  54. #endif /* __USART_H__ */