Files
99_7018_lmx/apps/earphone/remote_control/nvs.h

44 lines
1.0 KiB
C
Raw Normal View History

2025-12-01 10:01:10 +08:00
#ifndef __NVS_H__
#define __NVS_H__
#include "typedef.h"
// 定义出厂信息数据结构
typedef struct {
char product_id[16]; // 产品ID
char serial_number[32]; // 序列号
u16 hw_version; // 硬件版本
u16 cal_data; // 某个校准数据
u32 manufacture_date; // 生产日期 (Unix时间戳)
} factory_info_t;
/**
* @brief Flash
*
* @param info
* @return , <0:
*/
int nvs_write_factory_info(const factory_info_t *info);
/**
* @brief Flash读取出厂信息
*
* @param info
* @return , <0: ()
*/
int nvs_read_factory_info(factory_info_t *info);
/**
* @brief Flash中的出厂信息
*
* @return 0: , <0:
*/
int nvs_clear_factory_info(void);
/**
* @brief NVS读写功能的函数
*
*/
void nvs_test_factory_info(void);
#endif // __NVS_H__