From bcb31a7c5a09936ad11bf5bb7158bbb3bef783c5 Mon Sep 17 00:00:00 2001 From: ahu_gq Date: Fri, 7 Feb 2025 17:30:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96DIDO=E7=AD=96=E7=95=A5?= =?UTF-8?q?=E6=9C=89=E4=B8=8A=E4=BD=8D=E6=9C=BA=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/stm32fxxx_app/app/dido_manager.h | 23 +++++++++++++++++++++++ app/stm32fxxx_app/app/logic_ctrl.c | 19 ++++++++++++++++++- app/stm32fxxx_app/app/logic_di.c | 26 ++++++++++++++++++++++---- 3 files changed, 63 insertions(+), 5 deletions(-) diff --git a/app/stm32fxxx_app/app/dido_manager.h b/app/stm32fxxx_app/app/dido_manager.h index d8292eb..0879385 100644 --- a/app/stm32fxxx_app/app/dido_manager.h +++ b/app/stm32fxxx_app/app/dido_manager.h @@ -31,6 +31,8 @@ typedef enum kDoCtrlStatus_End, }DoCtrlStatus; +/*0-无;1-预充;2-总正;3-总负;4-充电;5-放电;6-加热;7-制冷;8-运行灯1;9-运行灯2;10-运行灯3; +11-告警灯1,12-告警灯2,13-告警灯3,14-分励1,15-分励2,16-分励3,17-分励4(支持配置扩展)*/ typedef enum { kDoType_Start = 0, @@ -40,6 +42,18 @@ typedef enum kDoType_PreChg, //3 kDoType_Positive, //4 kDoType_Negative,//5 + kDoType_Cool, + kDoType_Heat, + kDoType_RunLed1, + kDoType_RunLed2, + kDoType_RunLed3, + kDoType_AlarmLed1, + kDoType_AlarmLed2, + kDoType_AlarmLed3, + kDoType_Trip1, + kDoType_Trip2, + kDoType_Trip3, + kDoType_Trip4, kDoType_End, }DoType; @@ -79,6 +93,15 @@ typedef enum kDiType_Do6Feedback, kDiType_Do7Feedback, kDiType_Do8Feedback, + kDiType_Door,//门禁 + kDiType_Water,//水浸 + kDiType_Fuse,//保险丝故障信号 + kDiType_Pcs,//PCS故障信号 + kDiType_AirCon,//空调故障信号 + kDiType_Trip,//隔离开关反馈信号 + kDiType_AirCheck,//气体检测故障信号 + kDiType_Ups,//UPS故障信号 + kDiType_Ems,//EMS故障信号 kDiType_End }DiType; diff --git a/app/stm32fxxx_app/app/logic_ctrl.c b/app/stm32fxxx_app/app/logic_ctrl.c index d9bed3a..995e570 100644 --- a/app/stm32fxxx_app/app/logic_ctrl.c +++ b/app/stm32fxxx_app/app/logic_ctrl.c @@ -17,7 +17,24 @@ const DoLogic bmsCircuitCtrl[kDoCtrlStrategy_End] = const DoLogic doLogicArray[kDoType_End] = { - NULL, NULL, NULL, NULL, NULL, NULL + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + logic_do_cool1_ctrl, + logic_do_heat1_ctrl, + logic_do_run1_led_ctrl, + logic_do_run1_led_ctrl, + logic_do_run1_led_ctrl, + logic_do_alarm1_led_ctrl, + logic_do_alarm1_led_ctrl, + logic_do_alarm1_led_ctrl, + logic_do_trip1_ctrl, + logic_do_trip1_ctrl, + logic_do_trip1_ctrl, + logic_do_trip1_ctrl //17 }; diff --git a/app/stm32fxxx_app/app/logic_di.c b/app/stm32fxxx_app/app/logic_di.c index 08c5ec8..71b27eb 100644 --- a/app/stm32fxxx_app/app/logic_di.c +++ b/app/stm32fxxx_app/app/logic_di.c @@ -98,13 +98,31 @@ void ord_di_breaker1_fun(uint32_t base_time, DiStatus di_signal, DiType di) } } - +/*无,消防1,消防2,消防3,DO1反馈信号,DO2反馈信号,DO3反馈信号,DO4反馈信号,DO5反馈信号, +DO6反馈信号,门禁,水浸,保险丝故障信号,PCS故障信号,空调故障信号,隔离开关反馈信号,气体检测故障信号, +UPS故障信号,EMS故障信号,*/ //DI策略对应函数,注意应与枚举DiStrategy顺序一致 const DiFun di_func[kDiType_End]= { NULL, - NULL, - NULL, - NULL, + ord_di_emerge_stop_func, //急停, + ord_di_fire_alarm1_func,//消防1 + ord_di_fire_alarm1_func,//消防2 + ord_di_fire_alarm1_func,//消防3 + ord_di_do_feedback_func,//DO1反馈信号 + ord_di_do_feedback_func,//DO2反馈信号 + ord_di_do_feedback_func,//DO3反馈信号 + ord_di_do_feedback_func,//DO4反馈信号 + ord_di_do_feedback_func,//DO5反馈信号 + ord_di_do_feedback_func,//DO6反馈信号 + NULL,//门禁 + ord_di_water1_fun,//水浸 + ord_di_fuse1_fun,//保险丝故障信号 + NULL,//PCS故障信号 + NULL,//空调故障信号 + NULL,//隔离开关反馈信号 + NULL,//气体检测故障信号 + NULL,//UPS故障信号 + NULL//EMS故障信号 };