2026-04-11 14:28:34 +08:00
|
|
|
#ifndef BLINKY_UI_MAIN_H_
|
|
|
|
|
#define BLINKY_UI_MAIN_H_
|
|
|
|
|
|
2026-04-11 16:40:54 +08:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
#include <lvgl.h>
|
|
|
|
|
|
|
|
|
|
#include "mode_switch_event.h"
|
|
|
|
|
|
2026-04-11 14:28:34 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2026-04-11 16:40:54 +08:00
|
|
|
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);
|
2026-04-11 14:28:34 +08:00
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif /* BLINKY_UI_MAIN_H_ */
|