CELIS/HARDWARE/DEV_HAL/kC_Features.h
2024-08-09 14:24:48 +08:00

158 lines
3.2 KiB
C

#ifndef __KC_FEATURES_H__
#define __KC_FEATURES_H__
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "sys.h"
#include "CDZ_State.h"
#include "KC.h"
#ifndef __STATIC_INLIN
#define __STATIC_INLIN static __inline
#endif
void OPEN_AC_RELAY(void);
void CLOSE_AC_RELAY(void);
void KC_ACtEXT_Open(void);
void KC_ACtEXT_Close(void);
void OPEN_12VPowerRealy(void);
void CLOSE_12VPowerRealy(void);
void Signal_Filtering(void);
//直流继电器
__STATIC_INLIN bool OPEN_DC_RELAY(void)
{
DCU_SendState.DC_Relay_State = 1;
printf("OPEN_DCRealy\r\n");
return KC_Set_GPIO(&GetDEVICE_Name(KC1));
}
__STATIC_INLIN bool CLOSE_DC_RELAY(void)
{
DCU_SendState.DC_Relay_State = 0;
printf("CLOSE_DCRealy\r\n");
return KC_ReSet_GPIO(&GetDEVICE_Name(KC1));
}
//高压模块输出继电器
__STATIC_INLIN bool OPEN_HV_RELAY(void)
{
return KC_Set_GPIO(&GetDEVICE_Name(KC2));
}
__STATIC_INLIN bool CLOSE_HV_RELAY(void)
{
return KC_ReSet_GPIO(&GetDEVICE_Name(KC2));
}
//CC1-CP继电器
__STATIC_INLIN bool OPEN_CC1_CP_RELAY(void)
{
DCU_SendState.CP_CC1_State = 1;
return KC_Set_GPIO(&GetDEVICE_Name(KC3));
}
__STATIC_INLIN bool CLOSE_CC1_CP_RELAY(void)
{
DCU_SendState.CP_CC1_State = 0;
return KC_ReSet_GPIO(&GetDEVICE_Name(KC3));
}
//主从芯片切换电阻采样
__STATIC_INLIN bool OPEN_32_L0_RELAY(void)
{
return KC_Set_GPIO(&GetDEVICE_Name(KC4));
}
__STATIC_INLIN bool CLOSE_32_L0_RELAY(void)
{
return KC_ReSet_GPIO(&GetDEVICE_Name(KC4));
}
//辅助升压
__STATIC_INLIN bool OPEN_AUXI_BOOT(void)
{
return KC_Set_GPIO(&GetDEVICE_Name(KC5));
}
__STATIC_INLIN bool CLOSE_AUXI_BOOT(void)
{
return KC_ReSet_GPIO(&GetDEVICE_Name(KC5));
}
//CC2-CC继电器
__STATIC_INLIN bool OPEN_CC2_CC_RELAY(void)
{
DCU_SendState.CC_CC2_State = 1;
return KC_Set_GPIO(&GetDEVICE_Name(KC8));
}
__STATIC_INLIN bool CLOSE_CC2_CC_RELAY(void)
{
DCU_SendState.CC_CC2_State = 0;
return KC_ReSet_GPIO(&GetDEVICE_Name(KC8));
}
//枪座温度
__STATIC_INLIN bool OPEN_GUN_TEMP_RELAY(void)
{
DCU_SendState.L_Relay_State = 1;
return KC_Set_GPIO(&GetDEVICE_Name(KC9));
}
__STATIC_INLIN bool CLOSE_GUN_TEMP_RELAY(void)
{
DCU_SendState.L_Relay_State = 0;
return KC_ReSet_GPIO(&GetDEVICE_Name(KC9));
}
//电源域3.3V,灯,蓝牙
__STATIC_INLIN bool OPEN_PW3_3V(void)
{
return KC_Set_GPIO(&GetDEVICE_Name(PW3_3V));
}
__STATIC_INLIN bool CLOSE_PW3_3V(void)
{
return KC_ReSet_GPIO(&GetDEVICE_Name(PW3_3V));
}
//5V电源域
__STATIC_INLIN bool OPEN_PW5V(void)
{
return KC_Set_GPIO(&GetDEVICE_Name(PW5V));
}
__STATIC_INLIN bool CLOSE_PW5V(void)
{
return KC_ReSet_GPIO(&GetDEVICE_Name(PW5V));
}
//运行指示灯
__STATIC_INLIN bool OPEN_MCU_RUN(void)
{
return KC_Set_GPIO(&GetDEVICE_Name(MCU_RUN));
}
__STATIC_INLIN bool CLOSE_MCU_RUN(void)
{
return KC_ReSet_GPIO(&GetDEVICE_Name(MCU_RUN));
}
//高压互锁检测
__STATIC_INLIN enum KC_state READ_HV_DSG_CHECJ(void)
{
return KC_Read_GPIO(&GetDEVICE_Name(HV_DSG_CHECJ));
}
__STATIC_INLIN enum KC_state READ_HV_DSG_CHECJ_2(void)
{
return KC_Read_GPIO(&GetDEVICE_Name(HV_DSG_CHECJ_2));
}
//交流回检信号
__STATIC_INLIN enum KC_state READ_AC_YX1(void)
{
return KC_Read_GPIO(&GetDEVICE_Name(YX1));
}
//直流回检信号
__STATIC_INLIN enum KC_state READ_DC_YX2(void)
{
return KC_Read_GPIO(&GetDEVICE_Name(YX2));
}
#endif