Display
显示组包含与显示屏有关的配置,如接口、尺寸和缓冲策略。
接口与尺寸
如今,STM32微控制器可使用多种显示接口,如:
- 并行RGB(LTDC)
- MIPI DSI
- FMC
- SPI
如果MCU带有连接到LTDC或FMC的显示屏,TouchGFX Generator可生成代码,以将帧缓冲器传输到连接的显示屏。 对于DSI和SPI接口,驱动程序必须由开发人员自己实现。
Further reading
帧缓冲像素格式
TouchGFX Generator目前支持以下帧缓冲像素格式。 当使用“Custom”显示接口时,所有选项均可用,否则选项被限制为显示屏控制器设置(例如,配置LTDC Framebuffer格式为“RGB565”时,会将TouchGFX Generator中的配置选项限制为“RGB565”)。
- BW (1bpp)
- Grey2 (2bpp)
- Grey4 (4bpp)
- ABRG2222 (8bpp)
- ARGB2222 (8bpp)
- BGRA2222 (8bpp)
- RGBA2222 (8bpp)
- RGB565 (16bpp)
- RGB888 (24bpp)
- ARGB8888 (32bpp)
- XRGB8888 (32bpp)
Note
帧缓存跨度
对于有些显示器接口(例如:MIPI-DSI),其帧缓存跨度大于显示器实际宽度时,可增加数据至显示器的传输速率,前提是较大的跨度与数据包大小对准度更佳。 使用较大的帧缓存跨度可配置为:
- 否-帧缓存跨度和显示器宽度相等。
- 是-允许用户指定帧缓存跨度。
缓冲策略&位置
可通过TouchGFX Generator配置以下帧缓冲策略:
- 单帧缓冲 - 仅使用一个应用帧缓冲区。 可能会使性能受限,但占用内存更少。 可与“缓冲位置”配置一起使用,将其放置在内部RAM中。 为进一步优化,用户可以定义一个函数,该函数返回显示屏控制器正在处理的当前行。 该方法用于框架,以允许更新该帧期间已传输到显示屏的内存。
- 双缓冲 - 使用两个帧缓冲区。 通常以牺牲内存为代价来获得更好的性能。
- Partial Buffer - GRAM display - Use one or more user defined chunks of memory as the frame buffer, which are transferred to the GRAM on the display. 该策略适用于低成本解决方案,不依赖外部RAM,且显示屏的全帧缓冲可能超出可用内存。
- Partial Buffer - LTDC driven display - Use a single block of memory that a power-of-2 fraction of the display size, e.g., 1/2, 1/4 or 1/8. This strategy is targeted platforms that do not have external RAM and/or large display resolutions. A LTDC driven display and GFXMMU is required for this strategy.
In the case of Single Buffer, Double Buffer, and Partial Buffer - LTDC driven display users are allowed to configure their location through the "Buffer Location" configuration which offers the following options:
- 按分配- 允许链接器根据链接器脚本来放置帧缓冲存储器。 默认位于内部RAM中。
- 按地址- 允许用户定义一个(单) 或两个(双) 帧缓冲地址。
The Partial Buffer - GRAM display strategy allows the user to define the following parameters:
- 块数(始终放置在内部RAM中)
- 块大小(字节)
The Partial Buffer - LTDC driven display strategy allows the user to define the following parameter:
- Number of Partial Blocks (default is 4, meaning a framebuffer block 1/4 the size of the display)
To understand some core concepts regarding framebuffer strategies, refer to the Framebuffer Strategies article.
Several scenarios describe how to get started with different display interfaces and framebuffer strategies with concrete examples: