初始提交卡包 USB 工程
纳入固件源码、屏幕组件、nand_xfer 工具和文档。忽略本机构建产物、sdkconfig,以及含本机路径的依赖锁。 Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
#ifndef UI_CMD_H
|
||||
#define UI_CMD_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "lvgl.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/queue.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum
|
||||
{
|
||||
UI_CMD_NONE = 0,
|
||||
UI_CMD_SET_LABEL_TEXT,
|
||||
UI_CMD_SET_IMAGE_SRC,
|
||||
UI_CMD_WEATHER_FORECAST_TIME_REFRESH,
|
||||
} ui_cmd_type_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ui_cmd_type_t type;
|
||||
lv_obj_t *obj;
|
||||
union
|
||||
{
|
||||
char text[128];
|
||||
const void *img_src;
|
||||
} u;
|
||||
} ui_cmd_t;
|
||||
|
||||
void ui_cmd_init(void);
|
||||
BaseType_t ui_cmd_set_label_text(lv_obj_t *obj, const char *text);
|
||||
BaseType_t ui_cmd_set_image_src(lv_obj_t *obj, const void *src);
|
||||
BaseType_t ui_cmd_weather_forecast_time_refresh(void);
|
||||
|
||||
/**
|
||||
* Drain and execute all pending UI commands.
|
||||
* Must be called from the LVGL task context while it is safe to call LVGL.
|
||||
*/
|
||||
void ui_cmd_drain(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // UI_CMD_H
|
||||
Reference in New Issue
Block a user