#ifndef BMS_SIGNAL_H_
#define BMS_SIGNAL_H_

#ifdef __cplusplus
extern "C" {
#endif 

#include <stdint.h>

//gary @update 20240718 删除多余的DI，目前有6路，分别三路低有效，三路高有效
typedef enum
{
    kSignalIdx_DiStart,
    kSignalIdx_Di1 = kSignalIdx_DiStart,
    kSignalIdx_Di2,
    kSignalIdx_Di3,
    kSignalIdx_Di4,
    kSignalIdx_Di5,
    kSignalIdx_Di6,
	kSignalIdx_Di7,
	kSignalIdx_Di8,
	kSignalIdx_Di9,
	kSignalIdx_Di10,
	kSignalIdx_Di11,
	kSignalIdx_Di12,
    kSignalIdx_DiEnd,
    
    kSignalIdx_On = kSignalIdx_DiEnd,
    kSignalIdx_Ready,
    kSignalIdx_CC,
    kSignalIdx_CC2,
    
    kSignalIdx_ChgCur,
    kSignalIdx_DisCur,
    kSignalIdx_HTPoint1, //电压故障判断温度分界点1
	
    kSignalIdx_Heat,
    kSignalIdx_Cool,
    
    kSignalIdx_LowVoltSleep,
    kSignalIdx_StandbySleep,

    kSignalIdx_ForbidDis,    

    kSignalIdx_ForbidChg,
    kSignalIdx_Chg1stCurDown,
    kSignalIdx_Chg2ndCurDown,    
    
    kSignalIdx_AddrIn,
    kSignalIdx_AddrOut,
    kSignalIdx_SocFull,
    kSignalIdx_SocEmpty,
    kSignalIdx_BsuCtrlIso,
    
//    kSignalIdx_Cool2,
//    kSignalIdx_Auto,
   
    kSignalIdx_End,
}SignalIdx;

typedef enum
{
    kSignalStatus_Low,
    kSignalStatus_High,
	kSignalStatus_Err,
	kSignalStatus_End,
}SignalStatus;

void bms_init_signal(void);
void bms_poll_signal(uint32_t base_time);
uint32_t bms_get_signal_flag(void);
void bms_set_signal(SignalIdx idx, SignalStatus st);
SignalStatus bms_get_signal(SignalIdx idx);
#ifdef __cplusplus
}
#endif

#endif
