| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- /**
- * @Author: 李建
- * @Date: 2025/5/2 11:48
- * Description: 系统设置功能
- * Copyright: Copyright (©) 2025 永续绿建. All rights reserved.
- */
- #ifndef WIRE_CONTROLLER_SETTING_H
- #define WIRE_CONTROLLER_SETTING_H
- #include <stdint.h>
- #include <stdbool.h>
- //#define NVS_POWER_CONTROLLER "power" // 电源
- #define NVS_INNER_ADDR "inner_addr" // 内机地址
- #define NVS_XF_HAVE_ADDR "xf_have" // 是否有新风
- #define NVS_MIN_HUM "min_hum" // 最小湿度
- #define FILTER_LIFE_TIME "filter_life_time" //滤芯最大使用寿命
- #define NVS_FAV_FIRST_VOL "fan_first_vol" // 风机一档电压
- #define NVS_FAN_SECOND_VOL "fan_second_vol" // 风机二档电压
- #define NVS_FAN_THIRD_VOL "fan_third_vol" // 风机三档电压
- #define NVS_REPORT_DATA_DURATION "report_dur" // 上报数据间隔
- #define NVS_SOUND_ON_OFF_KEY "S_ON_OFF"
- #define NVS_SCREEN_AUTO_OFF_KEY "SCREEN_A_O"
- #define NVS_SOUND_VOLUME_KEY "S_VOLUME"
- #define NVS_SCREEN_OFF_MINUTE_KEY "SCREEN_O_M"
- #define NVS_SCREEN_ON_OFF "scr_on_off" // 屏幕当前状态
- #define NVS_FIX_TEMP_KEY "FIX_TEMP"
- #define NVS_FIX_HUM_KEY "FIX_HUM"
- /**
- * 定义系统设定参数结构体
- */
- typedef struct {
- uint8_t filter_life_remaining;
- uint16_t filter_life_time;
- uint16_t fan_first_vol;
- uint16_t fan_second_vol;
- uint16_t fan_third_vol;
- uint8_t sound_on_off; // 声音开关
- uint8_t screen_auto_off; // 是否自动关屏
- uint8_t sound_volume; // 声音音量大小
- uint8_t screen_off_minute; // 屏幕自动关屏时间
- uint8_t timer_status; // 定时器状态
- uint8_t duration; // 定时器时间
- uint8_t report_data_duration;
- uint8_t inner_addr;
- int8_t fix_temp; // 温度修正值(-5,5)
- int8_t fix_hum; // 湿度修正值(-5,5)
- uint8_t xf_have;//是否有新风模块
- } system_setting_t;
- /**
- * 读取系统设定参数
- * @param setting
- */
- void read_system_setting(system_setting_t *setting);
- /**
- * 保存系统配置
- */
- void save_system_setting(system_setting_t * setting);
- /**
- * 保存风阀配置信息
- * @param setting
- * @param ctrl_no 控制编号 (1-5)
- * @param fan_valve_no 风阀编号(1-5)
- * @param value 0或1,代表关联与取消关联
- */
- void save_fan_valve_setting(system_setting_t *setting, uint8_t ctrl_no, uint8_t fan_valve_no, uint8_t value);
- /**
- * 熄屏计时器初始化
- */
- void screen_off_timer_init( system_setting_t * setting);
- /**
- * 重置屏幕熄灭
- */
- bool reset_screen_off();
- void save_inner_addr(uint8_t addr);
- #endif //WIRE_CONTROLLER_SETTING_H
|