#ifndef __CCU_DEFINE_H__
#define __CCU_DEFINE_H__

/*
***************************************************************************************************************
**  DJ300KW_V1.0.0，生产有6块板子
**              2块集成到展览会的展机中
**              2块集成到厂房的调试机中
**              1块送谢尔调试PLC模块
**              1块在调试内核驱动等
**  DJ300KW_V1.2.1，修复了DJ300KW_V1.0.0的bug，计划生成5块
***************************************************************************************************************
*/

typedef enum LEDID
{
    LED_RED = 0,
    LED_BLUE,
    LED_GREEN
}LEDID_t;

typedef enum CCSX_CP_STATE
{
    CCSX_CP_STATE_UNKNOW = 0,
    CCSX_CP_STATE_A1,
    CCSX_CP_STATE_A2,
    CCSX_CP_STATE_B1,
    CCSX_CP_STATE_B2,
    CCSX_CP_STATE_C1,
    CCSX_CP_STATE_C2,
    CCSX_CP_STATE_D1,
    CCSX_CP_STATE_D2,
    CCSX_CP_STATE_E,
    CCSX_CP_STATE_F,
}CCSX_CP_STATE_t;

typedef enum gun_type
{
    GUN_TYPE_NACS = 0,
    GUN_TYPE_CCS1,
    GUN_TYPE_CCS2,
    GUN_TYPE_CHADEMO,
    GUN_TYPE_GBDC,
    GUN_TYPE_ChaoJJ,
    GUN_TYPE_MCSHH,
}gun_type_t;

typedef enum gun_state
{ 
    GUN_NORMAL,             // 枪归位枪座
    GUN_PLUGOUT,            // 拔枪，准备联车
    GUN_PLUGIN,             // 插枪，枪已联车
    GUN_STARTUP,            // 开始界面，启动充电
    GUN_ELOCKED,            // 电子锁已上锁

    GUN_AUTHORIZED,         // 鉴权成功标志（接触卡鉴权，扫描鉴权，POS机鉴权，PNC鉴权）
    GUN_PARAMETERS,         // 参数配置
    GUN_INSULATION,         // 绝缘检测
    GUN_PRECHARGE,          // 预充中

    GUN_CHARGING,           // 充电中
    GUN_SUSPEND,            // 充电挂起状态（暂停充电）
    GUN_STOPPING,           // 充电已完成，未拔枪
    GUN_UNKNOW,             // 其他未知状态

    GUN_SLACOK = GUN_ELOCKED,// PLC准备好
} gun_state_t;

typedef enum alarm_state
{
    CCU_NO_ERROR = 0,
    CCU_BOX_OVERTEMP = 0x80000000,
    CCU_SMOKE_ALARM,
    CCU_LGPTA_ALARM,
    CCU_LGPTB_ALARM,

    CCU_FANA_ALARM,
    CCU_FANB_ALARM,
    CCU_FANC_ALARM,
    CCU_LIQC_ALARM,

    CCU_EMG_STOP,
    CCU_WAT_STOP,
    CCU_GAT_STOP,
    CCU_HPUMP_ALARM,

    GUN_FUSE_ALARM,         // 熔断器报警
    GUN_ELECLOCK_STALL,     // 电子锁堵转
    GUN_CONTACTOR_FAULT,    // 接触器失效
    GUN_LINE_OVERTEMP,      // 枪线过温

    GUN_LINE_WARNING,       // 枪线即将过温警告
    GUN_HANDSHAKE_FAULT,
    
    GUN_PARAMETERS_FAULT,   // 参数配置失败
    GUN_INSULATION_FAULT,   // 绝缘检测失败
    GUN_PRECHARGE_FAULT,    // 预充过程失败
    GUN_CHARGING_FAULT,     // 充电过程失败

    BMS_VOLTAGE_INVERSE,    // 车端电池反接
    BMS_CONTACTOR_FAULT,
    BMS_VOLTAGE_MISTACH,
    BMS_CURRENT_MISTACH,

    GBDC_CAN_OFFLINE,
    CCSX_HLC_OFFLINE,
    CCSX_STATE_ERROR,
    
    GUN_INOPERAVIVE,        // 充电枪不可操作
    GUN_RESERVED,            // 预约占用中，请预约者刷卡（扫码）启动交易
    CAN_BEM_TIMEOUT,
    CCS_AUTHORIZATE_TIMEOUT,
    ERROR_MAX_NUMBER,
}alarm_state_t;



#endif//__CCU_DEFINE_H__
