SDK for TESAIoT Dev Kit
API reference & tutorials (ModusToolbox)
Toggle main menu visibility
Loading...
Searching...
No Matches
ui_widget_mgr.h
Go to the documentation of this file.
1
/*******************************************************************************
2
* File Name: ui_widget_mgr.h
3
*
4
* Description: Widget handle table and LVGL widget lifecycle manager.
5
* Maps handle IDs (0-31) to lv_obj_t* pointers.
6
* Creates, modifies, deletes LVGL widgets in GFX task context.
7
*
8
*******************************************************************************/
9
10
#ifndef UI_WIDGET_MGR_H
11
#define UI_WIDGET_MGR_H
12
13
#include "ipc_ui_protocol.h"
14
#include "lvgl.h"
15
#include <stdbool.h>
16
#include <stdint.h>
17
22
void
ui_widget_mgr_init
(lv_obj_t *parent);
23
30
void
ui_widget_mgr_set_parent
(lv_obj_t *parent);
31
36
bool
ui_widget_mgr_needs_container
(
void
);
37
43
int
ui_widget_mgr_create
(
const
ipc_ui_create_t *cfg);
44
51
int
ui_widget_mgr_create_sprite
(
const
lv_image_dsc_t *dsc, int16_t x, int16_t y);
52
57
void
ui_widget_mgr_set_sprite_image
(
int
handle,
const
lv_image_dsc_t *dsc);
58
63
void
ui_widget_mgr_delete
(
int
handle);
64
68
void
ui_widget_mgr_clear_all
(
void
);
69
73
void
ui_widget_mgr_set_text
(
int
handle,
const
char
*text);
74
78
void
ui_widget_mgr_set_value
(
int
handle, int32_t value);
79
83
void
ui_widget_mgr_set_position
(
int
handle, int16_t x, int16_t y);
84
88
void
ui_widget_mgr_set_size
(
int
handle, int16_t w, int16_t h);
89
93
void
ui_widget_mgr_set_color
(
int
handle, uint32_t color);
94
98
void
ui_widget_mgr_set_visible
(
int
handle,
bool
visible);
99
104
void
ui_widget_mgr_set_all_visible
(
bool
visible);
105
110
int32_t
ui_widget_mgr_get_value
(
int
handle);
111
115
void
ui_widget_mgr_set_dotmatrix
(
int
handle,
const
uint8_t *bitmap, uint8_t len);
116
124
void
ui_widget_mgr_set_image
(
int
handle, uint16_t offset,
const
uint8_t *data, uint8_t len);
125
129
void
ui_widget_mgr_event_push
(uint8_t handle, uint8_t event_type, int32_t value);
130
137
int
ui_widget_mgr_event_drain
(ipc_ui_event_t *out,
int
max_events);
138
142
int
ui_widget_mgr_count
(
void
);
143
150
int
ui_widget_mgr_list
(ipc_ui_widget_info_t *out,
int
max_items);
151
156
lv_obj_t *
ui_widget_mgr_get_parent
(
void
);
157
163
void
ui_widget_mgr_set_screen
(int16_t width, int16_t height);
164
171
int
ui_widget_mgr_chart_add_series
(
int
handle, uint32_t color);
172
179
void
ui_widget_mgr_chart_set_next
(
int
handle, uint8_t series_idx, int32_t value);
180
181
182
/*******************************************************************************
183
* Collections and containers (IPC_CMD_UI_ITEM_ADD / _ITEM_CLEAR / _SET_PROP)
184
*
185
* These three functions MUST exist, and behave the same way for the same widget
186
* type, in BOTH ui_widget_mgr.c implementations — claw's and game's. The two
187
* Infineon Game kits compile claw's ipc_ui.c against game's ui_widget_mgr.c, so
188
* a type served here and not there renders on some boards and returns
189
* UI_STATUS_INVALID_TYPE on others, with no build error anywhere.
190
*******************************************************************************/
191
194
#define UI_ITEM_ADD_OK_NO_CHILD (-3)
195
208
int
ui_widget_mgr_item_add
(
const
ipc_ui_item_add_t *it);
209
214
void
ui_widget_mgr_item_clear
(
int
handle);
215
222
void
ui_widget_mgr_set_prop
(
int
handle, uint8_t prop_id, int32_t value);
223
232
lv_obj_t *
ui_widget_mgr_get_object
(
int
handle);
233
234
#endif
/* UI_WIDGET_MGR_H */
ui_widget_mgr_set_prop
void ui_widget_mgr_set_prop(int handle, uint8_t prop_id, int32_t value)
Sets one UI_PROP_* property; how .listen() subscribes to events.
ui_widget_mgr_init
void ui_widget_mgr_init(lv_obj_t *parent)
Called by ipc_ui_init() itself — never call it directly.
ui_widget_mgr_set_parent
void ui_widget_mgr_set_parent(lv_obj_t *parent)
Clears all widgets and sets the new parent; called only via ipc_ui_set_container().
ui_widget_mgr_event_drain
int ui_widget_mgr_event_drain(ipc_ui_event_t *out, int max_events)
Drains events for POLL_EVENTS — the ui.poll() backend.
ui_widget_mgr_item_clear
void ui_widget_mgr_item_clear(int handle)
Empties a collection widget.
ui_widget_mgr_create_sprite
int ui_widget_mgr_create_sprite(const lv_image_dsc_t *dsc, int16_t x, int16_t y)
Creates an image sprite in the same handle table.
ui_widget_mgr_set_position
void ui_widget_mgr_set_position(int handle, int16_t x, int16_t y)
Moves a widget; arms fast drain for gameplay frame rate.
ui_widget_mgr_clear_all
void ui_widget_mgr_clear_all(void)
Deletes every widget and resets the handle table.
ui_widget_mgr_set_value
void ui_widget_mgr_set_value(int handle, int32_t value)
Sets a numeric value; arms fast drain so dashboards are not pinned to 5 FPS.
ui_widget_mgr_set_dotmatrix
void ui_widget_mgr_set_dotmatrix(int handle, const uint8_t *bitmap, uint8_t len)
Loads a bitmap into a DotMatrix widget.
ui_widget_mgr_set_screen
void ui_widget_mgr_set_screen(int16_t width, int16_t height)
Sets screen dimensions and resets the auto-layout grid.
ui_widget_mgr_set_text
void ui_widget_mgr_set_text(int handle, const char *text)
Sets a widget's text; the switch arms fast drain after it.
ui_widget_mgr_item_add
int ui_widget_mgr_item_add(const ipc_ui_item_add_t *it)
Appends one item; overloaded returns, dual-implementation rule.
ui_widget_mgr_event_push
void ui_widget_mgr_event_push(uint8_t handle, uint8_t event_type, int32_t value)
Producer side of the event ring; internal LVGL event callbacks only.
ui_widget_mgr_set_visible
void ui_widget_mgr_set_visible(int handle, bool visible)
Shows or hides one widget.
ui_widget_mgr_chart_set_next
void ui_widget_mgr_chart_set_next(int handle, uint8_t series_idx, int32_t value)
Appends the next value to one chart series.
ui_widget_mgr_get_value
int32_t ui_widget_mgr_get_value(int handle)
Reads the widget's current value; 0 also means bad handle.
ui_widget_mgr_create
int ui_widget_mgr_create(const ipc_ui_create_t *cfg)
Creates a widget from a config; handle 0-31, -1 table full, -2 invalid type.
ui_widget_mgr_set_size
void ui_widget_mgr_set_size(int handle, int16_t w, int16_t h)
Resizes a widget.
ui_widget_mgr_chart_add_series
int ui_widget_mgr_chart_add_series(int handle, uint32_t color)
Adds a series to a Chart; returns index 0-3 or -1.
ui_widget_mgr_needs_container
bool ui_widget_mgr_needs_container(void)
True while the parent is NULL; no caller anywhere.
ui_widget_mgr_get_object
lv_obj_t * ui_widget_mgr_get_object(int handle)
LVGL object behind a handle; the GET_TEXT route for typed text.
ui_widget_mgr_list
int ui_widget_mgr_list(ipc_ui_widget_info_t *out, int max_items)
Handle + type of every active widget — the ui.list() backend.
ui_widget_mgr_set_color
void ui_widget_mgr_set_color(int handle, uint32_t color)
Sets the primary colour, 0xRRGGBB.
ui_widget_mgr_delete
void ui_widget_mgr_delete(int handle)
Deletes one widget and frees its handle.
ui_widget_mgr_set_all_visible
void ui_widget_mgr_set_all_visible(bool visible)
Shows or hides every managed widget; the Playground console toggle's view switch.
ui_widget_mgr_set_sprite_image
void ui_widget_mgr_set_sprite_image(int handle, const lv_image_dsc_t *dsc)
Swaps a sprite's image; the descriptor comes from game_sprite_lookup().
ui_widget_mgr_get_parent
lv_obj_t * ui_widget_mgr_get_parent(void)
Nullable current parent; every call site null-checks it.
ui_widget_mgr_set_image
void ui_widget_mgr_set_image(int handle, uint16_t offset, const uint8_t *data, uint8_t len)
Chunked RGB565 transfer into an Image widget's canvas.
ui_widget_mgr_count
int ui_widget_mgr_count(void)
Number of live handles; zero callers anywhere.
dist
ipc_core
include
ui_widget_mgr.h
Generated by
1.18.0