/******************************************************************************
 * @file      bmu_comm_data.h
 * @brief     bmu comm header file
 * @version   V1.0
 * @author    Gary 2024-11-13
 * @copyright    
 ******************************************************************************/
#ifndef BMU_COMM_DATA_H_
#define BMU_COMM_DATA_H_

#ifdef __cplusplus
extern "C" {
#endif 
#include "kit_macro.h"
	
#define BMU_MAX_NUM				(25u)
#define BMU_MAX_CELL_NUM        (420)
#define BMU_MAX_TEMP_NUM        (420 + 80)

#define BCU_IC_MAX_NUM 100              //total ic max num of all bmu
#define BMU_MAX_IC_NUM 4                //ic max num of every bmu


#define IC_MAX_CELL_NUM 18             //max cell num of every IC
#define IC_MAX_NTC_NUM 9              //max NTC num of every IC

#define IC_CROSS_CELL_VOLT 500         //unit is mv
#define IC_CROSS_TEMP_FLOAT 2000       //ntc floating volt value

typedef enum
{
	BMU_18_TYPE,
	BMU_22_TYPE
} BMU_TYPE_E;
	
typedef enum
{
	kBmuStatus_VoltCable, //0
	kBmuStatus_TempCable,
	kBmuStatus_BtTempCable,
	kBmuStatus_AfeFault,
	kBmuStatus_EEprom,
	kBmuStatus_AddrDo,//5
	kBmuStatus_AddrDi,
    kBmuStatus_Relay,
    kBmuStatus_FanSt,
    kBmuStatus_SW,
	kBmuStatus_HBTemp,//10
	kBmuStatus_BVoltDiff,
	kBmuStatus_BLowVolt,
    kBmuStatus_BComm,
    kBmuStatus_Online,//14
	kBmuStatus_End,
}BmuStatus;

typedef enum
{
    kBmuStatistic_MaxVolt,
    kBmuStatistic_MaxVoltIdx,
    kBmuStatistic_MinVolt,
    kBmuStatistic_MinVoltIdx,
    kBmuStatistic_AvgVolt,
	kBmuStatistic_TotalVolt,
	
    kBmuStatistic_MaxTemp,    
    kBmuStatistic_MaxTempIdx,
    kBmuStatistic_MinTemp,
    kBmuStatistic_MinTempIdx,
    kBmuStatistic_AvgTemp,
	kBmuStatistic_TotalTemp,
	
    kBmuStatistic_End,
}BmuStatisticData;

typedef enum
{
    kBmuData_CellNum,
    kBmuData_TempNum,
    kBmuData_Status,
    kBmuData_SoftVer,
    kBmuData_HardVer,
    kBmuData_ProductNum,
    kBmuData_End,
}BmuData;

typedef enum
{
    kBmuFaultBit_Afe,
    kBmuFaultBit_EEprom,
    kBmuFaultBit_Offline,
    kBmuFaultBit_VoltCable,
    kBmuFaultBit_TempCable,
    kBmuFaultBit_Msd,
    kBmuFaultBit_End,
}BmuFaultBit;

typedef enum
{
    kBmuStep_ReqInfo,
    kBmuStep_AdaptAddr,
    kBmuStep_AdaptCross,
    kBmuStep_Wait,
    kBmuStep_End,
}BmuStep;


#ifdef __cplusplus
}
#endif

#endif
