usart.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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) 2023 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 "dataHandling.h"
  30. /* USER CODE END Includes */
  31. extern UART_HandleTypeDef huart1;
  32. extern UART_HandleTypeDef huart3;
  33. /* USER CODE BEGIN Private defines */
  34. #define RX_BUF_SIZE 1024
  35. extern uint8_t USART_IAP_RX[RX_BUF_SIZE];
  36. extern uint8_t USART_PUB_RX[RX_BUF_SIZE];
  37. extern uint8_t USART_MODBUS_RX[RX_BUF_SIZE];
  38. extern uint8_t USART_IAP_FLAG;
  39. extern uint8_t USART_MODBUS_FLAG;
  40. extern uint16_t USART_PUB_LENGTH;
  41. extern uint16_t package_num;
  42. extern uint16_t app_Cache_buf[RX_BUF_SIZE] ;
  43. extern uint8_t destArray[128];
  44. extern uint8_t nameArray[16];
  45. extern uint16_t sizeArray[1] ;
  46. extern uint8_t md5Array[16];
  47. extern int count;
  48. extern int nameIndex ;
  49. extern int sizeIndex ;
  50. extern uint16_t curpackage;
  51. extern uint32_t curaddress;
  52. /* USER CODE END Private defines */
  53. void MX_USART1_UART_Init(void);
  54. void MX_USART3_UART_Init(void);
  55. /* USER CODE BEGIN Prototypes */
  56. void update_baudrate(uint16_t temp);
  57. void update_sysVersion(uint32_t addr);
  58. void update_iaplength(uint32_t addr);
  59. void updateiapMd5(uint32_t addr);
  60. void updatecuraddr(uint32_t addr);
  61. int compareArrays(uint16_t arr1[], uint16_t arr2[], int size) ;
  62. void updatecurpack(uint32_t addr);
  63. /* USER CODE END Prototypes */
  64. #ifdef __cplusplus
  65. }
  66. #endif
  67. #endif /* __USART_H__ */