

#ifndef _NVM_INTERFACE_H_
#define _NVM_INTERFACE_H_

#include "TYW_stdint.h"


//车型等级
enum
{
    NVM_MODELLEV_LEV1 = 0,    //Lev1
    NVM_MODELLEV_LEV2,        //Lev2
    NVM_MODELLEV_LEV3,        //Lev3
    NVM_MODELLEV_LEV4,        //Lev4
};

//按键类型
enum
{
    NVM_KEYTYPE_4 = 0,    //4按键
    NVM_KEYTYPE_5,        //5按键
};

//发动机类型
enum
{
    NVM_ENGINE_H15T = 0,    //1.5T-AA发动机
    NMV_ENGINE_NE15T,       //1.5T_GDI发动机
    NMV_ENGINE_NE14T,       //NE14TG发动机
    NMV_ENGINE_H16G,        //H16G
};

//变速箱类型
enum
{
    NVM_GEAR_MT = 0,    //手动档
    NVM_GEAR_AT,        //自动挡
    NVM_GEAR_DCT,       //双离合
};

//机油压力指示灯
enum
{
    NVM_ENGINEOILLED_LINE = 0,    //硬线方案
    NVM_ENGINEOILLED_CAN,         //CAN线方案
};

//发电机类型
enum
{
    NVM_GENERATOR_COMMON = 0,    //普通发电机
    NVM_GENERATOR_AI,            //智能发电机
};

//机油压力传感器
enum
{
    NVM_ENGINEOILSENSOR_1 = 0,    //方案1
    NVM_ENGINEOILSENSOR_2,        //方案2
};

//手刹类型
enum
{
    NVM_HANDBRAKE_MECHANICS = 0,    //机械手刹
    NVM_HANDBRAKE_ELECTRONICS,      //电子手刹
};

//天窗类型
enum
{
    NVM_SKYLIGHT_NONE = 0,     //无天窗
    NMV_SKYLIGHT_COMMON,       //普通天窗
    NVM_SKYLIGHT_PANORAMIC,    //全景天窗
};

//功能开关
enum
{
    NVM_FUNC_ON = 0,    //使能功能
    NVM_FUNC_OFF,       //禁止功能
};

//????????
enum
{
    NVM_EXIT_OFF = 0,    //?????
    NVM_EXIT_ON,         //????
};

//EEPROM初始化标记，如果不是指定的内容则进行初始化

//用户配置信息--掉电后仍然有效

//大计存储结构


//距离单位
#define NVM_USER_SETTINGS_DIST_UNIT (NVM_DIST_UNIT_KM)

//初始化默认值

//********************************************硬件相关信息存储*******************************************

typedef struct
{
    uint32_t OdometerValue;
    uint8_t  SystemSupplyVoltage;
    uint16_t VehicleSpeed;
    uint8_t  DTCLocalTime_second;
    uint8_t  DTCLocalTime_minute;
    uint8_t  DTCLocalTime_hour;
    uint8_t  DTCLocalTime_day;
    uint8_t  DTCLocalTime_month;
    uint8_t  DTCLocalTime_year;
} SnapshotUnion;

typedef struct
{
    uint8_t       DTCStatus;
    uint8_t       DTCAgeing;
    uint8_t       DTCCount;
    uint8_t       DTCPendingCount;
    SnapshotUnion Snapshot;
} DTCUnion;

typedef struct
{
    uint32_t Flag;
    DTCUnion DTC [ 19u ];
} DTCToDFlashInfoUnion;

extern DTCToDFlashInfoUnion DTCToDFlashInfo;

#endif
