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 (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() — while ipc_lcd_init() is not gated: a board whose panel failed still gets the LCD/IPC path, which 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. It calls ui_widget_mgr_init() itself, before anything else — never call that yourself. Never call cm55_ipc_communication_setup() twice (wifi_manager.c:65).
Variant
mtb-mpy and mtb-only

◆ 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 direct forward to ui_widget_mgr_set_parent(). 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 ui_widget_mgr_event_push() inside the archive, which runs in GFX-task context (an LVGL event callback) — the same context as the drain timer callback, 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 the Edge AI inference and radar tasks (ipc_ui.h). A consumer's own LVGL input callback may call it for the same reason; nothing else should.
Variant
mtb-mpy and mtb-only
Caller
The widget input event callback (inside the prebuilt archive; not shipped as source) calls ipc_ui_input_activity() once per real user input, after the per-widget event-mask gate.