main.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2025-02-06 RuoFeng the first version
  9. */
  10. #ifndef APPLICATIONS_MAIN_H_
  11. #define APPLICATIONS_MAIN_H_
  12. /********* RTC备份操作 **********/
  13. #define Reg_Read_Fail 0x7FFF
  14. typedef enum //取被写入的RTC寄存器位置
  15. {
  16. TestMode = 1, // RTC_BKP_DR1
  17. Tig_GC, // RTC_BKP_DR2
  18. App_Ver_Sync, // RTC_BKP_DR3 BL 每次开机写入自己版本,App 只读
  19. // RTC_Reg_4_5 , // RTC_BKP_DR4
  20. } BKP_Reg_Num;
  21. typedef enum //用于定位读写RTC备份寄存器时指定位置
  22. {
  23. Reg_Low = 0, //取 低 8 位
  24. Reg_Middle , //取 8 -16 位
  25. Reg_High , //取 16-24 位
  26. Reg_Very_High , //取 24-32 位
  27. Reg_Low_16 , //取 低16 位
  28. Reg_High_16 , //取 高16 位
  29. Reg_All , //取 32 位
  30. } BKP_Reg_Pos;
  31. uint32_t BSP_Read_RTC_Reg(BKP_Reg_Num reg_num, BKP_Reg_Pos type);
  32. uint8_t BSP_Write_RTC_Reg(BKP_Reg_Num reg_num, BKP_Reg_Pos type, uint32_t w_data);
  33. /********* RTC备份操作 **********/
  34. #endif /* APPLICATIONS_MAIN_H_ */