|
SDK for TESAIoT Dev Kit
API reference & tutorials (ModusToolbox)
|
Functions | |
| bool | ipc_lcd_init (lv_obj_t *parent) |
| Boot-time console bring-up — NULL parent, never gated on display_ok. | |
| void | ipc_lcd_set_container (lv_obj_t *parent) |
| Deferred container binding; NULL on destroy is mandatory. | |
| void | ipc_lcd_toggle_panel (void) |
| Blind console toggle — always guard with ipc_lcd_is_panel_visible(). | |
| bool | ipc_lcd_is_panel_visible (void) |
| False when hidden or not yet created — the guard that makes the toggle safe. | |
| void | ipc_lcd_reset_auto_nav (void) |
| Re-arms the one-shot auto-navigate; reached via ui.clear(), not called by consumers. | |
| bool | ipc_lcd_has_unread (void) |
| Pure read of the unread flag — it does not clear. | |
| void | ipc_lcd_clear_unread (void) |
| Explicit clear, made only on the transition into console mode. | |
Header: ipc_lcd.h. Implementation: archived ipc_lcd.c (libbento_ipc.a). Receives lcd.print() text from CM33_NS and renders it in a terminal-like panel inside whatever container the Playground page has bound. All seven functions run in GFX-task context; the Playground page calls them from LVGL event and render callbacks.
| bool ipc_lcd_init | ( | lv_obj_t * | parent | ) |
Boot-time console bring-up — NULL parent, never gated on display_ok.
Initialize IPC LCD receiver. Call after LVGL and display are ready. Sets up IPC pipe, registers callback, and creates an LVGL timer that polls the receive queue and updates a terminal-like renderer.
| parent | Pointer to LVGL parent container (Terminal tab). |
cm55_ipc_communication_setup(), ipc_sensorhub_init() and ipc_service_init(), and not gated on display_ok: the ipc_only: label exists so that a board whose panel failed still brings up the LCD/IPC path. It takes NULL — deferred container binding; the Playground page binds a real container later with ipc_lcd_set_container(). The bool return is explicitly (void) -cast by the shipped caller: a failure must not abort boot. Do not call it a second time. | void ipc_lcd_set_container | ( | lv_obj_t * | parent | ) |
Deferred container binding; NULL on destroy is mandatory.
Update the terminal container (for page-based navigation). Called when Playground page is created/destroyed. Pass NULL to invalidate (page destroyed), non-NULL to activate.
| parent | LVGL container or NULL. |
ipc_lcd_init(NULL) runs at boot with no container; the page binds on create and must pass NULL on destroy, otherwise the IPC handler keeps writing into LVGL objects that lv_screen_load_anim(auto_del) has already freed — a use-after-free. Bind order is ui-then-lcd on create and identically ui-then-lcd on destroy. Void; no error path. GFX-task context. | void ipc_lcd_toggle_panel | ( | void | ) |
Blind console toggle — always guard with ipc_lcd_is_panel_visible().
Toggle terminal panel visibility (show/hide). If the terminal has not been created yet, force-creates it first. Used by Playground Console Log button.
ipc_lcd_is_panel_visible() so a redundant call cannot invert state. If the terminal has not been created yet it force-creates it first. Console and widgets are mutually exclusive, and the shipped ordering is asymmetric: hide-widgets-then-show-console, but hide-console-then-show-widgets. Void; GFX-task context (LVGL event callback). | bool ipc_lcd_is_panel_visible | ( | void | ) |
False when hidden or not yet created — the guard that makes the toggle safe.
Check if the terminal panel is currently visible.
false when hidden or not yet created. It is the guard that makes ipc_lcd_toggle_panel() safe — every shipped toggle is wrapped in it. Console and widgets are mutually exclusive: the same callback flips ui_widget_mgr_set_all_visible() the opposite way. GFX-task context. | void ipc_lcd_reset_auto_nav | ( | void | ) |
Re-arms the one-shot auto-navigate; reached via ui.clear(), not called by consumers.
Reset the one-shot auto-navigate flag. Called on UI CLEAR_ALL (new MicroPython session) so lcd.print() can auto-navigate to Playground again.
lcd.print() of a new MicroPython session can jump to Playground again. Its single caller is the archived IPC switch: case IPC_CMD_UI_CLEAR_ALL: at ipc_ui.c:553 calls ui_widget_mgr_clear_all(), clears its own s_auto_nav_done flag, then calls this at ipc_ui.c:556. A consumer does not call it; MicroPython reaches it with ui.clear(). The page the auto-navigate targets is the compiled-in ordinal 7 — see the archive hazard on IPC Core (libbento_ipc.a). BENTO-TESAIoT-libraries/claw/common/modules/ipc_ui/ipc_ui.c:553-556 (compiled into the prebuilt archive; not shipped as source): the CLEAR_ALL case clears widgets, resets s_auto_nav_done, then calls ipc_lcd_reset_auto_nav(). This case is not among the four replicated in the Tier-2 excerpt; the line numbers are pinned from the source. | bool ipc_lcd_has_unread | ( | void | ) |
Pure read of the unread flag — it does not clear.
Check if new text arrived while the console panel was hidden. Used by Playground to show a notification badge on the Console button.
!s_console_mode guard. Polled from the page's per-tick render hook, which the 33 ms sensorhub timer drives. GFX-task context; no error path. | void ipc_lcd_clear_unread | ( | void | ) |
Explicit clear, made only on the transition into console mode.
Clear the unread flag. Called when the user opens the Console panel.