usart.h.bak 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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) 2022 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 huart6;
  32. /* USER CODE BEGIN Private defines */
  33. #define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
  34. #define IAP_USART huart1
  35. #define DEBUG_USART huart6
  36. #define UART_BUFFER_SIZE 2048
  37. #define TX_TIMEOUT 0x010
  38. #define RX_TIMEOUT 0xFFFF
  39. /* USER CODE END Private defines */
  40. void MX_USART1_UART_Init(void);
  41. void MX_USART6_UART_Init(void);
  42. /* USER CODE BEGIN Prototypes */
  43. extern volatile uint16_t uart_rx_len;
  44. extern volatile uint8_t uart_recv_end_flag;
  45. extern uint8_t uart_rx_buffer[UART_BUFFER_SIZE];
  46. /* USER CODE END Prototypes */
  47. #ifdef __cplusplus
  48. }
  49. #endif
  50. #endif /* __USART_H__ */