#ifndef EEPROM_MANAGER_H_
#define EEPROM_MANAGER_H_

#ifdef __cplusplus
extern "C"
{
#endif

#include "kit_macro.h"
#include "bsp_eeprom.h"

	//************电池类型*******************//
	typedef enum
	{
		kCellType_Start,
		kCellType_kLiFePO4 = kCellType_Start, // 磷酸铁锂
		kCellType_LiNiCoMnO2,				  // 三元材料
		kCellType_kLi2TiO3,					  // 钛酸锂
		kCellType_LeadAcid,					  // 铅酸
		kCellType_Capacity,					  // 超级电容
		kCellType_End,
	} CellType;

	/*****************************配置枚举*****************************/

	typedef enum
	{
		kEep_StartIdx,
		kEep_UpdateFlag = kEep_StartIdx, // 5升级模式 0-延时判断模式 1-不升级 2-立即升级模式
		kEep_UpdateTimeLowIdx,			 // 上次跟新时间
		kEep_UpdateTimeHighIdx,

		kEep_DevAddr_SlaverNum,	   // 地址编号+BCU/BMU个数
		kEep_TempType_BatteryType, // 电池类型+温感类型
		kEep_CellNum,			   // 电池总数
		kEep_TempNum,			   // 温感总数
		kEep_CoolOn_OffTemp,	   // 风扇开启温度+风扇关闭温度
		kEep_VoltFaultTemp2_Temp1, // 电压故障温度点2_1

		kEep_RatedChgCur,				 // 额定充电电流(0.1A/bit,0)
		kEep_RatedDisCur,				 // 额定放电电流(0.1A/bit,0)
		kEep_GridConnVolt,				 // 允许并机压差
		kEep_GridConnCur,				 // 允许并机电流
		kEep_PwrOffDly_MinOnlineCluster, // 高压下电延时+最小在线簇数
		kEep_TripPulse_DataSavePeriod,	 // 脱口脉冲时间(0.1s/bit) + 数据存储周期
		kEep_Inter485Parity_Baudrate,	 // 内部485校验位+内部485波特率
		kEep_Exter485_2Parity_Baudrate,	 // 外部4852校验位+外部4852波特率
		kEep_Exter485_3Parity_Baudrate,	 // 外部4853校验位+外部4853波特率
		kEep_InterCanProtocol_Baudrate,	 // 内部can协议+内部can波特率

		kEep_ExterCanProtocol_Baudrate, // 外部can协议+外部can波特率
		// 20
		kEep_InterRS485_SlaveID_Protocol,  // 内部RS485设备地址+内部RS485通讯协议
		kEep_ExterRS485_1SlaveID_Protocol, // 外部RS4851设备地址+外部RS4851通讯协议
		kEep_ExterRS485_2SlaveID_Protocol, // 外部RS4853设备地址+外部RS4853通讯协议
		kEep_EthSlaveID_EthProtocal,	   // 以太网通讯地址 + 以太网通讯协议
		kEep_Shunt1CaliGain,			   // 分流器1矫正增益
		kEep_Shunt2CaliGain,			   // 分流器2矫正增益
		kEep_shunt2_Shunt1CaliOffset,	   // 分流器2_1矫正偏置
		kEep_Hall1CalFactor,			   // 电流1校准系数
		kEep_Hall2CalFactor,			   // 电流2校准系数
		kEep_Volt1CalFactor,			   // 电压1校准系数
		// 30
		kEep_Volt2CalFactor,		   // 电压2校准系数
		kEep_Hall2_Hall1CaliOffset,	   // 电流2_1矫正偏置
		kEep_HallSwingVolt,			   // 霍尔摆幅电压
		kEep_ChgCurDir_ShuntRatedVolt, // 充电电流方向+分流器额定电压
		kEep_CurSensor2_1Range,		   // 电流传感器2_1量程
		kEep_CurSensor2_1Type,		   // 电流传感器2_1类型
		kEep_CurSensor2_1Dir,		   // 电流传感器2_1方向
		kEep_ZeroFilter2_1Filter,	   // 电流传感器2_1滤波
		kEep_CurSensor2_1Offset,	   // 电流传感器2_1偏移(0.1A/bit 偏移 -12)
		kEep_ChgCurThreshold_KeepTime, // 状态转换电流阈值+状态转换保持时间
		// 继电器配置 40
		kRelayCfgTypeStartIdx,
		kEep_Relay2_1Type = kRelayCfgTypeStartIdx, // 继电器2_1类型
		kEep_Relay4_3Type,						   // 继电器4_3类型
		kEep_Relay6_5Type,						   // 继电器6_5类型
		kEep_Relay8_7Type,						   // 继电器8_7类型

		kEep_DisSelfFaultLow, // 45
		kEep_DisSelfFaultHigh,
		kEep_ChgSelfFaultLow,
		kEep_ChgSelfFaultHigh,

		kEep_PreChgTimeout_Count, // 超时时间(s) + 预充次数
		kEep_PreChgVoltType_Rate, // 预充电压类型 + 预充电压百分比
		kEep_HV2_HV1VoltRate,	  // HV2电压比例+HV1电压比例
		kEep_HeatOn_OffTemp,	  // 加热开启温度+加热关闭温度	  53

		kEep_RatedCapacity,	 // 额定容量
		kEep_ActualCapacity, // 实际容量
		kEep_RatedTotalVolt, // 额定总压(0.1V/bit,0)
		kEep_ReqCghVolt,	 // 请求充电电压(0.1V/bit,0)
		kEep_FullDisVolt,	 // SOC过放校准电压值-----168
		kEep_FullChgVolt,	 // SOC过充校准电压值

		kDisAlarmParamStart, // 60
		// 放电总压低38
		kEep_DisLTVoltHTAlarm1 = kDisAlarmParamStart,
		kEep_DisLTVoltHTAlarm1Dly,
		kEep_DisLTVoltHTAlarm1Rel,
		kEep_DisLTVoltHTAlarm1RelDly,
		kEep_DisLTVoltHTAlarm1Cur_Handle,
		kEep_DisLTVoltHTAlarm2,
		kEep_DisLTVoltHTAlarm2Dly,
		kEep_DisLTVoltHTAlarm2Rel,
		kEep_DisLTVoltHTAlarm2RelDly,
		kEep_DisLTVoltHTAlarm2Cur_Handle,
		kEep_DisLTVoltHTAlarm3,
		kEep_DisLTVoltHTAlarm3Dly,
		kEep_DisLTVoltHTAlarm3Rel,
		kEep_DisLTVoltHTAlarm3RelDly,
		kEep_DisLTVoltHTAlarm3Cur_Handle,
		// 放电总压低 68 低温
		kEep_DisLTVoltLTAlarm1,
		kEep_DisLTVoltLTAlarm1Dly,
		kEep_DisLTVoltLTAlarm1Rel,
		kEep_DisLTVoltLTAlarm1RelDly,
		kEep_DisLTVoltLTAlarm1Cur_Handle,
		kEep_DisLTVoltLTAlarm2,
		kEep_DisLTVoltLTAlarm2Dly,
		kEep_DisLTVoltLTAlarm2Rel,
		kEep_DisLTVoltLTAlarm2RelDly,
		kEep_DisLTVoltLTAlarm2Cur_Handle,
		kEep_DisLTVoltLTAlarm3,
		kEep_DisLTVoltLTAlarm3Dly,
		kEep_DisLTVoltLTAlarm3Rel,
		kEep_DisLTVoltLTAlarm3RelDly,
		kEep_DisLTVoltLTAlarm3Cur_Handle,
		// 放电单体低53
		kEep_DisLCVoltHTAlarm1,
		kEep_DisLCVoltHTAlarm1Dly,
		kEep_DisLCVoltHTAlarm1Rel,
		kEep_DisLCVoltHTAlarm1RelDly,
		kEep_DisLCVoltHTAlarm1Cur_Handle,
		kEep_DisLCVoltHTAlarm2,
		kEep_DisLCVoltHTAlarm2Dly,
		kEep_DisLCVoltHTAlarm2Rel,
		kEep_DisLCVoltHTAlarm2RelDly,
		kEep_DisLCVoltHTAlarm2Cur_Handle,
		kEep_DisLCVoltHTAlarm3,
		kEep_DisLCVoltHTAlarm3Dly,
		kEep_DisLCVoltHTAlarm3Rel,
		kEep_DisLCVoltHTAlarm3RelDly,
		kEep_DisLCVoltHTAlarm3Cur_Handle,
		// 放电单体低 83 低温
		kEep_DisLCVoltLTAlarm1,
		kEep_DisLCVoltLTAlarm1Dly,
		kEep_DisLCVoltLTAlarm1Rel,
		kEep_DisLCVoltLTAlarm1RelDly,
		kEep_DisLCVoltLTAlarm1Cur_Handle,
		kEep_DisLCVoltLTAlarm2,
		kEep_DisLCVoltLTAlarm2Dly,
		kEep_DisLCVoltLTAlarm2Rel,
		kEep_DisLCVoltLTAlarm2RelDly,
		kEep_DisLCVoltLTAlarm2Cur_Handle,
		kEep_DisLCVoltLTAlarm3,
		kEep_DisLCVoltLTAlarm3Dly,
		kEep_DisLCVoltLTAlarm3Rel,
		kEep_DisLCVoltLTAlarm3RelDly,
		kEep_DisLCVoltLTAlarm3Cur_Handle,
		// 放电单体高
		kEep_DisHCVoltAlarm1,
		kEep_DisHCVoltAlarm1Dly,
		kEep_DisHCVoltAlarm1Rel,
		kEep_DisHCVoltAlarm1RelDly,
		kEep_DisHCVoltAlarm1Cur_Handle,
		kEep_DisHCVoltAlarm2,
		kEep_DisHCVoltAlarm2Dly,
		kEep_DisHCVoltAlarm2Rel,
		kEep_DisHCVoltAlarm2RelDly,
		kEep_DisHCVoltAlarm2Cur_Handle,
		kEep_DisHCVoltAlarm3,
		kEep_DisHCVoltAlarm3Dly,
		kEep_DisHCVoltAlarm3Rel,
		kEep_DisHCVoltAlarm3RelDly,
		kEep_DisHCVoltAlarm3Cur_Handle,
		// 放电过流98
		kEep_DisOverCurAlarm1,
		kEep_DisOverCurAlarm1Dly,
		kEep_DisOverCurAlarm1Rel,
		kEep_DisOverCurAlarm1RelDly,
		kEep_DisOverCurAlarm1Cur_Handle,
		kEep_DisOverCurAlarm2,
		kEep_DisOverCurAlarm2Dly,
		kEep_DisOverCurAlarm2Rel,
		kEep_DisOverCurAlarm2RelDly,
		kEep_DisOverCurAlarm2Cur_Handle,
		kEep_DisOverCurAlarm3,
		kEep_DisOverCurAlarm3Dly,
		kEep_DisOverCurAlarm3Rel,
		kEep_DisOverCurAlarm3RelDly,
		kEep_DisOverCurAlarm3Cur_Handle,
		// 放电高温113
		kEep_DisHighTempAlarm1,
		kEep_DisHighTempAlarm1Dly,
		kEep_DisHighTempAlarm1Rel,
		kEep_DisHighTempAlarm1RelDly,
		kEep_DisHighTempAlarm1Cur_Handle,
		kEep_DisHighTempAlarm2,
		kEep_DisHighTempAlarm2Dly,
		kEep_DisHighTempAlarm2Rel,
		kEep_DisHighTempAlarm2RelDly,
		kEep_DisHighTempAlarm2Cur_Handle,
		kEep_DisHighTempAlarm3,
		kEep_DisHighTempAlarm3Dly,
		kEep_DisHighTempAlarm3Rel,
		kEep_DisHighTempAlarm3RelDly,
		kEep_DisHighTempAlarm3Cur_Handle,
		// 放电低温128
		kEep_DisLowTempAlarm1,
		kEep_DisLowTempAlarm1Dly,
		kEep_DisLowTempAlarm1Rel,
		kEep_DisLowTempAlarm1RelDly,
		kEep_DisLowTempAlarm1Cur_Handle,
		kEep_DisLowTempAlarm2,
		kEep_DisLowTempAlarm2Dly,
		kEep_DisLowTempAlarm2Rel,
		kEep_DisLowTempAlarm2RelDly,
		kEep_DisLowTempAlarm2Cur_Handle,
		kEep_DisLowTempAlarm3,
		kEep_DisLowTempAlarm3Dly,
		kEep_DisLowTempAlarm3Rel,
		kEep_DisLowTempAlarm3RelDly,
		kEep_DisLowTempAlarm3Cur_Handle,
		// 放电压差143
		kEep_DisHVDiffAlarm1,
		kEep_DisHVDiffAlarm1Dly,
		kEep_DisHVDiffAlarm1Rel,
		kEep_DisHVDiffAlarm1RelDly,
		kEep_DisHVDiffAlarm1Cur_Handle,
		kEep_DisHVDiffAlarm2,
		kEep_DisHVDiffAlarm2Dly,
		kEep_DisHVDiffAlarm2Rel,
		kEep_DisHVDiffAlarm2RelDly,
		kEep_DisHVDiffAlarm2Cur_Handle,
		kEep_DisHVDiffAlarm3,
		kEep_DisHVDiffAlarm3Dly,
		kEep_DisHVDiffAlarm3Rel,
		kEep_DisHVDiffAlarm3RelDly,
		kEep_DisHVDiffAlarm3Cur_Handle,
		// 放电温差158
		kEep_DisHTDiffAlarm1,
		kEep_DisHTDiffAlarm1Dly,
		kEep_DisHTDiffAlarm1Rel,
		kEep_DisHTDiffAlarm1RelDly,
		kEep_DisHTDiffAlarm1Cur_Handle,
		kEep_DisHTDiffAlarm2,
		kEep_DisHTDiffAlarm2Dly,
		kEep_DisHTDiffAlarm2Rel,
		kEep_DisHTDiffAlarm2RelDly,
		kEep_DisHTDiffAlarm2Cur_Handle,
		kEep_DisHTDiffAlarm3,
		kEep_DisHTDiffAlarm3Dly,
		kEep_DisHTDiffAlarm3Rel,
		kEep_DisHTDiffAlarm3RelDly,
		kEep_DisHTDiffAlarm3Cur_Handle,
		// SOC
		kEep_DisLowSocAlarm1,
		kEep_DisLowSocAlarm1Dly,
		kEep_DisLowSocAlarm1Rel,
		kEep_DisLowSocAlarm1RelDly,
		kEep_DisLowSocAlarm1Cur_Handle,
		kEep_DisLowSocAlarm2,
		kEep_DisLowSocAlarm2Dly,
		kEep_DisLowSocAlarm2Rel,
		kEep_DisLowSocAlarm2RelDly,
		kEep_DisLowSocAlarm2Cur_Handle,
		kEep_DisLowSocAlarm3,
		kEep_DisLowSocAlarm3Dly,
		kEep_DisLowSocAlarm3Rel,
		kEep_DisLowSocAlarm3RelDly,
		kEep_DisLowSocAlarm3Cur_Handle,

		// 充电总压高257
		kEep_ChgHTVoltHTAlarm1,
		kEep_ChgHTVoltHTAlarm1Dly,
		kEep_ChgHTVoltHTAlarm1Rel,
		kEep_ChgHTVoltHTAlarm1RelDly,
		kEep_ChgHTVoltHTAlarm1Cur_Handle,
		kEep_ChgHTVoltHTAlarm2,
		kEep_ChgHTVoltHTAlarm2Dly,
		kEep_ChgHTVoltHTAlarm2Rel,
		kEep_ChgHTVoltHTAlarm2RelDly,
		kEep_ChgHTVoltHTAlarm2Cur_Handle,
		kEep_ChgHTVoltHTAlarm3,
		kEep_ChgHTVoltHTAlarm3Dly,
		kEep_ChgHTVoltHTAlarm3Rel,
		kEep_ChgHTVoltHTAlarm3RelDly,
		kEep_ChgHTVoltHTAlarm3Cur_Handle,
		// 充电总压高(低温)257
		kEep_ChgHTVoltLTAlarm1,
		kEep_ChgHTVoltLTAlarm1Dly,
		kEep_ChgHTVoltLTAlarm1Rel,
		kEep_ChgHTVoltLTAlarm1RelDly,
		kEep_ChgHTVoltLTAlarm1Cur_Handle,
		kEep_ChgHTVoltLTAlarm2,
		kEep_ChgHTVoltLTAlarm2Dly,
		kEep_ChgHTVoltLTAlarm2Rel,
		kEep_ChgHTVoltLTAlarm2RelDly,
		kEep_ChgHTVoltLTAlarm2Cur_Handle,
		kEep_ChgHTVoltLTAlarm3,
		kEep_ChgHTVoltLTAlarm3Dly,
		kEep_ChgHTVoltLTAlarm3Rel,
		kEep_ChgHTVoltLTAlarm3RelDly,
		kEep_ChgHTVoltLTAlarm3Cur_Handle,
		// 充电单体高272
		kEep_ChgHCVoltHTAlarm1,
		kEep_ChgHCVoltHTAlarm1Dly,
		kEep_ChgHCVoltHTAlarm1Rel,
		kEep_ChgHCVoltHTAlarm1RelDly,
		kEep_ChgHCVoltHTAlarm1Cur_Handle,
		kEep_ChgHCVoltHTAlarm2,
		kEep_ChgHCVoltHTAlarm2Dly,
		kEep_ChgHCVoltHTAlarm2Rel,
		kEep_ChgHCVoltHTAlarm2RelDly,
		kEep_ChgHCVoltHTAlarm2Cur_Handle,
		kEep_ChgHCVoltHTAlarm3,
		kEep_ChgHCVoltHTAlarm3Dly,
		kEep_ChgHCVoltHTAlarm3Rel,
		kEep_ChgHCVoltHTAlarm3RelDly,
		kEep_ChgHCVoltHTAlarm3Cur_Handle,
		// 充电单体高(低温)272
		kEep_ChgHCVoltLTAlarm1,
		kEep_ChgHCVoltLTAlarm1Dly,
		kEep_ChgHCVoltLTAlarm1Rel,
		kEep_ChgHCVoltLTAlarm1RelDly,
		kEep_ChgHCVoltLTAlarm1Cur_Handle,
		kEep_ChgHCVoltLTAlarm2,
		kEep_ChgHCVoltLTAlarm2Dly,
		kEep_ChgHCVoltLTAlarm2Rel,
		kEep_ChgHCVoltLTAlarm2RelDly,
		kEep_ChgHCVoltLTAlarm2Cur_Handle,
		kEep_ChgHCVoltLTAlarm3,
		kEep_ChgHCVoltLTAlarm3Dly,
		kEep_ChgHCVoltLTAlarm3Rel,
		kEep_ChgHCVoltLTAlarm3RelDly,
		kEep_ChgHCVoltLTAlarm3Cur_Handle,
		// 充电单体低
		kEep_ChgLCVoltAlarm1,
		kEep_ChgLCVoltAlarm1Dly,
		kEep_ChgLCVoltAlarm1Rel,
		kEep_ChgLCVoltAlarm1RelDly,
		kEep_ChgLCVoltAlarm1Cur_Handle,
		kEep_ChgLCVoltAlarm2,
		kEep_ChgLCVoltAlarm2Dly,
		kEep_ChgLCVoltAlarm2Rel,
		kEep_ChgLCVoltAlarm2RelDly,
		kEep_ChgLCVoltAlarm2Cur_Handle,
		kEep_ChgLCVoltAlarm3,
		kEep_ChgLCVoltAlarm3Dly,
		kEep_ChgLCVoltAlarm3Rel,
		kEep_ChgLCVoltAlarm3RelDly,
		kEep_ChgLCVoltAlarm3Cur_Handle,
		// 充电过流287
		kEep_ChgOverCurAlarm1,
		kEep_ChgOverCurAlarm1Dly,
		kEep_ChgOverCurAlarm1Rel,
		kEep_ChgOverCurAlarm1RelDly,
		kEep_ChgOverCurAlarm1Cur_Handle,
		kEep_ChgOverCurAlarm2,
		kEep_ChgOverCurAlarm2Dly,
		kEep_ChgOverCurAlarm2Rel,
		kEep_ChgOverCurAlarm2RelDly,
		kEep_ChgOverCurAlarm2Cur_Handle,
		kEep_ChgOverCurAlarm3,
		kEep_ChgOverCurAlarm3Dly,
		kEep_ChgOverCurAlarm3Rel,
		kEep_ChgOverCurAlarm3RelDly,
		kEep_ChgOverCurAlarm3Cur_Handle,
		// 温度过高317
		kEep_ChgHighTempAlarm1,
		kEep_ChgHighTempAlarm1Dly,
		kEep_ChgHighTempAlarm1Rel,
		kEep_ChgHighTempAlarm1RelDly,
		kEep_ChgHighTempAlarm1Cur_Handle,
		kEep_ChgHighTempAlarm2,
		kEep_ChgHighTempAlarm2Dly,
		kEep_ChgHighTempAlarm2Rel,
		kEep_ChgHighTempAlarm2RelDly,
		kEep_ChgHighTempAlarm2Cur_Handle,
		kEep_ChgHighTempAlarm3,
		kEep_ChgHighTempAlarm3Dly,
		kEep_ChgHighTempAlarm3Rel,
		kEep_ChgHighTempAlarm3RelDly,
		kEep_ChgHighTempAlarm3Cur_Handle,
		// 充电低温332
		kEep_ChgLowTempAlarm1,
		kEep_ChgLowTempAlarm1Dly,
		kEep_ChgLowTempAlarm1Rel,
		kEep_ChgLowTempAlarm1RelDly,
		kEep_ChgLowTempAlarm1Cur_Handle,
		kEep_ChgLowTempAlarm2,
		kEep_ChgLowTempAlarm2Dly,
		kEep_ChgLowTempAlarm2Rel,
		kEep_ChgLowTempAlarm2RelDly,
		kEep_ChgLowTempAlarm2Cur_Handle,
		kEep_ChgLowTempAlarm3,
		kEep_ChgLowTempAlarm3Dly,
		kEep_ChgLowTempAlarm3Rel,
		kEep_ChgLowTempAlarm3RelDly,
		kEep_ChgLowTempAlarm3Cur_Handle,
		// 充电压差347
		kEep_ChgHVDiffAlarm1,
		kEep_ChgHVDiffAlarm1Dly,
		kEep_ChgHVDiffAlarm1Rel,
		kEep_ChgHVDiffAlarm1RelDly,
		kEep_ChgHVDiffAlarm1Cur_Handle,
		kEep_ChgHVDiffAlarm2,
		kEep_ChgHVDiffAlarm2Dly,
		kEep_ChgHVDiffAlarm2Rel,
		kEep_ChgHVDiffAlarm2RelDly,
		kEep_ChgHVDiffAlarm2Cur_Handle,
		kEep_ChgHVDiffAlarm3,
		kEep_ChgHVDiffAlarm3Dly,
		kEep_ChgHVDiffAlarm3Rel,
		kEep_ChgHVDiffAlarm3RelDly,
		kEep_ChgHVDiffAlarm3Cur_Handle,
		// 充电温差362
		kEep_ChgHTDiffAlarm1,
		kEep_ChgHTDiffAlarm1Dly,
		kEep_ChgHTDiffAlarm1Rel,
		kEep_ChgHTDiffAlarm1RelDly,
		kEep_ChgHTDiffAlarm1Cur_Handle,
		kEep_ChgHTDiffAlarm2,
		kEep_ChgHTDiffAlarm2Dly,
		kEep_ChgHTDiffAlarm2Rel,
		kEep_ChgHTDiffAlarm2RelDly,
		kEep_ChgHTDiffAlarm2Cur_Handle,
		kEep_ChgHTDiffAlarm3,
		kEep_ChgHTDiffAlarm3Dly,
		kEep_ChgHTDiffAlarm3Rel,
		kEep_ChgHTDiffAlarm3RelDly,
		kEep_ChgHTDiffAlarm3Cur_Handle,
		// 绝缘低377
		kEep_LInsuAlarm1,
		kEep_LInsuAlarm1Dly,
		kEep_LInsuAlarm1Rel,
		kEep_LInsuAlarm1RelDly,
		kEep_LInsuAlarm1Cur_Handle,
		kEep_LInsuAlarm2,
		kEep_LInsuAlarm2Dly,
		kEep_LInsuAlarm2Rel,
		kEep_LInsuAlarm2RelDly,
		kEep_LInsuAlarm2Cur_Handle,
		kEep_LInsuAlarm3,
		kEep_LInsuAlarm3Dly,
		kEep_LInsuAlarm3Rel,
		kEep_LInsuAlarm3RelDly,
		kEep_LInsuAlarm3Cur_Handle,
		// T1高温 392
		kEep_HT1TempAlarm1Alarm1,
		kEep_HT1TempAlarm1Alarm1Dly,
		kEep_HT1TempAlarm1Alarm1Rel,
		kEep_HT1TempAlarm1Alarm1RelDly,
		kEep_HT1TempAlarm1Alarm1Cur_Handle,
		// T1低温//397
		kEep_LT1TempAlarm1,
		kEep_LT1TempAlarm1Dly,
		kEep_LT1TempAlarm1Rel,
		kEep_LT1TempAlarm1RelDly,
		kEep_LT1TempAlarm1Cur_Handle,
		// 电压排线
		kEep_VCableAlarm1,
		kEep_VCableAlarm1Dly,
		kEep_VCableAlarm1Rel,
		kEep_VCableAlarm1RelDly,
		kEep_VCableAlarm1Cur_Handle,
		// 温度排线
		kEep_TCableAlarm1,
		kEep_TCableAlarm1Dly,
		kEep_TCableAlarm1Rel,
		kEep_TCableAlarm1RelDly,
		kEep_TCableAlarm1Cur_Handle,
		// 主从通讯
		kEep_MSCommAlarm1,
		kEep_MSCommAlarm1Dly,
		kEep_MSCommAlarm1Rel,
		kEep_MSCommAlarm1RelDly,
		kEep_MSCommAlarm1Cur_Handle,
		// 供电欠压
		kEep_LSplVoltAlarm1,
		kEep_LSplVoltAlarm1Dly,
		kEep_LSplVoltAlarm1Rel,
		kEep_LSplVoltAlarm1RelDly,
		kEep_LSplVoltAlarm1Cur_Handle,
		// 供电过压
		kEep_HSplVoltAlarm1,
		kEep_HSplVoltAlarm1Dly,
		kEep_HSplVoltAlarm1Rel,
		kEep_HSplVoltAlarm1RelDly,
		kEep_HSplVoltAlarm1Cur_Handle,
		kEep_HighVoltDiffAlarm1, // 高压异常
		kEep_HighVoltDiffAlarm1Dly,
		kEep_HighVoltDiffAlarm1Rel,
		kEep_HighVoltDiffAlarm1RelDly,
		kEep_HighVoltDiffAlarm1Cur_Handle,
		kEep_CmdTimeoutAlarm,
		kEep_CmdTimeoutAlarmDly, // 指令超时时间
		// 430
		kEep_CmdTimeoutAlarmRel,
		kEep_CmdTimeoutAlarmRelDly,
		kEep_CmdTimeoutAlarmCur_Handle, // 指令超时降流+指令超时告警处理
		kEep_Di2_1Type,					// DI2 1策略
		kEep_Di4_3Type,					// DI4 3策略
		kEep_Di6_5Type,
		kEep_Di8_7Type,
		kEep_Di10_9Type,
		kEep_Di2_1Polarity, // DI2 1类型
		kEep_Di4_3Polarity, // DI4 3类型
		// 440
		kEep_Di6_5Polarity,
		kEep_Di8_7Polarity,
		kEep_Di10_9Polarity,
		kEep_Di2_1Delay, // DI2 1判定延迟 单位100ms
		kEep_Di4_3Delay, // DI4 3判定延迟 单位100ms
		kEep_Di6_5Delay,
		kEep_Di8_7Delay,
		kEep_Di10_9Delay,
		kEep_ChgDisChangeBasis_RelayOnOffMode, // 充放电转换依据(高)上下电模式（低）
		kEep_ChgDisMode_HighVoltStrategy,	   // 充放电模式选择 + 高压控制策略
		// 450
		kEep_InsuPeriod_Enable,		// 绝缘采集周期 单位:秒（高）+绝缘采集使能(低)
		kEep_ChgFstCurDownVolt,		// 充电末端一档降流电压
		kEep_ChgSndCurDownVolt,		// 充电末端二档降流电压
		kEep_ChgSnd_FstCurDownRate, // 充电末端二档（高）一档（低）降流系数
		kEep_ForbidChgVolt,			// 禁充电压阈值
		kEep_ForbidChgRelVolt,		// 禁充释放电压
		kEep_ForbidDisVolt,			// 禁放电压阈值
		kEep_ForbidDisRelVolt,		// 禁放释放电压
		kEep_SOHSeventyCycle,		// 70%容量衰减次数
		kEep_SOHSeventyCapL,		// 70%容量衰减累计容量低
		// 460
		kEep_SOHSeventyCapH,			// 70%容量衰减累计容量高
		kEep_Standby_LowVoltSleepDly,	// 待机(0.1day/bit) + 低压(1min/bit)休眠延时
		kEep_ForbidDisRelDelay,			// 禁放释放延迟
		kEep_ForbidChgRelDelay,			// 禁充释放延迟
		kEep_OcvStandbyCur_Time,		// OCV静置电流(0.1A/bit)+OCV静置时间(0.1h/bit)
		kEep_OcvDisRangeLower_Upper,	// OCV禁校上限(1%/bit)+下限(1%/bit)
		kEep_ForceChg1Volt,				// 强充1电压阈值
		kEep_ForceChg2Volt,				// 强充2电压阈值
		kEep_ForceChg2Cur_ForceChg1Cur, // 强充2_1请求电流
		kEep_DO2_DO1_ErrSrc,			// DO2_DO1故障检测源
		// 470
		kEep_DO4_DO3_ErrSrc, // DO4_DO3故障检测源
		kEep_DO6_DO5_ErrSrc, // DO6_DO5故障检测源
		kEep_DO8_DO7_ErrSrc, // DO8_DO7故障检测源
		kEep_Sop_OcvIndex,	 // SOP表索引 + OCV表索引

		// T2高温
		kEep_HT2TempAlarm1Alarm1,
		kEep_HT2TempAlarm1Alarm1Dly,
		kEep_HT2TempAlarm1Alarm1Rel,
		kEep_HT2TempAlarm1Alarm1RelDly,
		kEep_HT2TempAlarm1Alarm1Cur_Handle,
		// T2低温
		kEep_LT2TempAlarm1,
		kEep_LT2TempAlarm1Dly,
		kEep_LT2TempAlarm1Rel,
		kEep_LT2TempAlarm1RelDly,
		kEep_LT2TempAlarm1Cur_Handle,

		kEep_RatedChgPower, // 额定充电功率
		kEep_RatedDisPower, // 额定放电功率
		kEep_ACMode,		// 请求设定空调模式
		kEep_ACTemp,		// 请求设定空调温度

		kEep_FullDisAvgVolt,  // SOC过放校准电压值
		kEep_FullChgAvgVolt,  // SOC过充校准电压值
		kEep_L2HighCurCutDly, // 2级过流(0.1min/bit)切断延时
		// 极柱过温故障1级
		kEep_PoleHighTempAlarm1,
		kEep_PoleHighTempAlarm1Dly,
		kEep_PoleHighTempAlarm1Rel,
		kEep_PoleHighTempAlarm1RelDly,
		kEep_PoleHighTempAlarm1Cur_Handle,
		// 极柱过温故障2级
		kEep_PoleHighTempAlarm2,
		kEep_PoleHighTempAlarm2Dly,
		kEep_PoleHighTempAlarm2Rel,
		kEep_PoleHighTempAlarm2RelDly,
		kEep_PoleHighTempAlarm2Cur_Handle,
		// 极柱过温故障3级
		kEep_PoleHighTempAlarm3,
		kEep_PoleHighTempAlarm3Dly,
		kEep_PoleHighTempAlarm3Rel,
		kEep_PoleHighTempAlarm3RelDly,
		kEep_PoleHighTempAlarm3Cur_Handle,
		// 温升故障1级
		kEep_TempRiseAlarm1,
		kEep_TempRiseAlarm1Dly,
		kEep_TempRiseAlarm1Rel,
		kEep_TempRiseAlarm1RelDly,
		kEep_TempRiseAlarm1Cur_Handle,
		// 温升故障2级
		kEep_TempRiseAlarm2,
		kEep_TempRiseAlarm2Dly,
		kEep_TempRiseAlarm2Rel,
		kEep_TempRiseAlarm2RelDly,
		kEep_TempRiseAlarm2Cur_Handle,
		// 温升故障3级
		kEep_TempRiseAlarm3,
		kEep_TempRiseAlarm3Dly,
		kEep_TempRiseAlarm3Rel,
		kEep_TempRiseAlarm3RelDly,
		kEep_TempRiseAlarm3Cur_Handle,

		// 电池箱过压1级
		kEep_HighPackVoltAlarm1,
		kEep_HighPackVoltAlarm1Dly,
		kEep_HighPackVoltAlarm1Rel,
		kEep_HighPackVoltAlarm1RelDly,
		kEep_HighPackVoltAlarm1Cur_Handle,
		// 电池箱过压2级
		kEep_HighPackVoltAlarm2,
		kEep_HighPackVoltAlarm2Dly,
		kEep_HighPackVoltAlarm2Rel,
		kEep_HighPackVoltAlarm2RelDly,
		kEep_HighPackVoltAlarm2Cur_Handle,
		// 电池箱过压3级
		kEep_HighPackVoltAlarm3,
		kEep_HighPackVoltAlarm3Dly,
		kEep_HighPackVoltAlarm3Rel,
		kEep_HighPackVoltAlarm3RelDly,
		kEep_HighPackVoltAlarm3Cur_Handle,

		// 电池箱欠压1级
		kEep_LowPackVoltAlarm1,
		kEep_LowPackVoltAlarm1Dly,
		kEep_LowPackVoltAlarm1Rel,
		kEep_LowPackVoltAlarm1RelDly,
		kEep_LowPackVoltAlarm1Cur_Handle,
		// 电池箱欠压2级
		kEep_LowPackVoltAlarm2,
		kEep_LowPackVoltAlarm2Dly,
		kEep_LowPackVoltAlarm2Rel,
		kEep_LowPackVoltAlarm2RelDly,
		kEep_LowPackVoltAlarm2Cur_Handle,
		// 电池箱欠压3级
		kEep_LowPackVoltAlarm3,
		kEep_LowPackVoltAlarm3Dly,
		kEep_LowPackVoltAlarm3Rel,
		kEep_LowPackVoltAlarm3RelDly,
		kEep_LowPackVoltAlarm3Cur_Handle,

		kEep_FaultCntStart,
		kEep_FaultCnt1 = kEep_FaultCntStart,
		kEep_FaultCnt2,
		kEep_FaultCnt3,
		kEep_FaultCnt4,
		kEep_FaultCnt5,
		kEep_FaultCnt6,
		kEep_FaultCnt7,
		kEep_FaultCnt8,
		kEep_FaultCnt9,
		kEep_FaultCnt10,

		kEep_FaultCnt11,
		kEep_FaultCnt12,
		kEep_FaultCnt13,
		kEep_FaultCnt14,
		kEep_FaultCnt15,
		kEep_FaultCnt16,
		kEep_FaultCnt17,
		kEep_FaultCnt18,
		kEep_FaultCnt19,
		kEep_FaultCnt20,

		kEep_FaultCnt21,
		kEep_FaultCnt22,
		kEep_FaultCnt23,
		kEep_FaultCnt24,
		kEep_FaultCnt25,
		kEep_FaultCnt26,
		kEep_FaultCnt27,
		kEep_FaultCnt28,
		kEep_FaultCnt29,
		kEep_FaultCnt30,

		kEep_FaultCnt31,
		kEep_FaultCnt32,
		kEep_FaultCnt33,
		kEep_FaultCnt34,
		kEep_FaultCnt35,
		kEep_FaultCnt36,
		kEep_FaultCnt37,
		kEep_FaultCnt38,
		kEep_FaultCnt39,
		kEep_FaultCnt40,

		kEep_FaultCnt41,
		kEep_FaultCnt42,
		kEep_FaultCnt43,
		kEep_FaultCnt44,
		kEep_FaultCnt45,
		kEep_FaultCnt46,
		kEep_FaultCnt47,
		kEep_FaultCnt48,
		kEep_FaultCnt49,
		kEep_FaultCnt50,

		kEep_FaultCnt51,
		kEep_FaultCnt52,
		kEep_FaultCnt53,
		kEep_FaultCnt54,
		kEep_FaultCnt55,
		kEep_FaultCnt56,
		kEep_FaultCnt57,
		kEep_FaultCnt58,
		kEep_FaultCnt59,
		kEep_FaultCnt60,

		kEep_FaultCnt61,
		kEep_FaultCnt62,
		kEep_FaultCnt63,
		kEep_FaultCnt64,

		kEep_FullChgTotalVolt, // SOC过充校准电压值
		kEep_FullDisTotalVolt, // SOC过放校准电压值-----168
		kEep_SwitchEnable,
		kEep_EnTempChannel_NtcType,		// 环境温度检测通道 + 环境温度温感类型
		kEep_SwitchOffDly_BcuShuntTrip, // 分闸断开延时 + Bcu分励断开延时  0.1s
		kEep_Reserve_SafetyChainDly,	// 预留 + 安全链断开延时 0.1s
		kEep_FanFullSpeedTemp,			// 风扇全速温度
		kEep_CutOffCurrent,				// 断开继电器电流阈值 1A
		kEep_SOCRunMax_Min,				// SOC运行上限 + SOC运行下限
		kEep_Reserve_BmuSampleOrder,	// 从机采集顺序

		kEep_HasMsd_Polarity,				  // 是否存在MSD + MSD极性
		kEep_AfeNum_CellNum,		  	  	  // BMU的Afe数量 + 当前类型AFE支持的最大串数
		kEep_reserver_NtcNum,		  	  	  // 预留 + 当前类型AFE支持的最大NTC串数
		kEep_DataBanlenceStartVolt,			  // 均衡开启电压（mv）
		kEep_BalanceCloseVol,				  // 均衡关闭电压（mv）
		kEep_BalanceOpenVolDiff_CloseVolDiff, // 均衡开启压差（mv）+ 均衡关闭压差（mv）
		kEep_BalanceNum,					  // 均衡路数
		kEep_BalanceTime,					  // 均衡时间-ms
		kEep_Relay10_9Type, 				// 继电器10_9类型
		kEep_DO10_DO9_ErrSrc, 				// DO10_DO9故障检测源,
		kEep_FirstIAfe_CellPos,						// IC1电压采集有效位置1~16
		kEep_FirstIIAfe_CellPos,					// IC1电压采集有效位置17~32
		kEep_SecondIAfe_CellPos,					// IC2电压采集有效位置1~16
		kEep_SecondIIAfe_CellPos,					// IC2电压采集有效位置17~32
		kEep_ThirdIAfe_CellPos,						// IC3电压采集有效位置1~16
		kEep_ThirdIIAfe_CellPos,					// IC3电压采集有效位置17~32
		kEep_FourthAfe_CellPos,						// IC4电压采集有效位置1~16
		kEep_FourthIIAfe_CellPos,					// IC4电压采集有效位置17~32
		kEep_FirstIAfe_NtcPos,						// IC1温度采集有效位置1~16
		kEep_FirstIIAfe_NtcPos,						// IC1温度采集有效位置17~32
		kEep_SecondIAfe_NtcPos,						// IC2温度采集有效位置1~16
		kEep_SecondIIAfe_NtcPos,					// IC2温度采集有效位置17~32
		kEep_ThirdIAfe_NtcPos,						// IC3温度采集有效位置1~16
		kEep_ThirdIIAfe_NtcPos,						// IC3温度采集有效位置17~32
		kEep_FourthIAfe_NtcPos,						// IC4温度采集有效位置1~16
		kEep_FourthIIAfe_NtcPos,					// IC4温度采集有效位置17~32
		kEep_Reverse36,
		kEep_Reverse37,
		kEep_Reverse38,
		kEep_Reverse39,

		kEEData_Eth1IPAddr2_1,                          //网口1源IP地址2_1
		kEEData_Eth1IPAddr4_3,                          //网口1源IP地址4_3
		kEEData_Eth1Mask2_1,                            //网口1子网掩码2_1
		kEEData_Eth1Mask4_3,                            //网口1子网掩码4_3
		kEEData_Eth1Gate1Addr2_1,                       //网口1网关地址2_1          30
		kEEData_Eth1Gate1Addr4_3,                       //网口1网关地址4_3  
		kEep_Reverse46,
		kEep_Reverse47,
		kEep_Reverse48,
		kEep_Reverse49,

		kEep_GateDataStart,
		kEep_GateData0 = kEep_GateDataStart,
		kEep_GateData1,
		kEep_GateData2,
		kEep_GateData3,
		kEep_GateData4,
		kEep_GateData5,
		kEep_GateData6,
		kEep_GateData7,
		kEep_GateData8,
		kEep_GateData9,

		kEep_GateData10,
		kEep_GateData11,
		kEep_GateData12,
		kEep_GateData13,
		kEep_GateData14,
		kEep_GateData15,
		kEep_GateData16,
		kEep_GateData17,
		kEep_GateData18,
		kEep_GateData19,

		kEep_GateData20,
		kEep_GateData21,
		kEep_GateData22,
		kEep_GateData23,
		kEep_GateData24,
		kEep_GateData25,
		kEep_GateData26,
		kEep_GateData27,
		kEep_GateData28,
		kEep_GateData29,

		kEep_GateData30,
		kEep_GateData31,
		kEep_GateData32,
		kEep_GateData33,
		kEep_GateData34,
		kEep_GateData35,
		kEep_GateData36,
		kEep_GateData37,
		kEep_GateData38,
		kEep_GateData39,

		kEep_GateData40,
		kEep_GateData41,
		kEep_GateData42,
		kEep_GateData43,
		kEep_GateData44,
		kEep_GateData45,
		kEep_GateData46,
		kEep_GateData47,
		kEep_GateData48,
		kEep_GateData49,
		kEep_GateDataEnd = kEep_GateData49,

		// SOC
		kEep_StatDay_CycleTimesFlag, // 统计记录天+电池循环次数更新标志
		kEep_CycleTimes,			 // 电池循环次数
		kEep_SOC,					 // SOC 0.1%/bit
		kEep_SOE,

		kEep_DayChg_DisTime, // 日充放电累计时间0.1h/bit
		kEep_DayDisCapL,	 // 日放电累计容量0.1AH/bit
		kEep_DayDisCapH,
		kEep_DayDisEnergyL, // 日放电电量1s/bit
		kEep_DayDisEnergyH,
		kEep_DayChgCapL, 	// 日充电累计时间0.1AH/bit
		kEep_DayChgCapH,
		kEep_DayChgEnergyL, // 日充电电电量1s/bit
		kEep_DayChgEnergyH,
		kEep_AccDisTimeL, 	// 放电累计时间1s/bit
		kEep_AccDisTimeH,
		kEep_AccDisCapL, 	// 放电累计容量0.1AH/bit
		kEep_AccDisCapH,
		kEep_AccDisEnergyL, // 放电累计电量0.1AH/bit
		kEep_AccDisEnergyH,
		kEep_AccChgTimeL, 	// 充电累计时间1s/bit
		kEep_AccChgTimeH,
		kEep_AccChgCapL, 	// 充电累计容量0.1AH/bit
		kEep_AccChgCapH,
		kEep_AccChgEnergyL, // 放电累计电量0.1AH/bit
		kEep_AccChgEnergyH,
		kEep_PowerOffTimeL, // 下电时间1s/bit
		kEep_PowerOffTimeH,

		kEep_IsSoftReset,	// 是否软复位:
		kEep_TargetCurrent, // 目标电流
		kEep_TargetVolt,	// 目标电流
		kEep_ReservedDaynmic4,
		kEep_ReservedDaynmic5,
		kEep_ReservedDaynmic6,
		kEep_ReservedDaynmic7,
		kEep_ReservedDaynmic8,
		kEep_ReservedDaynmic9,
		kEep_ReservedDaynmic10,

		kRelay2_1ForceCtrlStatus,
		kRelay4_3ForceCtrlStatus,
		kRelay6_5ForceCtrlStatus,
		kRelay8_7ForceCtrlStatus,
		kRelay10_9ForceCtrlStatus, // sfj 7.23 添加
		kEEDataIdx_End,
	} EEDataIdx;

	typedef enum
	{
		kR485BaudRateStart,
		kR485_4800 = kR485BaudRateStart,
		kR485_9600,
		kR485_19200,
		kR485_38400,
		kR485_115200,
		kR485BaudRateEnd,

	} R485BaudRate;

	// CAN波特率
	typedef enum
	{
		kCanBaudRateStart,
		kCAN_125kbps = kCanBaudRateStart,
		kCAN_250kbps,
		kCAN_500kbps,
		kCAN_1000kbps,
		kCanBaudRateEnd,
	} CanBaudRate;

	typedef enum
	{
		kCusrTypeStart,
		kCurType_Shunt = kCusrTypeStart,
		kCurType_Single,
		kCurType_Double,
		kCurType_Single_Base,
		kCurTypeEnd,
	} CurType;

	typedef enum
	{
		kCurScaleStart,
		kCurScale_50 = kCurScaleStart,
		kCurScale_100,
		kCurScale_150,
		kCurScale_200,
		kCurScale_300,
		kCurScale_400,
		kCurScale_500,
		kCurScale_600,
		kCurScale_750,
		kCurScale_800,
		kCurScale_1000,
		kCurScaleTypeEnd,
	} CurSenScale;

	typedef enum
	{
		kSoftReset_Wdog = 1,
		kSoftReset_CmdCtrl,
		kSoftReset_HardFault,
	} SoftReset;

	void bms_init_eeprom(void);
	void bms_pwr_off_save(void);
	void bms_soft_reset_save(SoftReset type, uint8_t *buf, uint16_t len);

#ifdef __cplusplus
}
#endif

#endif
