feat(display): 添加显示模块功能支持电池状态和模式切换
- 配置文件中启用USB CDC ACM类、UART相关配置和LVGL显示库 - 添加对bat_state_event、hid_led_event和mode_switch_event事件的订阅 - 实现UI模型结构体ui_main_model用于管理显示状态 - 添加refresh_ui函数用于刷新UI界面 - 集成电池电量显示、充电状态指示和模式切换状态更新 fix(ui): 重构主UI界面添加动态数据更新功能 - 重写ui_main.c实现完整的UI组件创建和刷新逻辑 - 添加状态栏芯片显示USB、BLE、NumLock、CapsLock状态 - 实现电池图标、电量百分比和充电状态的动态更新 - 添加日期时间显示区域和整体UI刷新功能 - 创建ui_main_model数据结构管理UI状态数据 chore(config): 更新项目配置启用串口和显示相关功能 - 启用串口和UART中断驱动配置 - 添加USB CDC ACM类和HID支持 - 增加LVGL工作队列栈大小到16KB - 添加蒙特赛拉特32号字体支持
This commit is contained in:
@@ -1,11 +1,36 @@
|
||||
#ifndef BLINKY_UI_MAIN_H_
|
||||
#define BLINKY_UI_MAIN_H_
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
#include "mode_switch_event.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void ui_main_init(void);
|
||||
struct ui_main_model {
|
||||
lv_color_t theme_color;
|
||||
lv_color_t inactive_border_color;
|
||||
uint8_t battery_level;
|
||||
enum mode_switch_mode mode;
|
||||
uint8_t led_mask;
|
||||
bool charging;
|
||||
bool full;
|
||||
};
|
||||
|
||||
void ui_main_init(const struct ui_main_model *model,
|
||||
const char *date_text,
|
||||
const char *time_text);
|
||||
void ui_main_refresh_all(const struct ui_main_model *model,
|
||||
const char *date_text,
|
||||
const char *time_text);
|
||||
void ui_main_refresh_status_bar(const struct ui_main_model *model);
|
||||
void ui_main_refresh_battery(const struct ui_main_model *model);
|
||||
void ui_main_refresh_datetime(const char *date_text, const char *time_text);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user