nv_storage.h 576 B

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #include <stdint.h>
  3. #pragma pack (push,1)
  4. typedef struct {
  5. uint8_t len;
  6. uint8_t sn[24];
  7. uint16_t crc;
  8. }sn_t;
  9. typedef struct {
  10. uint8_t result;
  11. uint16_t crc;
  12. }factory_t;
  13. #pragma pack(pop)
  14. void nv_save_soc(void);
  15. int nv_restore_soc(void);
  16. void nv_erase_all_soc(int keep_cycle);
  17. int nv_save_sn(uint8_t *sn, int len);
  18. int nv_read_sn(uint8_t *sn, int len);
  19. int nv_read_write_test(void);
  20. void nv_save_all_soc(void);
  21. void nv_storage_log(void);
  22. int nv_save_factory_result(uint8_t result);
  23. uint8_t nv_read_factory_result(void);
  24. uint8_t nv_get_sn_byte7(void);