Transplant moves the generated anyui-LIVE output onto a target device or integrates it into an existing project. This guide covers migration, transplantation, and integration with other systems.
Overview
anyui-LIVE focuses on UI design, and the generated UI code is designed to stay independent of specific hardware and development tools (such as Keil). The generated code can be moved to any target that satisfies the LVGL requirements.
The output being transplanted is described in the codegen guide, and the code it depends on is described in the image guide and the font guide.
Transplant process
UI code
All UI code is generated within the {root}/generated directory, including screen implementations and converted assets (images, fonts, lotties). To transplant:
- Copy the
generatedcode into your project. - Invoke
setupUI()to initialize the UI. - Compile the project for the target toolchain.
This code is automatically generated and should not be manually modified.
lv_conf.h
Maintain a device-specific copy of lv_conf.h with at least the following configurations:
/** Required configurations */
#define LV_HOR_RES_MAX (?) // Horizontal resolution
#define LV_VER_RES_MAX (?) // Vertical resolution
#define LV_COLOR_DEPTH 16
/* Size of the memory available for lv_mem_alloc() in bytes (>= 2kB) */
#define LV_MEM_SIZE (?) // Memory size in bytes
/** Optional configurations as needed */
#define LV_USE_LOG 1 // Enable log
#define LV_USE_FS_STDIO 1 // Enable file system
#define LV_USE_PNG 1 // Enable PNG decoder
#define LV_USE_JPEG 1 // Enable JPEG decoder
#define LV_USE_BMP 1 // Enable BMP decoder
#define LV_USE_GIF 1 // Enable GIF decoder
#define LV_USE_BTN 1 // Enable button
#define LV_USE_IMG 1 // Enable image
#define LV_USE_LABEL 1 // Enable label
// Additional components as required
/** Device-specific exclusions */
//#define USE_SIMULATOR
Integration with external systems
The generated code can be integrated with an existing embedded project:
- Application entry - call
setupUI()frommain()after LVGL is initialized. - Communication - handle commands from the UI through your own handlers.