12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- /**
- * @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_MIN_HUM "min_hum" // 最小湿度
- #define FILTER_LIFE_TIME "filter_life_time" //滤芯最大使用寿命
- #define AIR_EXHAUST_FIRST_VOL "exhaust_first_vol" // 排风风机一档电压
- #define AIR_EXHAUST_SECOND_VOL "exhaust_second_vol" // 排风风机二档电压
- #define AIR_EXHAUST_THIRD_VOL "exhaust_third_vol" // 排风风机三档电压
- #define AIR_EXHAUST_FOURTH_VOL "exhaust_fourth_vol" // 排风风机四档电压
- #define AIR_EXHAUST_FIFTH_VOL "exhaust_fifth_vol" // 排风风机五档电压
- #define AIR_SUPPLY_FIRST_VOL "supply_first_vol" // 送风风机一档电压
- #define AIR_SUPPLY_SECOND_VOL "supply_second_vol" // 送风风机二档电压
- #define AIR_SUPPLY_THIRD_VOL "supply_third_vol" // 送风风机三档电压
- #define AIR_SUPPLY_FOURTH_VOL "supply_fourth_vol" // 送风风机四档电压
- #define AIR_SUPPLY_FIFTH_VOL "supply_fifth_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" // 屏幕当前状态
- /**
- * 定义系统设定参数结构体
- */
- typedef struct {
- uint8_t set_min_hum;
- uint8_t filter_life_remaining;
- uint32_t filter_life_time;
- uint8_t exhaust_first_vol;
- uint8_t exhaust_second_vol;
- uint8_t exhaust_third_vol;
- uint8_t exhaust_fourth_vol;
- uint8_t exhaust_fifth_vol;
- uint8_t supply_first_vol;
- uint8_t supply_second_vol;
- uint8_t supply_third_vol;
- uint8_t supply_fourth_vol;
- uint8_t supply_fifth_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;
- } 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();
- #endif //WIRE_CONTROLLER_SETTING_H
|