$npx -y skills add easyzoom/aix-skills --skill lvgl-integrationUse when integrating, porting, configuring, or debugging LVGL, littlevGL, display drivers, input devices, ticks, draw buffers, or embedded GUI performance
| 1 | # LVGL Integration |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | Use this skill to integrate LVGL by proving four porting contracts: display flush, input device read, tick/timebase, and memory/draw buffer configuration. UI bugs often come from driver timing or buffer ownership, not widget logic. |
| 6 | |
| 7 | ## When To Use |
| 8 | |
| 9 | Use this skill when: |
| 10 | |
| 11 | - The user wants to add or debug LVGL/littlevGL on an MCU or embedded Linux display. |
| 12 | - The issue involves blank screen, wrong colors, tearing, touch offset, slow refresh, memory faults, tick handling, or display flush callbacks. |
| 13 | - The project has display, touch, encoder, keypad, RTOS, or DMA/cache constraints. |
| 14 | |
| 15 | Do not use this skill when the display hardware has no proven signal. Use `hardware-interface-debug` first. |
| 16 | |
| 17 | ## First Questions |
| 18 | |
| 19 | Ask for: |
| 20 | |
| 21 | - LVGL major version and target platform. |
| 22 | - Display controller, resolution, color format, interface, and framebuffer/draw buffer strategy. |
| 23 | - Input devices: touch, buttons, encoder, keypad, or none. |
| 24 | - Tick source and `lv_timer_handler` scheduling. |
| 25 | - RAM budget, heap policy, RTOS use, DMA/cache involvement. |
| 26 | - Current symptom and minimal screen test result. |
| 27 | |
| 28 | ## Integration Checklist |
| 29 | |
| 30 | 1. Bring up display flush. |
| 31 | Fill the screen with solid colors before creating complex widgets. |
| 32 | |
| 33 | 1. Configure draw buffers. |
| 34 | Buffer size, color format, stride, and cache/DMA policy must match the display path. |
| 35 | |
| 36 | 1. Provide a reliable tick. |
| 37 | LVGL needs a monotonic tick and regular handler execution. |
| 38 | |
| 39 | 1. Add input after display. |
| 40 | Touch/encoder/keypad should be calibrated and tested independently. |
| 41 | |
| 42 | 1. Bound memory. |
| 43 | Configure heap, widget count, image assets, fonts, and buffers for the target RAM. |
| 44 | |
| 45 | 1. Verify refresh performance. |
| 46 | Measure frame time, flush completion, and whether `lv_disp_flush_ready` is called correctly. |
| 47 | |
| 48 | ## Common Failures |
| 49 | |
| 50 | - Blank screen because flush callback never calls ready. |
| 51 | - Wrong colors from RGB/BGR or 16-bit endian mismatch. |
| 52 | - Touch coordinates need rotation/calibration transform. |
| 53 | - UI freezes because `lv_timer_handler` is not called regularly. |
| 54 | - DMA reads stale cache lines or writes to non-DMA-capable memory. |
| 55 | - Fonts/images exceed flash or RAM budgets. |
| 56 | |
| 57 | ## Verification |
| 58 | |
| 59 | Before claiming LVGL works: |
| 60 | |
| 61 | - State LVGL version, resolution, color format, buffer size, and tick period. |
| 62 | - Confirm solid color flush, a label/button screen, and input event if applicable. |
| 63 | - Confirm `lv_timer_handler` schedule and flush-ready behavior. |
| 64 | - Confirm memory usage and DMA/cache policy when relevant. |
| 65 | |
| 66 | ## Example |
| 67 | |
| 68 | User: |
| 69 | |
| 70 | ```text |
| 71 | LVGL 移植后屏幕花屏,触摸也偏。 |
| 72 | ``` |
| 73 | |
| 74 | Agent: |
| 75 | |
| 76 | 1. Asks for LVGL version, display controller, color format, buffer config, rotation, and touch driver. |
| 77 | 1. Tests solid colors and flush-ready before widgets. |
| 78 | 1. Calibrates touch transform after display orientation is correct. |