app_flashdb.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  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. * 2026-07-08 Administrator the first version
  9. */
  10. #ifndef APPLICATIONS_APP_FLASHDB_C_
  11. #define APPLICATIONS_APP_FLASHDB_C_
  12. #include <flashdb.h>
  13. #include <stddef.h>
  14. typedef struct
  15. {
  16. uint8_t iSave; //存储标志位
  17. uint8_t freq_filter; //滤网自动更换周期
  18. uint8_t worked_day; //已采集天数
  19. uint32_t tape_max; //胶带最大使用量(长度)
  20. uint32_t filter_max; //滤网最大使用量(长度)
  21. uint32_t tape_used; //胶带使用量
  22. uint32_t filter_used; //滤网使用量
  23. }Flashdb_typedef;
  24. int app_flashdb_init(void);
  25. int app_flashdb_save(const char *key, void *value);
  26. int app_flashdb_load(const char *key, void *value);
  27. /* EasyFlash 兼容接口(底层为 FlashDB KVDB),业务代码无需改动 */
  28. size_t ef_get_env_blob(const char *key, void *value_buf, size_t buffer_len, size_t *saved_value_len);
  29. int ef_set_env_blob(const char *key, const void *value_buf, size_t size);
  30. #endif /* APPLICATIONS_APP_FLASHDB_C_ */