usart.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. /* USER CODE END Includes */
  31. extern UART_HandleTypeDef huart4;
  32. extern UART_HandleTypeDef huart5;
  33. extern UART_HandleTypeDef huart1;
  34. extern UART_HandleTypeDef huart2;
  35. extern UART_HandleTypeDef huart3;
  36. /* USER CODE BEGIN Private defines */
  37. extern uint8_t U1reFlag;
  38. extern uint8_t recvLength; //接收一帧数据的长度
  39. extern uint8_t U1recvLength; //接收一帧数据的长度
  40. extern uint8_t recvBuff[512];
  41. extern uint8_t U1recvBuff[512];
  42. extern uint8_t U4recvBuff[512];
  43. /* USER CODE END Private defines */
  44. void MX_UART4_Init(void);
  45. void MX_UART5_Init(void);
  46. void MX_USART1_UART_Init(void);
  47. void MX_USART2_UART_Init(void);
  48. void MX_USART3_UART_Init(void);
  49. /* USER CODE BEGIN Prototypes */
  50. uint8_t xorBytes(uint8_t arr[], int size);
  51. uint16_t read_flash_16(uint32_t addr);
  52. uint32_t read_flash_32(uint32_t addr);
  53. void erase_flash(uint32_t ADDR_FLASH);
  54. void Write_Information(uint32_t addr, uint16_t newValue);
  55. void sendCombinedArray(uint8_t *header, size_t headerLength, uint8_t *command, size_t commandLength, bool JM);
  56. /* USER CODE END Prototypes */
  57. #ifdef __cplusplus
  58. }
  59. #endif
  60. #endif /* __USART_H__ */