NXP MCU 技术william hill官网
直播中

莫联雪

7年用户 1116经验值
私信 关注
[问答]

在iMX RT1176上需要最快的LVGL图形VGLite或PXP,可以参考哪些设置/示例LVGL演示?

我希望在以 横向 720x1280 运行的 iMX RT1176 上实现尽可能快的图形,即滚动、动画等。我可以参考哪些设置/示例 LVGL 演示?现在我正在使用 MIMXRT1170-EVKB 和 RK055HDMIPI4MA0 5.5" 英寸屏幕。
还使用 FreeRTOS,而不是裸机......

回帖(1)

无人岛

2024-6-3 17:10:21
您可以参考以下设置和示例:

1. LVGL的配置:

a. 在lv_conf.h文件中启用VGLite或PXP:

/*Software library configuration*/
#define LV_USE_USER_DATA            0   /*Enable/disable the usage of user data*/
#define LV_COLOR_DEPTH              32  /*Color depth: 1/8/16/32*/
#define LV_COLOR_16_SWAP            0   /*Swap the 2 bytes of RGB565 color. Useful if the display works with a pixel pipeline (e.g. HDMI)*/
#define LV_IMG_CACHE_DEF_SIZE       1   /*Default cache size in image decoder (in pixel count)*/
#define LV_IMG_CACHE_LARGE_SIZE     2   /*Large cache size in image decoder (in pixel count)*/
#define LV_DPI                      130 /*Set a default DPI for every object*/

/* Use PXP (Pixel Processing Pipeline) as LVGL's display driver */
#define LV_COLOR_TRANSP             LV_COLOR_MAKE(0, 0, 0)   /*The color of transparent pixels*/
#define LV_COLOR_LSHIFT             16  /*Bit shift of Red part in LV_COLOR_DEPTH*/
#define LV_COLOR_RSHIFT             0   /*Bit shift of Red part in LV_COLOR_DEPTH*/
#define LV_COLOR_GSHIFT             8   /*Bit shift of Green part in LV_COLOR_DEPTH*/
#define LV_COLOR_BSHIFT             0   /*Bit shift of Blue part in LV_COLOR_DEPTH*/
#define LV_PXP_DISPLAY_DEVICE       disp_dev            /*Set PXP display device*/
#define LV_PXP_DISPLAY_BUFFER_COUNT 2                   /*The number of frame buffers*/
#define LV_PXP_DISPLAY_WIDTH        720                 /*The width of the display*/
#define LV_PXP_DISPLAY_HEIGHT       1280                /*The height of the display*/
#define LV_PXP_DISPLAY_INPUT_FORMAT PXP_INPUT_FORMAT_RGB_888 /*The input format of PXP*/

/* Use VGLite as LVGL's display driver */
#define LV_HOR_RES_MAX              720 /*Set maximum horizontal resolution*/
#define LV_VER_RES_MAX              1280 /*Set maximum vertical resolution*/
#define LV_VDB_SIZE                 (LV_HOR_RES_MAX * LV_VER_RES_MAX / 8) /*Set Virtual Display Buffer size*/
#define LV_VDB_DOUBLE_BUFFERED      1 /*Enable double buffering*/
#define LV_VDB_TRUE_COLOR_SUPPORT   0 /*Disable true color support*/
...
#define LV_COLOR_DEPTH              16 /*Color depth: 1/8/16/32*/
#define LV_DISPLAY_DRIVER           lv_disp_drv_t pxp_drv; lv_disp_drv_t vglite_drv;
...
#if USE_PXP_DISPLAY
LV_LAYER_DEF(lvgl_disp_buf_pxp, NULL, LV_PXP_DISPLAY_WIDTH, LV_PXP_DISPLAY_HEIGHT, LV_LAYER_TOP, LV_COLOR_DEPTH);
static pxp_device_t disp_dev = {
        .input_format = LV_PXP_DISPLAY_INPUT_FORMAT,
        .width        = LV_PXP_DISPLAY_WIDTH,
        .height       = LV_PXP_DISPLAY_HEIGHT,
        .buffer_count = LV_PXP_DISPLAY_BUFFER_COUNT,
        .pxp_irq      = LV_PXP_IRQ,
        .pixel_addr   = PXP_OUTPUT_ADDR
};
static void pxp_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * color_p)
{
    pxp_process_frame(area->x1, area->y1, area->x2, area->y2, (uint8_t*)color_p, 0, LV_PXP_DISPLAY_INPUT_FORMAT, PXP_OUTPUT_ADDR);
    lv_disp_flush_ready(drv);
}
#endif /* USE_PXP_DISPLAY */

2. 示例程序:

使用LVGL的示例程序可以帮助您快速理解和使用LVGL。您可以尝试运行以下示例程序:

a. lv_demo_benchmark:

这个示例会运行LVGL的主要特性,例如各种基本组件、动画和滚动。您可以通过观察控制台输出,了解工作负载和帧速率。

b. lv_demo_keypad_encoder:

这个示例会展示如何使用LVGL的按键和编码器输入控件。

c. lv_demo_music:

这个示例会展示如何使用LVGL的图像和动画来创建一个音乐播放器UI。

d. lv_demo_printer:

这个示例会展示如何使用LVGL的图像、文本和滚动来创建一个打印机UI。

3. FreeRTOS使用:

您可以参考LVGL Github库中的FreeRTOS示例,这些示例会展示如何在RTOS环境中使用LVGL。对于iMX RT1176,您需要确保正确配置FreeRTOS内存分配器和时钟。

希望这些信息对您有所帮助。
举报

更多回帖

发帖
×
20
完善资料,
赚取积分