/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : fault_probe.h * @brief : 故障检测控制头文件 * @version : 1.0 * @changelog : version 1.0 初始版本 2025.11.13 ****************************************************************************** * @attention * * Copyright (c) 2025 Yuwell Software Danyang.Jiangsu.China * THIS SOFTWARE is licensed under the Mulan PSL v1. * can use this software according to the terms and conditions of the Mulan PSL v1. * You may obtain a copy of Mulan PSL v1 at: * http://license.coscl.org.cn/MulanPSL * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. * See the Mulan PSL v1 for more details. * ****************************************************************************** */ /* USER CODE END Header */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __FAULT_PROBE_H #define __FAULT_PROBE_H #ifdef __cplusplus extern "C" { #endif #include #include "fm33lg0xx_fl.h" #include "fm33lg0xx_queue.h" #include "fm33lg0xx_event.h" #define O2_90_PERCENT_BOUNDARY (900) #define O2_83P5_PERCENT_BOUNDARY (835) #define LL_FLOW_BOUNDARY (3) #define BEEP_GPIO_PORT GPIOB #define BEEP_GPIO_PIN FL_GPIO_PIN_10 #define BEEP_LIGHT_GPIO_PORT GPIOB #define BEEP_LIGHT_GPIO_PIN FL_GPIO_PIN_11 typedef enum { NO_HAPPEN, YES_HAPPEND } FaultHappend; // 单个故障的信息结构体 typedef struct { uint16_t elec_low_boundary; uint16_t elec_high_boundary; uint16_t ntc_low_boundary; uint16_t ntc_high_boundary; uint16_t press_low_boundary; uint16_t press_high_boundary; uint16_t net220v_low_boundary; uint16_t net220v_high_boundary; FaultHappend e1_press_low_state; FaultHappend e2_press_high_state; FaultHappend e3_elec_low_state; FaultHappend e4_elec_high_state; FaultHappend e5_ntc_high_state; FaultHappend e7_net220v_low_state; FaultHappend ll_flow_low_state; // 低流量报警 FaultHappend O2_900_low_state; // 氧浓度低于90%故障 FaultHappend O2_835_low_state; // 氧浓度低于83.5%故障 } FaultInfo; #define BEEP_ON FL_GPIO_SetOutputPin(BEEP_GPIO_PORT,BEEP_GPIO_PIN); #define BEEP_OFF FL_GPIO_ResetOutputPin(BEEP_GPIO_PORT,BEEP_GPIO_PIN); #define BEEP_LIGHT_ON FL_GPIO_SetOutputPin(BEEP_LIGHT_GPIO_PORT,BEEP_LIGHT_GPIO_PIN); void fault_array_init(void); void fault_process_task(void); #ifdef __cplusplus } #endif #endif /* __FAULT_PROBE_H */ /************************ (C) COPYRIGHT Yuwell *****END OF FILE****/