Skip to content

Commit

Permalink
chore(docs): update Zephyr documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
MengYJ-M committed Sep 13, 2024
1 parent 2d7ec1a commit 603019b
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions docs/integration/os/zephyr.rst
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ The pseudo device binding descriptions can be found at:
- `button input <https://docs.zephyrproject.org/latest/build/dts/api/bindings/input/zephyr,lvgl-button-input.html>`__
- `pointer input <https://docs.zephyrproject.org/latest/build/dts/api/bindings/input/zephyr,lvgl-pointer-input.html>`__
- `encoder input <https://docs.zephyrproject.org/latest/build/dts/api/bindings/input/zephyr,lvgl-encoder-input.html>`__
- `keypad input <https://docs.zephyrproject.org/latest/build/dts/api/bindings/input/zephyr,lvgl-keypad-input.html>`__

Essentially those buffer the :code:`input_event` generated by the device pointed to by the :code:`input` phandle or if left
empty the binding captures all events regardless of the source. You do not have to instantiate or manage the devices yourself,
Expand All @@ -287,6 +288,7 @@ Zephyr使用devicetree描述语言来创建和管理LVGL输入设备。
- `按钮输入 <https://docs.zephyrproject.org/latest/build/dts/api/bindings/input/zephyr,lvgl-button-input.html>`__
- `指针输入 <https://docs.zephyrproject.org/latest/build/dts/api/bindings/input/zephyr,lvgl-pointer-input.html>`__
- `编码器输入 <https://docs.zephyrproject.org/latest/build/dts/api/bindings/input/zephyr,lvgl-encoder-input.html>`__
- `键盘输入 <https://docs.zephyrproject.org/latest/build/dts/api/bindings/input/zephyr,lvgl-keypad-input.html>`__

这些设备本质上缓冲了由 :code:`input phandle` 指向的设备生成的 :code:`input_event`,
如果留空,则绑定会捕获所有事件,而不管其来源如何。
Expand Down Expand Up @@ -382,6 +384,76 @@ targets. For more information refer to the
更多信息请参阅 `应用程序开发指南 <https://docs.zephyrproject.org/latest/develop/application/index.html#application-configuration>`__。


Performance Tuning in LVGL(LVGL 性能调优)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. raw:: html

<details>
<summary>显示原文</summary>

To optimize LVGL's performance, several `kconfig` options can be configured:

- **CONFIG_LV_Z_VDB_SIZE**: Sets the rendering buffer size as a percentage of the display area, adjustable from 1% to 100%. Larger buffers can enhance performance, especially when used with **CONFIG_LV_Z_FULL_REFRESH**.

- **CONFIG_LV_Z_DOUBLE_VDB**: Enables the use of two rendering buffers, allowing for parallel rendering and data flushing, thus improving responsiveness and reducing latency.

- **CONFIG_LV_Z_VDB_ALIGN**: Ensures that the rendering buffer is properly aligned, which is critical for efficient memory access based on the color depth.

- **CONFIG_LV_Z_VBD_CUSTOM_SECTION**: Allows rendering buffers to be placed in a custom memory section (e.g., `.lvgl_buf`), useful for leveraging specific memory types like tightly coupled or external memory to enhance performance.

.. raw:: html

</details>
<br>


为了优化 LVGL 的性能,可以配置多个 `kconfig` 选项:

- **CONFIG_LV_Z_VDB_SIZE**:设置渲染缓冲区大小为显示区域的百分比,可调节范围从 1% 到 100%。较大的缓冲区可以提高性能,特别是与 **CONFIG_LV_Z_FULL_REFRESH** 一起使用时。

- **CONFIG_LV_Z_DOUBLE_VDB**:启用使用两个渲染缓冲区,允许并行渲染和数据刷新,从而提高响应性和减少延迟。

- **CONFIG_LV_Z_VDB_ALIGN**:确保渲染缓冲区正确对齐,这对于基于颜色深度的有效内存访问至关重要。

- **CONFIG_LV_Z_VBD_CUSTOM_SECTION**:允许将渲染缓冲区放置在自定义内存段(例如 `.lvgl_buf`),有助于利用特定类型的内存(如紧密耦合或外部内存)来提高性能。


Zephyr ≤ 3.7.0 Specific Options(Zephyr ≤ 3.7.0 特定选项)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. raw:: html

<details>
<summary>显示原文</summary>

For Zephyr versions 3.7.0 and below, additional options are available to manage LVGL's frame flushing:

- **CONFIG_LV_Z_FLUSH_THREAD**: Enables flushing LVGL frames in a separate thread, allowing the main thread to continue rendering the next frame simultaneously. This option can be disabled if the performance gain is not needed.

- **CONFIG_LV_Z_FLUSH_THREAD_STACK_SIZE**: Specifies the stack size for the flush thread, with a default of 1024 bytes.

- **CONFIG_LV_Z_FLUSH_THREAD_PRIO**: Sets the priority of the flush thread, with a default priority of 0, indicating cooperative priority.

For newer versions of Zephyr, the OSAL (Operating System Abstraction Layer) can be utilized, which takes care of the flushing.

.. raw:: html

</details>
<br>


对于 Zephyr 3.7.0 及以下版本,还有额外的选项可用于管理 LVGL 的帧刷新:

- **CONFIG_LV_Z_FLUSH_THREAD**: 在单独的线程中刷新 LVGL 帧,允许主线程同时继续渲染下一帧。如果不需要性能增益,可以禁用此选项。

- **CONFIG_LV_Z_FLUSH_THREAD_STACK_SIZE**: 指定刷新线程的堆栈大小,默认为 1024 字节。

- **CONFIG_LV_Z_FLUSH_THREAD_PRIO**: 设置刷新线程的优先级,默认优先级为 0,表示合作优先级。

对于较新版的 Zephyr,可以使用 OSAL(操作系统抽象层),它负责处理刷新。


Where can I find more information?(在哪里可以找到更多信息? )
-----------------------------------------------------------

Expand Down

0 comments on commit 603019b

Please sign in to comment.