CELIS/HARDWARE/DEV_HAL/kC_Features.c

90 lines
2.0 KiB
C
Raw Normal View History

2024-08-09 06:24:48 +00:00
#include "kC_Features.h"
#include "Filtering.h"
void Signal_Filtering()
{
bool AC_State = READ_AC_YX1();
bool DC_State = READ_DC_YX2();
bool CHECJ_State = READ_HV_DSG_CHECJ();
bool CHECJ_2_State = READ_HV_DSG_CHECJ_2();
DCU_SendState.AC_Relay_State_Filter = FilteringScan(&ContinuousFiltering[AC_Back_Check_Filter],&AC_State);
DCU_SendState.DC_Relay_State_Filter = FilteringScan(&ContinuousFiltering[DC_Back_Check_Filter],&DC_State);
DCU_SendState.HV_DSG_CHECJ_Signal_Filter = FilteringScan(&ContinuousFiltering[HV_DSG_CHECJ_Filter],&CHECJ_State);
DCU_SendState.HV_DSG_CHECJ_2_Signal_Filter = FilteringScan(&ContinuousFiltering[HV_DSG_CHECJ_2_Filter],&CHECJ_2_State);
}
void KCAC_ON_GPIO(void)
{
KC_ReSet_GPIO(&GetDEVICE_Name(ELS_OFF));
KC_Set_GPIO(&GetDEVICE_Name(ELS_ON));
}
void KCAC_OFF_GPIO(void)
{
KC_ReSet_GPIO(&GetDEVICE_Name(ELS_ON));
KC_Set_GPIO(&GetDEVICE_Name(ELS_OFF));
}
void KCAC_ReSet_GPIO(void)
{
KC_ReSet_GPIO(&GetDEVICE_Name(ELS_ON));
KC_ReSet_GPIO(&GetDEVICE_Name(ELS_OFF));
}
void KC_ACtEXT_Open(void)
{
KC_Set_GPIO(&GetDEVICE_Name(ELS_ON));
KC_Set_GPIO(&GetDEVICE_Name(ELS_OFF));
printf("AC ȫ<><C8AB>");
}
void KC_ACtEXT_Close(void)
{
KC_ReSet_GPIO(&GetDEVICE_Name(ELS_ON));
KC_ReSet_GPIO(&GetDEVICE_Name(ELS_OFF));
printf("AC ȫ<><C8AB>");
}
void CLOSE_AC_RELAY()
{
// OPEN_12VPowerRealy();
KCAC_OFF_GPIO();//<2F><><EFBFBD><EFBFBD><EFBFBD>̵<EFBFBD><CCB5><EFBFBD><EFBFBD>Ͽ<EFBFBD>
Delay_MS(100);
KCAC_ReSet_GPIO();
DCU_SendState.AC_Relay_State = 1;
printf("CLOSE_ACRealy\r\n");
}
void OPEN_AC_RELAY()
{
// CLOSE_12VPowerRealy();
KCAC_ON_GPIO();//<2F><><EFBFBD><EFBFBD><EFBFBD>̵<EFBFBD><CCB5><EFBFBD><EFBFBD>պ<EFBFBD>
Delay_MS(100);
KCAC_ReSet_GPIO();
DCU_SendState.AC_Relay_State = 0;
printf("OPEN_ACRealy\r\n");
}
//<2F><><EFBFBD><EFBFBD> <20><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>· 2024-01-21
void OPEN_12VPowerRealy(void)
{
KC_Set_GPIO(&GetDEVICE_Name(ELS_ON));
Delay_MS(1);
KC_Set_GPIO(&GetDEVICE_Name(ELS_OFF));
Delay_MS(500);
KC_ReSet_GPIO(&GetDEVICE_Name(ELS_OFF));
}
void CLOSE_12VPowerRealy(void)
{
KC_ReSet_GPIO(&GetDEVICE_Name(ELS_ON));
Delay_MS(1);
KC_Set_GPIO(&GetDEVICE_Name(ELS_OFF));
Delay_MS(500);
KC_ReSet_GPIO(&GetDEVICE_Name(ELS_OFF));
}