diff --git a/rt-thread-version/rt-thread-standard/packages-manual/lvgl-docs/introduction.md b/rt-thread-version/rt-thread-standard/packages-manual/lvgl-docs/introduction.md index d365edd89f6d41c0449663728dd4a20eef7d1ed9..a30c26b7edb777be84d3b13af2f4fdd03273fdb0 100644 --- a/rt-thread-version/rt-thread-standard/packages-manual/lvgl-docs/introduction.md +++ b/rt-thread-version/rt-thread-standard/packages-manual/lvgl-docs/introduction.md @@ -4,13 +4,17 @@ ## 已经适配 LVGL 的 BSP -| BSP 名称 | 文档 / 演示视频 | -| ------------------------------------------------------------ | ------------- | -| [QEMU 模拟器](https://github.com/RT-Thread/rt-thread/tree/master/bsp/qemu-vexpress-a9) | | -| [Visual Studio 模拟器](https://github.com/RT-Thread/rt-thread/tree/master/bsp/simulator) | | -| [正点原子 STM32L475 潘多拉](https://github.com/RT-Thread/rt-thread/tree/master/bsp/stm32/stm32l475-atk-pandora) | | +| BSP 名称 | 说明 | +| ------------------------------------------------------------ | ------------------------------------------------------------ | +| [QEMU 模拟器](https://github.com/RT-Thread/rt-thread/tree/master/bsp/qemu-vexpress-a9) | | +| [Visual Studio 模拟器](https://github.com/RT-Thread/rt-thread/tree/master/bsp/simulator) | | +| [正点原子 STM32L475 潘多拉](https://github.com/RT-Thread/rt-thread/tree/master/bsp/stm32/stm32l475-atk-pandora) | | -RT-Thread 的两款模拟器均适配了 LVGL,你可以不需要开发板也可以在 RT-Thread 操作系统上运行 LVGL 图形库。在已经适配好的 BSP 中,用户一键即可完成 LVGL 的配置并生成工程,编译下载后,自动演示 LVGL 的例程。如何配置请参考文档或(及)演示视频。 +RT-Thread 的两款模拟器均适配了 LVGL,你可以不需要开发板也可以在 RT-Thread 操作系统上运行 LVGL 图形库。在已经适配好的 BSP 中,用户一键即可完成 LVGL 的配置并生成工程,编译下载后,自动演示 LVGL 的例程。如何配置请参考文档或(及)讲解视频。 + +## 讲解视频 + +https://www.bilibili.com/video/BV1YM4y1F7fX ## 如何将 LVGL 移植到某个 BSP @@ -18,22 +22,22 @@ RT-Thread 的两款模拟器均适配了 LVGL,你可以不需要开发板也 LVGL 的配置文件有三个: -| 配置文件名称 | 位置 | 功能 | 用户是否需要修改此文件 | -| ------------------- | ------------------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------------------ | -| lv_conf_internal.h | LVGL 侧:[lvgl/src/](lvgl/src/) | 将用户未配置的功能设置为默认值 | 不需要 | -| lv_rt_thread_conf.h | LVGL 侧:[lvgl/rt-thread/](lvgl/rt-thread/) | 接管与操作系统相关的配置(例如时基信号、内存等) | 不需要 | -| lv_conf.h | RT-Thread 侧:[参考](https://github.com/RT-Thread/rt-thread/blob/master/bsp/stm32/stm32l475-atk-pandora/applications/lvgl/lv_conf.h) | 用户自定义配置 | 需要用户自行在具体 BSP 的 applications/lvgl 文件夹下创建,名字千万不要乱改! | +| 配置文件名称 | 位置 | 功能 | 用户是否需要修改此文件 | +| ------------------- | ------------------------------------------------------------ | ------------------------------------------------ | -------------------------------------------------------- | +| lv_conf_internal.h | LVGL 侧:[lvgl/src/](lvgl/src/) | 将用户未配置的功能设置为默认值 | 不需要 | +| lv_rt_thread_conf.h | LVGL 侧:[lvgl/rt-thread/](lvgl/rt-thread/) | 接管与操作系统相关的配置(例如时基信号、内存等) | 不需要 | +| lv_conf.h | RT-Thread 侧:[参考](https://github.com/RT-Thread/rt-thread/blob/master/bsp/stm32/stm32l475-atk-pandora/applications/lvgl/lv_conf.h) | 用户自定义配置 | 需要用户自行在具体 BSP 的 applications/lvgl 文件夹下创建 | 从上表中可以看出,虽然配置文件看起来三个很多,但是实际需要用户干预的只有最后一项,即用户需要在 BSP 的 applications 文件夹中创建一个 lvgl 文件夹,该文件夹就是用来放置 lvgl 相关文件的,内容如下: | 文件名称 | 作用 | | ------------------ | ------------------------------------------------------------ | -| lv_conf.h | 用户自定义配置 LVGL 功能 | -| lv_port_disp.c/.h | LVGL 显示屏对接文件,内部需要有一个叫 `void lv_port_disp_init(void)` 的函数(该函数必须存在) | -| lv_port_indev.c/.h | LVGL 输入设备对接文件,内部需要有一个叫 `void lv_port_indev_init(void)` 的函数(该函数必须存在) | -| lv_demo.c | 初始化 LVGL 线程,并调用 LVGL 的 demo 函数 | +| lv_conf.h | 用户自定义配置 LVGL 功能(该文件名不可以乱改) | +| lv_port_disp.c/.h | LVGL 显示屏对接文件,内部需要有一个叫 `void lv_port_disp_init(void)` 的函数(该函数必须存在,.h文件必须同名) | +| lv_port_indev.c/.h | LVGL 输入设备对接文件,内部需要有一个叫 `void lv_port_indev_init(void)` 的函数(该函数必须存在,.h文件必须同名) | +| lv_demo.c | 初始化 LVGL 线程,并调用 LVGL 的 demo 函数(改文件可以根据具体需求改成不同的文件名,无特殊要求) | -注意:用户无需关心对 LVGL 本身的初始化 (`lv_init`),以及输入输出设备对接函数的初始化(`lv_port_disp_init`、`lv_port_indev_init`),这些初始化的工作已经在 LVGL 侧的[lv_rt_thread_port.c](https://github.com/lvgl/lvgl/blob/master/rt-thread/lv_rt_thread_port.c) 文件中自动初始化完成。 +注意:用户无需关心对 LVGL 本身的初始化 (`lv_init`),以及输入输出设备对接函数的初始化(`lv_port_disp_init`、`lv_port_indev_init`),这些初始化的工作已经在 LVGL 侧的 [lv_rt_thread_port.c](https://github.com/lvgl/lvgl/blob/master/rt-thread/lv_rt_thread_port.c) 文件中自动初始化完成。 ## 提问