usart.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. #include "ConfigMacros.h"
  30. extern uint8_t U1_485reFlag;
  31. extern uint8_t U1_485recvBuff[BUFFER_SIZE];
  32. extern uint8_t U1_485recvLength; //接收一帧数据的长度
  33. extern uint8_t U4_4GreFlag;
  34. extern uint8_t U4_4GrecvBuff[BUFFER_SIZE];
  35. extern uint8_t U4_4GrecvLength; //接收一帧数据的长度
  36. extern uint8_t U5_BTreFlag;
  37. extern uint8_t U5_BTrecvBuff[BUFFER_SIZE];
  38. extern uint8_t U5_BTrecvBuff1[BUFFER_SIZE];
  39. extern uint8_t U5_BTrecvLength; //接收一帧数据的长度
  40. extern uint8_t BT_Rebuffer[20];
  41. /* USER CODE END Includes */
  42. extern UART_HandleTypeDef huart4;
  43. extern UART_HandleTypeDef huart5;
  44. extern UART_HandleTypeDef huart1;
  45. extern UART_HandleTypeDef huart2;
  46. extern UART_HandleTypeDef huart3;
  47. /* USER CODE BEGIN Private defines */
  48. /* USER CODE END Private defines */
  49. void MX_UART4_Init(void);
  50. void MX_UART5_Init(void);
  51. void MX_USART1_UART_Init(void);
  52. void MX_USART2_UART_Init(void);
  53. void MX_USART3_UART_Init(void);
  54. /* USER CODE BEGIN Prototypes */
  55. void erase_flash(uint32_t ADDR_FLASH);
  56. void Printf_u4u5logbyU1(void);
  57. uint8_t xorBytes(uint8_t arr[], int size);
  58. void sendCombinedArray(uint8_t *header, size_t headerLength, uint8_t *command, size_t commandLength, bool JM);
  59. void Flash_ReadBytes_mac(uint16_t* sorBuf,uint32_t FlashAddr,uint16_t len);
  60. HAL_StatusTypeDef Flash_WriteBytes(uint16_t* sorBuf, uint32_t FlashAddr, uint16_t len);
  61. void Flash_ReadBytes(uint16_t* sorBuf,uint32_t FlashAddr,uint16_t len);
  62. uint32_t convertGPS(double temp) ;
  63. /* USER CODE END Prototypes */
  64. #ifdef __cplusplus
  65. }
  66. #endif
  67. #endif /* __USART_H__ */