43 lines
1.3 KiB
C
Executable File
43 lines
1.3 KiB
C
Executable File
#ifndef __MW_STORAGE_H__
|
|
#define __MW_STORAGE_H__
|
|
#include "hal.h"
|
|
|
|
typedef enum
|
|
{
|
|
CFG_STORAGE_REGION_MAIN = 0, /* For current user settings */
|
|
CFG_STORAGE_REGION_BACK, /* For backup */
|
|
|
|
CFG_STORAGE_REGION_NUM
|
|
}Mw_CfgStorage_Region_e;
|
|
|
|
typedef enum
|
|
{
|
|
CFG_STORAGE_PARTITION_SYS = 0, /* For system info setting */
|
|
CFG_STORAGE_PARTITION_USER = 1, /* For user setting */
|
|
|
|
CFG_STORAGE_PARTITION_NUM
|
|
}Mw_CfgStorage_Partition_e;
|
|
|
|
|
|
/* For user */
|
|
typedef uint32_t (*mw_read_cb)(Mw_CfgStorage_Partition_e part, Mw_CfgStorage_Region_e region, char *data, uint32_t max_size);
|
|
typedef uint32_t (*mw_write_cb)(Mw_CfgStorage_Partition_e part, Mw_CfgStorage_Region_e region, char *data, uint32_t max_size);
|
|
|
|
////////////////////////////////////////////////////////////
|
|
//
|
|
// 数据类型定义
|
|
//
|
|
////////////////////////////////////////////////////////////
|
|
|
|
/*flash init interface define,should be implement if needed*/
|
|
|
|
// path can be file, return size has been writed
|
|
uint32_t mw_storage_write(Mw_CfgStorage_Partition_e part, Mw_CfgStorage_Region_e region, char *data, uint32_t max_size);
|
|
|
|
// path can be file, return size has been read
|
|
uint32_t mw_storage_read(Mw_CfgStorage_Partition_e part, Mw_CfgStorage_Region_e region, char *data, uint32_t max_size);
|
|
|
|
|
|
|
|
#endif /* __MW_STORAGE_H__ */
|