NXP has integrated LVGL into the MCUXpresso SDK packages for general purpose and crossover microcontrollers, allowing easy evaluation and migration into your product design. Download an SDK for a supported board today and get started with your next GUI application.
Downloading the MCU SDK example project is recommended as a starting point. It comes fully configured with LVGL (and with PXP/VGLite support if the modules are present), no additional integration work is required.
Depending on the RT platform used, the acceleration can be done by NXP PXP (PiXel Pipeline) and/or the Verisilicon GPU through an API named VGLite. Each accelerator has its own context that allows them to be used individually as well simultaneously (in LVGL multithreading mode).
Several drawing features in LVGL can be offloaded to the PXP engine. The CPU is available for other operations while the PXP is running. RTOS is required to block the LVGL drawing thread and switch to another task or suspend the CPU for power savings.
Supported draw callbacks are available in "src/draw/nxp/pxp/lv_draw_pxp.c":
pxp_draw_ctx->base_draw.draw_img_decoded = lv_draw_pxp_img_decoded;
pxp_draw_ctx->blend = lv_draw_pxp_blend;
pxp_draw_ctx->base_draw.wait_for_finish = lv_draw_pxp_wait_for_finish;
pxp_draw_ctx->base_draw.buffer_copy = lv_draw_pxp_buffer_copy;
All operations can be used in conjunction with optional transparency.
Default FreeRTOS and bare metal code provided
Combination of recolor and/or rotation + color key/alpha blend/transparency is supported. That is achieved by PXP in two steps:
LV_USE_GPU_NXP_PXP to 1LV_USE_GPU_NXP_PXP_AUTO_INIT to 1SDK_OS_FREE_RTOS symbol is defined, FreeRTOS implementation will be used, otherwise bare metal code will be
includedLV_USE_GPU_NXP_PXP_AUTO_INIT is enabled, no user code is required; PXP is initialized automatically in
lv_init()lv_init()
c
#if LV_USE_GPU_NXP_PXP
#include "src/draw/nxp/pxp/lv_gpu_nxp_pxp.h"
#endif
. . .
#if LV_USE_GPU_NXP_PXP
PXP_COND_STOP(!lv_gpu_nxp_pxp_init(), "PXP init failed.");
#endif
LV_USE_GPU_NXP_PXP_AUTO_INIT is set to 1LV_GPU_NXP_PXP_LOG_ERRORS is enabled so that any PXP error will be seen on SDK debug consoleLV_GPU_NXP_PXP_LOG_TRACES is disabled. Enable it for tracing logs (like PXP limitations)lv_nxp_pxp_cfg_t with callback pointers is
used as a parameter for the lv_gpu_nxp_pxp_init() function. Default implementation for FreeRTOS and bare metal is
provided in lv_gpu_nxp_pxp_osa.c
pxp_interrupt_init(): Initialize PXP interrupt (HW setup, OS setup)pxp_interrupt_deinit(): Deinitialize PXP interrupt (HW setup, OS setup)pxp_run(): Start PXP job. Use OS-specific mechanism to block drawing thread. PXP must finish drawing before
leaving this function.LV_GPU_NXP_PXP_SIZE_LIMIT: size threshold for fill/blit (with optional transformation)Extra drawing features in LVGL can be handled by the VGLite engine. The CPU is available for other operations while the VGLite is running. An RTOS is required to block the LVGL drawing thread and switch to another task or suspend the CPU for power savings.
Supported draw callbacks are available in "src/draw/nxp/vglite/lv_draw_vglite.c":
vglite_draw_ctx->base_draw.init_buf = lv_draw_vglite_init_buf;
vglite_draw_ctx->base_draw.draw_line = lv_draw_vglite_line;
vglite_draw_ctx->base_draw.draw_arc = lv_draw_vglite_arc;
vglite_draw_ctx->base_draw.draw_rect = lv_draw_vglite_rect;
vglite_draw_ctx->base_draw.draw_img_decoded = lv_draw_vglite_img_decoded;
vglite_draw_ctx->blend = lv_draw_vglite_blend;
vglite_draw_ctx->base_draw.wait_for_finish = lv_draw_vglite_wait_for_finish;
vglite_draw_ctx->base_draw.buffer_copy = lv_draw_vglite_buffer_copy;
All operations can be used in conjunction with optional transparency.
VG_LITE_LINEAR).LV_USE_GPU_NXP_VG_LITE to 1SDK_OS_FREE_RTOS symbol needs to be defined so that the FreeRTOS implementation will be usedlv_init() by specifying the width/height of tessellation window. Value should be
a multiple of 16; minimum value is 16 pixels, maximum cannot be greater than the frame width. If less than or equal
to 0, then no tessellation buffer is created, in which case VGLite is initialized only for blitting.
c
#if LV_USE_GPU_NXP_VG_LITE
#include "vg_lite.h"
#endif
. . .
#if LV_USE_GPU_NXP_VG_LITE
VG_LITE_COND_STOP(vg_lite_init(64, 64) != VG_LITE_SUCCESS, "VGLite init failed.");
#endif
LV_GPU_NXP_VG_LITE_LOG_ERRORS is enabled so that any VGLite error will be seen on SDK debug consoleLV_GPU_NXP_VG_LITE_LOG_TRACES is disabled. Enable it for tracing logs (like blit split workaround or
VGLite fallback to CPU due to any error on the driver)LV_GPU_NXP_VG_LITE_SIZE_LIMIT: size threshold for fill/blit (with optional transformation)