/****************************************************************************** * @file app_cond.h * @brief CBR3 条件引擎(P2):7 组 7 字节条件,比较成立满时长触发模式 * @author cyWu <1917507415@qq.com> * @date 2026.08.29 * @version V1.0.0,首次发布(P0 仅接口与 stub) * * @note P2 实现(BOARD_COND_ENABLE=1)。字节布局见规格书 10.2: * Byte0=使能 Byte1-2=温度阈值(int16 大端 ×10) Byte3=湿度阈值 * Byte4=持续分钟(0=立即) Byte5=动作模式 Byte6=Bit7-5 温度比较 / * Bit4-2 湿度比较 / Bit1-0 保留。比较编码:1=< 2=<= 3-== 4->= 5-> * 0/6/7=无条件;两侧都无条件=无效组;两侧有效=AND。 * ⚠ app_cond_run 由 usr_timer_loop(500ms,任务上下文)调用, * 与仲裁器/定时引擎同侧;不放在 20ms usr_timer_tick(中断上下文)。 ******************************************************************************/ #ifndef __APP_COND_H__ #define __APP_COND_H__ #include /** * @brief 初始化条件引擎 * @return 无 */ void app_cond_init(void); /** * @brief 推进条件引擎,每个业务 tick 调用一次 * @param dt 距上次调用的毫秒数 * @return 无 */ void app_cond_run(uint16_t dt); /** * @brief APP 写 DP5 条件总开关 * @param en 0=关,1=开 * @return 无 */ void app_cond_set_en(uint8_t en); /** * @brief APP 写 DP6~12 条件配置(7 字节) * @param idx 1~7 * @return 无 */ void app_cond_set_config(uint8_t idx); #endif /* __APP_COND_H__ */