接入温湿度风扇产品固件(仲裁/条件/定时/显示),并补齐规格书与外设驱动

新增 usr_app 产品逻辑:手动>定时>条件仲裁、条件控温湿、定时任务、数码管显示、
按键/LED、风扇档位、NVM 掉电恢复、配对与开关机,上电按规格恢复上次状态。
新增 usr_periph:AHT20、CT1642、板级引脚与硬件封装;见宝协议 cond_config
改为 7 字节编解码,并接入产品 DP。
补充《温湿度风扇_固件需求规格书》,工程加入对应源文件。
.gitignore 忽略 WorkBuddy/Cursor 本地会话
This commit is contained in:
2026-08-31 15:17:27 +08:00
parent 4cb7418a02
commit 5cc7e9dbd6
53 changed files with 7028 additions and 513 deletions
+51
View File
@@ -0,0 +1,51 @@
/******************************************************************************
* @file app_cond.h
* @brief CBR3 条件引擎(P2):7 组 7 字节条件,比较成立满时长触发模式
* @author cyWu <1917507415@qq.com>
* @date 2026.08.29
* @version V1.0.0
* @history
* - V1.0.0, 2026.08.29, cyWu, 首次发布(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_loop500ms,任务上下文)调用,
* 与仲裁器/定时引擎同侧;不放在 20ms usr_timer_tick(中断上下文)。
******************************************************************************/
#ifndef __APP_COND_H__
#define __APP_COND_H__
#include <stdint.h>
/**
* @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__ */