四线 SPI 显示屏
此显示驱动程序支持使用 MIPI DBI 接口的四线 SPI 接口的 AMOLED 和 LCD 显示屏。
WARNING
此组件已被弃用,因为此类显示屏现在由 Mipi Spi 支持。 此组件可能会在未来版本中移除。
此驱动程序已使用以下显示屏进行测试:
- Lilygo T4-S3
- Lilygo T-Display S3 AMOLED
- JC4832W535 开发板
- JC3636W518 开发板
此组件需要 ESP32 并使用 ESP-IDF。由于显示缓冲区的大小,PSRAM 是必需的。必须配置 四线 SPI 总线 接口。
# 配置示例
display: - platform: qspi_dbi model: RM690B0 data_rate: 80MHz dimensions: width: 450 height: 600 offset_width: 16 brightness: 255 cs_pin: GPIOXX reset_pin: GPIOXX enable_pin: GPIOXX-
model (必填):可选
CUSTOMRM67162RM690B0JC4832W535JC3636W518AXS15231
-
init_sequence (可选, 字节数组列表):指定显示屏的初始化序列。使用
CUSTOM型号时必需 - 但可以为空。如果为其他型号指定,此数据将在预配置序列之后发送。 -
cs_pin (**必填”, 引脚模式):片选引脚。
-
reset_pin (可选, 引脚模式):RESET 引脚。
-
enable_pin (可选, 引脚模式):显示屏使能引脚。
-
brightness (可选, int):亮度值,范围 0-255
-
update_interval (可选, 时间):重新绘制屏幕的间隔。默认为
5s。 -
auto_clear_enabled (可选, 布尔值):是否在每次 lambda 调用之前自动清除显示数据,或保留现有显示内容(必须显式覆盖,例如仅在数据更改时)。如果配置了 lambda 或页面,默认为
true,否则为 false。 -
pages (可选, 列表):显示页面而不是单个 lambda。详见显示页面。
-
id (可选, ID):手动指定用于代码生成的 ID。
-
color_order (可选):应为
rgb(默认)或bgr之一。 -
dimensions (**必填”):屏幕尺寸,指定为 宽度 x 高度(如
320x240)或使用单独的配置键。- height (**必填”, int):指定显示屏高度(像素)。
- width (**必填”, int):指定显示屏宽度。
- offset_width (可选, int):指定显示屏 x 方向的偏移量,通常用于显示屏小于驱动芯片支持的最大尺寸时。默认为 0。
- offset_height (可选, int):指定显示屏 y 方向的偏移量。默认为 0。
-
rotation (可选):在软件中旋转显示屏显示。选择
0°、90°、180°或270°之一。 -
transform (可选):使用硬件变换显示屏显示。所有默认值均为
false。此选项不能与rotation同时使用。- swap_xy (可选, 布尔值):如果为 true,交换 x 和 y 轴。某些芯片不可用。
- mirror_x (可选, 布尔值):如果为 true,镜像 x 轴。
- mirror_y (可选, 布尔值):如果为 true,镜像 y 轴。
-
data_rate (可选, int):设置显示屏 SPI 接口的数据速率。可选
80MHz、40MHz、20MHz、10MHz(默认)、5MHz、2MHz或1MHz。 -
spi_mode (可选):设置显示屏 SPI 接口的模式。默认为
MODE0。 -
invert_colors (可选, 布尔值):使用此布尔选项可以反转显示屏颜色。
-
draw_from_origin (可选, 布尔值):设置后,所有部分显示更新将从原点 (0,0) 开始。默认为 false。
-
draw_rounding (可选, int):满足要求部分绘制必须对齐到某些边界的显示芯片。默认为 2,必须是 2 的幂。
Lilygo T4-S3
Section titled “Lilygo T4-S3”spi: id: quad_spi type: quad clk_pin: 15 data_pins: [14, 10, 16, 12]
i2c: sda: 6 scl: 7
touchscreen: - platform: cst226 id: my_touchscreen interrupt_pin: 8 reset_pin: 17
display: - platform: qspi_dbi model: RM690B0 data_rate: 80MHz spi_mode: mode0 dimensions: width: 450 height: 600 offset_width: 16 color_order: rgb invert_colors: false brightness: 255 cs_pin: 11 reset_pin: 13 enable_pin: 9
psram: mode: octal speed: 80MHzLilygo T-Display S3 AMOLED
Section titled “Lilygo T-Display S3 AMOLED”spi: id: quad_spi type: quad clk_pin: 47 data_pins: - 18 - 7 - 48 - 5
i2c: sda: 3 scl: 2
touchscreen: - platform: cst816 id: my_touchscreen interrupt_pin: number: 21
display: - platform: qspi_dbi model: RM67162 id: main_lcd dimensions: height: 240 width: 536 transform: mirror_x: true swap_xy: true color_order: rgb brightness: 255 cs_pin: 6 reset_pin: 17 enable_pin: 38JC4832W535 3.5 英寸 LCD 开发板
Section titled “JC4832W535 3.5 英寸 LCD 开发板”这使用软件旋转将显示屏旋转为横屏模式。
psram: mode: octal speed: 80MHz
spi: id: display_qspi type: quad clk_pin: 47 data_pins: [21,48,40,39]
power_supply: id: backlight_id pin: 1 enable_on_boot: true
display: - platform: qspi_dbi model: JC4832W535 data_rate: 40MHz rotation: 270 dimensions: height: 480 width: 320 cs_pin: number: 45 ignore_strapping_warning: true show_test_card: true
i2c: sda: 4 scl: 8
touchscreen: platform: axs15231 transform: swap_xy: true mirror_y: true