SDK for TESAIoT Dev Kit
API reference & tutorials (ModusToolbox)
Loading...
Searching...
No Matches

Functions

bool ipc_ui_init (lv_obj_t *parent)
 UI handler bring-up — last in the prologue, gated on display_ok.
void ipc_ui_set_container (lv_obj_t *parent)
 One-line forward to ui_widget_mgr_set_parent(); NULL on destroy is mandatory.
void ipc_ui_input_activity (void)
 Arms the 5 ms fast drain for one FAST_TIMEOUT window.

Detailed Description

Header: ipc_ui.h. Implementation: archived ipc_ui.c (libbento_ipc.a). UI handler bring-up, container binding and the input hook. "ISR callback -> FreeRTOS queue -> LVGL timer (50ms) processes commands in GFX task context" (ipc_ui.h): the ISR half only enqueues; every LVGL operation happens on the timer, in the GFX task. The three weak hooks declared or referenced here (ipc_ui_ext_dispatch, ipc_ui_ext_clear_all, ipc_ui_platform_diag) are documented with the other hooks on Weak hooks (implement, don't call).

Variant
mtb-mpy and mtb-only

Function Documentation

◆ ipc_ui_init()

bool ipc_ui_init ( lv_obj_t * parent)

UI handler bring-up — last in the prologue, gated on display_ok.

Initialize the IPC UI handler. Registers IPC callback, creates FreeRTOS queue, and LVGL timer. Must be called after LVGL and IPC Pipe are initialized.

Parameters
parentLVGL parent object for user-created widgets (UX/UI tab container).
Returns
true on success.
Contract
The full init contract, in order: (1) cm55_ipc_communication_setup() first — it owns Cy_IPC_Pipe_Init(); (2) ipc_sensorhub_init() then ipc_service_init() before GFXSS bring-up so IPC survives a display failure; (3) ipc_ui_init() last and gated on display_ok — it calls lv_timer_create() (ipc_ui.c:911) — while ipc_lcd_init() is not gated: the ipc_only: label is the whole point; (4) both take NULL (deferred binding); (5) both bool returns are explicitly (void) -cast — failure must not abort boot. Inside, on Cy_IPC_Pipe_RegisterCallback failure it deletes its queue and returns false (ipc_ui.c:885-913). It calls ui_widget_mgr_init() itself as its first statement — never call that yourself. Never call cm55_ipc_communication_setup() twice (wifi_manager.c:65). Note: the evidence found no in-code assertion of a "no printf in the CM55 IPC ISR" rule at these sites — none is cited here.
Variant
mtb-mpy and mtb-only
Origin
Lifted from TESAIoT_KIT_PSE84_AI-Micropython-BentoClaw/proj_cm55/modules/lvgl_display/controller/tesaiot_display.c:470-479 (compiled into the prebuilt archive; not shipped as source).
Ordering prologue (same file, lines 223-238)
Origin
Lifted from tesaiot_display.c:223-238 (compiled into the prebuilt archive; not shipped as source).

◆ ipc_ui_set_container()

void ipc_ui_set_container ( lv_obj_t * parent)

One-line forward to ui_widget_mgr_set_parent(); NULL on destroy is mandatory.

Update the widget parent container (for page-based navigation). Called when Playground page is created/destroyed. Pass NULL to invalidate (page destroyed), non-NULL to activate.

Parameters
parentLVGL container or NULL.
Contract
A one-line forward to ui_widget_mgr_set_parent() (ipc_ui.c:918-921). Same NULL-on-destroy obligation as ipc_lcd_set_container(): the page binds its content container on create and must pass NULL on destroy, or the IPC handler writes into LVGL objects freed by lv_screen_load_anim(auto_del). Bind order ui-then-lcd on create and identically on destroy. Void; GFX-task context. Note that ui_widget_mgr_set_parent() clears all existing widgets when the parent changes — a page switch drops the MicroPython script's widgets by design.
Variant
mtb-mpy and mtb-only
Example — bind on create (template)
/* ...context: inside page_playground_create() ... */
/* Store as UX/UI container for IPC widget creation */
s_uxui_container = content;
/* Terminal container: same as content — ipc_lcd creates terminal inside */
s_terminal_container = content;
/* Bind containers to IPC handlers (deferred from boot) */
Example — unbind on destroy (template)
void page_playground_destroy(void)
{
/* Unbind containers from IPC handlers — prevents writing to stale objects.
* The actual LVGL objects are destroyed by lv_screen_load_anim(auto_del). */
s_uxui_container = NULL;
s_terminal_container = NULL;

◆ ipc_ui_input_activity()

void ipc_ui_input_activity ( void )

Arms the 5 ms fast drain for one FAST_TIMEOUT window.

Contract
Arms the 5 ms fast drain for one FAST_TIMEOUT window so the first tap of a quiescent app is answered at fast-mode latency instead of waiting out the 200 ms idle tick. Its single caller is the archived widget manager's input event callback (ui_widget_mgr.c:2667), whose comment is the contract: "Runs in GFX task context (LVGL event callback) — same context the drain timer callback uses, so no locking is needed." Deliberately not wired to POLL_EVENTS: polling is continuous, so arming there would pin fast mode on permanently and revert the GFX sleep-clamp tuning that protects ai_infer / radar (ipc_ui.h). Definition at ipc_ui.c:158-160. A consumer's own LVGL input callback may call it for the same reason; nothing else should.
Variant
mtb-mpy and mtb-only
Origin
Lifted from BENTO-TESAIoT-libraries/claw/common/modules/ipc_ui/ui_widget_mgr.c:2667 (compiled into the prebuilt archive; not shipped as source): the widget input event callback calls ipc_ui_input_activity() once per real user input, after the per-widget event-mask gate. The site is pinned, not replicated.