-
Notifications
You must be signed in to change notification settings - Fork 0
/
Flash_Management.h
40 lines (35 loc) · 1.03 KB
/
Flash_Management.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* @Author: xph
* @Date: 2021-08-04 00:41:49
* @LastEditTime: 2021-08-09 23:24:56
* @LastEditors: Please set LastEditors
* @Description: 非易失性存储器管理
* @FilePath: \Flash_Management\Flash_Management.h
*/
#ifndef __FLASH_MANAGEMENT_H
#define __FLASH_MANAGEMENT_H
#define ENABLE_NV_LAYOUT 0
typedef enum
{
FLASH_IN = 0,
FLASH_NOR,
EEPROM,
FLASH_OFF,
} NV_MEN_t;
#if ENABLE_NV_LAYOUT
typedef struct
{
void *pElement; /*参数数据地址*/
NV_MEN_t memSel; /*存储器选择*/
unsigned int addr; /*参数存储目标地址*/
unsigned int length; /*参数数据长度*/
} NV_LAYOUT_t;
/*参数映射表记录条数*/
#define NV_RECORD_NUMBER(nvList) (sizeof(nvList) / sizeof(NV_LAYOUT_t))
void nv_load(NV_LAYOUT_t *pLayout, unsigned int number); //加载内存数据
void nv_store(NV_LAYOUT_t *pLayout, unsigned int number); //存储内存数据
#else
void nv_load(void *pElement, NV_MEN_t memSel, unsigned int addr, unsigned int length);
void nv_store(void *pElement, NV_MEN_t memSel, unsigned int addr, unsigned int length);
#endif
#endif