poweroff_save_app.h 967 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef __POWEROFF_SAVE_APP_H__
  2. #define __POWEROFF_SAVE_APP_H__
  3. //掉电保存地址
  4. #define POWEROFF_SAVE_ADDRESS ST_FLASH_SECTOR_2
  5. //掉电备份地址
  6. #define POWEROFF_BACKUP_ADDRESS ST_FLASH_SECTOR_3
  7. //掉电保存数据大小,由于取的是区域的大小,因此需要保证区域大小
  8. #define POWEROFF_SAVE_BLOCK_SIZE (1024* 1)
  9. //掉电保存区域大小
  10. #define POWEROFF_SAVE_SECTOR_SIZE (14 * 1024)
  11. //手动保存地址
  12. #define MANUAL_SAVE_ADDRESS (POWEROFF_SAVE_ADDRESS + POWEROFF_SAVE_SECTOR_SIZE)
  13. //手动保存大小
  14. #define MANUAL_SAVE_BLOCK_SIZE (1024 * 2)
  15. //掉电检测功能延时启动时间(秒)
  16. #define POWER_OFF_FUNCTION_DELAY 2
  17. //掉电检测功能执行间隔(us)
  18. #define POWER_OFF_SAMPLE_TIME 1000
  19. //掉电检测确定计数
  20. #define POWER_OFF_SAMPLE_COUNT 5
  21. #define POWER_ON_SAMPLE_COUNT 200
  22. void poweroff_app_init(void);
  23. void poweroff_app_run(void);
  24. void app_save_parameter(void);
  25. #endif