Files
JBao_Temp_Humi_Fan_FW/apps/usr_app/app_led.h
T
wuchuyuan 5cc7e9dbd6 接入温湿度风扇产品固件(仲裁/条件/定时/显示),并补齐规格书与外设驱动
新增 usr_app 产品逻辑:手动>定时>条件仲裁、条件控温湿、定时任务、数码管显示、
按键/LED、风扇档位、NVM 掉电恢复、配对与开关机,上电按规格恢复上次状态。
新增 usr_periph:AHT20、CT1642、板级引脚与硬件封装;见宝协议 cond_config
改为 7 字节编解码,并接入产品 DP。
补充《温湿度风扇_固件需求规格书》,工程加入对应源文件。
.gitignore 忽略 WorkBuddy/Cursor 本地会话
2026-08-31 15:17:27 +08:00

66 lines
1.6 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/******************************************************************************
* @file app_led.h
* @brief CBR3 灯效:单灯 PC2OTA/配对/常亮按优先级
* @author cyWu <1917507415@qq.com>
* @date 2026.08.29
* @version V1.0.0
* @history
* - V1.0.0, 2026.08.29, cyWu, 首次发布(移植门夹,删红绿双通道/充电/低电)
******************************************************************************/
#ifndef __APP_LED_H__
#define __APP_LED_H__
#include <stdint.h>
typedef enum {
APP_LED_OK = 0,
APP_LED_ERR_NOT_INIT
} AppLed_Ret_t;
/**
* @brief 灯效初始化,先全灭
* @return APP_LED_OK=成功
*/
AppLed_Ret_t app_led_init(void);
/**
* @brief 按优先级刷新灯:配对从 app_pair 取,功能开关由调用方传入
* @param dt 距上次调用的毫秒数
* @param power_on 1=开机态,0=关机态(灯灭)
* @return 无
*/
void app_led_run(uint16_t dt, uint8_t power_on);
/**
* @brief 重新挂开机常亮
* @return 无
*/
void app_led_hint_power_on(void);
/**
* @brief 进入 OTA:清掉其它灯,挂 200ms 闪一直闪
* @return 无
*/
void app_led_request_ota(void);
/**
* @brief 查询是否处于 OTA 灯效
* @return 1=OTA 灯效中,0=否
*/
uint8_t app_led_is_ota(void);
/**
* @brief 清空全部灯事件并灭灯(关机前调用)
* @return 无
*/
void app_led_clear(void);
/**
* @brief 查询是否已初始化
* @return APP_LED_OK=已初始化,APP_LED_ERR_NOT_INIT=未初始化
*/
AppLed_Ret_t app_led_get_status(void);
#endif /* __APP_LED_H__ */