nv_storage.h 399 B

123456789101112131415161718192021
  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. #pragma pack(pop)
  10. void nv_save_soc(void);
  11. int nv_restore_soc(void);
  12. void nv_erase_all_soc(int keep_cycle);
  13. int nv_save_sn(uint8_t *sn, int len);
  14. int nv_read_sn(uint8_t *sn, int len);
  15. int nv_read_write_test(void);
  16. void nv_save_all_soc(void);
  17. void nv_storage_log(void);