usart.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. /* USER CODE END Includes */
  41. extern UART_HandleTypeDef huart4;
  42. extern UART_HandleTypeDef huart5;
  43. extern UART_HandleTypeDef huart1;
  44. extern UART_HandleTypeDef huart2;
  45. extern UART_HandleTypeDef huart3;
  46. /* USER CODE BEGIN Private defines */
  47. /* USER CODE END Private defines */
  48. void MX_UART4_Init(void);
  49. void MX_UART5_Init(void);
  50. void MX_USART1_UART_Init(void);
  51. void MX_USART2_UART_Init(void);
  52. void MX_USART3_UART_Init(void);
  53. /* USER CODE BEGIN Prototypes */
  54. void Printf_u4u5logbyU1(void);
  55. //void Write_Info64(uint32_t addr, uint64_t newValue);
  56. //void Write_Info08(uint32_t addr, uint8_t newValue);
  57. //uint8_t Read_flash_6(uint32_t addr, uint8_t* data_ptr);
  58. uint8_t xorBytes(uint8_t arr[], int size);
  59. void sendCombinedArray(uint8_t *header, size_t headerLength, uint8_t *command, size_t commandLength, bool JM);
  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. /* USER CODE END Prototypes */
  63. #ifdef __cplusplus
  64. }
  65. #endif
  66. #endif /* __USART_H__ */