|
SDK สำหรับ TESAIoT Dev Kit
คู่มืออ้างอิง API และ Tutorial (ModusToolbox)
|
Functions | |
| bool | ipc_lcd_init (lv_obj_t *parent) |
| การเริ่มการทำงานของคอนโซลตอนบูต — parent เป็น NULL และไม่ถูกกั้นด้วย display_ok เลย | |
| void | ipc_lcd_set_container (lv_obj_t *parent) |
| deferred binding ของ container; การส่ง NULL ตอนทำลายเป็นข้อบังคับ | |
| void | ipc_lcd_toggle_panel (void) |
| การสลับคอนโซลแบบไม่ดูสถานะเดิม — ต้องกันด้วย ipc_lcd_is_panel_visible() เสมอ | |
| bool | ipc_lcd_is_panel_visible (void) |
| คืน false เมื่อซ่อนอยู่หรือยังไม่ได้สร้าง — เป็นตัวกัน (guard) ที่ทำให้การสลับปลอดภัย | |
| void | ipc_lcd_reset_auto_nav (void) |
| ตั้ง auto-navigate แบบยิงครั้งเดียวให้พร้อมทำงานอีกครั้ง; เข้าถึงผ่าน ui.clear() ไม่ใช่สิ่งที่ผู้ใช้ไลบรารีเรียกเอง | |
| bool | ipc_lcd_has_unread (void) |
| เป็นการอ่านแฟล็ก unread ล้วน ๆ — ไม่เคลียร์แฟล็ก | |
| void | ipc_lcd_clear_unread (void) |
| การเคลียร์อย่างชัดแจ้ง ทำเฉพาะตอนเปลี่ยนเข้าสู่โหมดคอนโซลเท่านั้น | |
Header: ipc_lcd.h ตัวโค้ดที่ทำงานจริง: ipc_lcd.c ที่อยู่ใน archive (libbento_ipc.a) รับข้อความจาก lcd.print() ที่ CM33_NS ส่งมา แล้วเรนเดอร์ลงในพาเนลที่มีลักษณะอย่างเทอร์มินัล ภายใน container ใดก็ตามที่หน้า (page) Playground ผูกไว้ ฟังก์ชันทั้ง 7 ตัวทำงานใน GFX-task context หน้า Playground เรียกฟังก์ชันเหล่านี้จาก LVGL event callback และ render callback
| bool ipc_lcd_init | ( | lv_obj_t * | parent | ) |
การเริ่มการทำงานของคอนโซลตอนบูต — parent เป็น NULL และไม่ถูกกั้นด้วย 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() และ ipc_service_init() และ ไม่ถูกกั้นด้วย display_ok : ป้าย ipc_only: มีอยู่เพื่อให้บอร์ดที่พาเนลล้มเหลวยังเริ่มการทำงานของเส้นทาง LCD/IPC ได้ ฟังก์ชันนี้รับ NULL — เป็น deferred binding (การผูกแบบเลื่อนเวลา) ของ container หน้า (page) Playground จะผูก container จริงเข้ามาภายหลังด้วย ipc_lcd_set_container() ค่าที่คืนชนิด bool ถูก (void) -cast อย่างชัดแจ้งโดยผู้เรียกที่มีอยู่จริงในของที่ส่งมอบ: ความล้มเหลวห้ามทำให้การบูตหยุดกลางคัน ห้ามเรียกฟังก์ชันนี้เป็นครั้งที่สอง | void ipc_lcd_set_container | ( | lv_obj_t * | parent | ) |
deferred binding ของ container; การส่ง NULL ตอนทำลายเป็นข้อบังคับ
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) ทำงานตอนบูตโดยยังไม่มี container หน้า (page) จะผูก container ตอนสร้าง และ ต้องส่ง NULL ตอนทำลาย มิฉะนั้น IPC handler จะเขียนต่อไปลงในอ็อบเจ็กต์ LVGL ที่ lv_screen_load_anim(auto_del) ปลดหน่วยความจำไปแล้ว — เป็น use-after-free ลำดับการผูกคือ ui แล้วตามด้วย lcd ตอนสร้าง และเป็น ui แล้วตามด้วย lcd เหมือนกันตอนทำลาย คืนค่า void ไม่มีเส้นทางแจ้งข้อผิดพลาด ทำงานใน GFX-task context | void ipc_lcd_toggle_panel | ( | void | ) |
การสลับคอนโซลแบบไม่ดูสถานะเดิม — ต้องกันด้วย 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() เสมอ เพื่อไม่ให้การเรียกซ้ำซ้อนพลิกสถานะกลับด้าน หากยังไม่ได้สร้างเทอร์มินัล ฟังก์ชันนี้จะบังคับสร้างให้ก่อน คอนโซลกับ widget แสดงพร้อมกันไม่ได้ และลำดับที่ส่งมอบจริงไม่สมมาตร: ซ่อน widget ก่อนแล้วจึงแสดงคอนโซล แต่ซ่อนคอนโซลก่อนแล้วจึงแสดง widget คืนค่า void ทำงานใน GFX-task context (LVGL event callback) | bool ipc_lcd_is_panel_visible | ( | void | ) |
คืน false เมื่อซ่อนอยู่หรือยังไม่ได้สร้าง — เป็นตัวกัน (guard) ที่ทำให้การสลับปลอดภัย
Check if the terminal panel is currently visible.
false เมื่อซ่อนอยู่ หรือ ยังไม่ได้สร้าง ฟังก์ชันนี้คือตัวกัน (guard) ที่ทำให้ ipc_lcd_toggle_panel() ปลอดภัย — การสลับทุกจุดในของที่ส่งมอบจริงถูกครอบด้วยฟังก์ชันนี้ คอนโซลกับ widget แสดงพร้อมกันไม่ได้: callback ตัวเดียวกันพลิก ui_widget_mgr_set_all_visible() ไปในทางตรงข้าม ทำงานใน GFX-task context | void ipc_lcd_reset_auto_nav | ( | void | ) |
ตั้ง auto-navigate แบบยิงครั้งเดียวให้พร้อมทำงานอีกครั้ง; เข้าถึงผ่าน ui.clear() ไม่ใช่สิ่งที่ผู้ใช้ไลบรารีเรียกเอง
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() ครั้งถัดไปของเซสชัน MicroPython ใหม่กระโดดไปหน้า Playground ได้อีก ผู้เรียกเพียงรายเดียวคือ IPC switch ที่อยู่ใน archive: case IPC_CMD_UI_CLEAR_ALL: ที่ ipc_ui.c:553 เรียก ui_widget_mgr_clear_all(), เคลียร์แฟล็ก s_auto_nav_done ของตัวเอง แล้วจึงเรียกฟังก์ชันนี้ที่ ipc_ui.c:556 ผู้ใช้ไลบรารี (consumer) ไม่เรียกฟังก์ชันนี้ MicroPython เข้าถึงมันด้วย ui.clear() หน้า (page) ที่ auto-navigate เล็งไปคือลำดับเลข (ordinal) 7 ที่คอมไพล์ติดมา — ดูอันตราย (hazard) ของ archive ที่ IPC Core (libbento_ipc.a) BENTO-TESAIoT-libraries/claw/common/modules/ipc_ui/ipc_ui.c:553-556 (คอมไพล์รวมอยู่ใน archive ที่สร้างไว้ล่วงหน้า ไม่ได้ส่งมอบมาเป็นซอร์ส): case ของ CLEAR_ALL เคลียร์ widget รีเซ็ต s_auto_nav_done แล้วเรียก ipc_lcd_reset_auto_nav() case นี้ไม่ได้อยู่ในสี่ case ที่ทำซ้ำไว้ในข้อความตัดตอน (excerpt) Tier-2 หมายเลขบรรทัดปักหมุดมาจากซอร์ส | bool ipc_lcd_has_unread | ( | void | ) |
เป็นการอ่านแฟล็ก unread ล้วน ๆ — ไม่เคลียร์แฟล็ก
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 กำกับ ถูกวนถาม (polling) จาก render hook ต่อหนึ่ง tick ของหน้า (page) ซึ่งขับด้วย sensorhub timer 33 ms ทำงานใน GFX-task context ไม่มีเส้นทางแจ้งข้อผิดพลาด | void ipc_lcd_clear_unread | ( | void | ) |
การเคลียร์อย่างชัดแจ้ง ทำเฉพาะตอนเปลี่ยนเข้าสู่โหมดคอนโซลเท่านั้น
Clear the unread flag. Called when the user opens the Console panel.