main.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * @file : main.h
  5. * @brief : Header for main.c file.
  6. * This file contains the common defines of the application.
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
  11. * All rights reserved.</center></h2>
  12. *
  13. * This software component is licensed by ST under BSD 3-Clause license,
  14. * the "License"; You may not use this file except in compliance with the
  15. * License. You may obtain a copy of the License at:
  16. * opensource.org/licenses/BSD-3-Clause
  17. *
  18. ******************************************************************************
  19. */
  20. /* USER CODE END Header */
  21. /* Define to prevent recursive inclusion -------------------------------------*/
  22. #ifndef __MAIN_H
  23. #define __MAIN_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /* Includes ------------------------------------------------------------------*/
  28. #include "stm32g0xx_hal.h"
  29. #include <rtthread.h>
  30. #define One 100
  31. #define Zero 200
  32. void Read_Para(void);
  33. void Enadble_module(uint8_t en);
  34. uint8_t check_flash_cfd(void);
  35. uint8_t check_flag(void);
  36. void Reflash_BL_Sta_Check(void);
  37. void Failure_handling(void);
  38. void Check_Rst(void);
  39. typedef struct
  40. {
  41. uint16_t Now_Version;
  42. uint8_t upgrade_flag;
  43. uint8_t boot_state;
  44. uint16_t iap_boot_state;
  45. }BL_Para;
  46. typedef struct Bak_info ///*/存放bak相关的所有参数 一次性读取 减少bl占用时间
  47. {
  48. uint8_t Bak_sta[3]; ///bak空间的状态,0 - > iap 空间 1 - > bak1空间 2 - > bak2空间
  49. uint16_t FW_Version[3]; ///bak空间中的固件版本号 存放固件版本的1000倍的整数
  50. uint16_t FW_Ver_tim[3]; ///存放bak空间中固件的记录日期
  51. ///具体算法为 高8位存放月的个数与年数*12的和 低八位存放日
  52. } Bak_info;
  53. #endif /* __MAIN_H */
  54. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/