树莓派触摸显示屏 2

树莓派触摸显示屏 2是一款触摸屏 LCD,提供 5 英寸、7 英寸和 10 英寸版本。它面向平板电脑、娱乐系统和信息仪表板等交互式使用场景。

touch display 2 hero
图 1. Raspberry Pi Touch Display 2。

需要编写适用于各种不同设备和配置的代码。在业余时间,我为 iOS 开发应用程序,而过去几年里,这一过程愈发令人头疼。当初我开发第一款 iPhone 应用时,它只需在原始的 iPhone 上运行;然而如今,任何 iOS 应用都必须兼容多款 iPhone 和 iPad(这些设备拥有不同的处理器和屏幕),并且还要适配 iOS 的各个版本。更别提还要考虑让代码同时在 Android 上运行……

触控显示屏2 兼容: 不兼容: 支持多个 Touch Display 2

5英寸和7英寸

  • Raspberry Pi B+ 及之后。

  • 所有 Raspberry Pi Compute Module Interface (CMIO) 板。

  • Raspberry Pi Zero 系列。

  • Raspberry Pi Keyboard 计算机。

  • Raspberry Pi 5 及之后。

  • 所有 Raspberry Pi Compute Module Interface (CMIO) 板。

10英寸

  • Raspberry Pi CM4IO Board 及更早版本。

使用以下方式连接到板:DISP1 port, only.

  • Raspberry Pi 4B 及更早版本。

  • Raspberry Pi Zero 系列。

  • Raspberry Pi Keyboard 计算机。

  • Raspberry Pi 5 及之后。

  • Raspberry Pi CM5IO Board 及之后。

  • Raspberry Pi 5 及之后。

  • Raspberry Pi CM5IO Board 及之后。

使用以下任一方式连接到板:DISP port.

你可以将任何 SBC 外形规格的 Raspberry Pi 直接安装到 Touch Display 2 的背面。

自动检测

Raspberry Pi Model B+ 及之后的设备会自动检测 Touch Display 2。

Raspberry Pi Compute Modules 不会自动检测 DSI 显示屏,因为它们面向工业应用,在这些应用中,集成商可以将任何及所有 GPIO 和接口用于自己的目的。

规格参数

本节介绍 Touch Display 2 的特性和能力。

特点

Touch Display 2 具有以下特性:

  • 720 x 1280 像素分辨率。5 英寸和 7 英寸型号的高清输出。

  • 1200 x 1920 像素分辨率。10 英寸型号的高清输出。

  • 24 位 RGB 显示屏。能够显示超过 1600 万种颜色。

  • 多点触控。5 英寸和 7 英寸型号支持五指触控,10 英寸型号支持十指触控。

  • 鼠标等效。无需物理鼠标即可支持完整桌面控制,例如选择、拖动、滚动以及长按调出菜单。

  • 屏幕键盘。支持使用屏幕键盘代替物理键盘。

  • 集成电源。由主机 Raspberry Pi 设备直接供电,无需单独电源。

尺寸

Touch Display 2 具有以下尺寸:

触控显示屏2

深度

外形尺寸

可视区域

有效区域

5英寸

16 毫米

91.5 x 143.5 mm

63 x 111.5 毫米

62 x 110.5 毫米

7英寸

15毫米

120 x 189.5 毫米

88 x 155.5 mm

87 x 154.5 毫米

10英寸

15.5 毫米

166.9 x 248.1 毫米

136.4 x 217.6 mm

135.4 x 216.6 毫米

硬件

Touch Display 2 包装盒内含以下物品:

触控显示屏2 螺丝 扁平柔性电缆 GPIO 电源线

5英寸 / 7英寸

八颗 M2.5 螺丝

  • 15-way 转 15-way(Raspberry Pi 4 及更早版本)

  • 22-way 转 15-way标准 – 小型显示(Raspberry Pi 5)

GPIO 电源线

10英寸

  • 22-way 转 22-way迷你 – 迷你(Raspberry Pi 5)

Parts included in the Touch Display 2 box for 5-inch and 7-inch models
图 2. Touch Display 2 包装盒内 5 英寸和 7 英寸型号包含的部件。

连接

触控显示屏2 DSI 连接器(传输视频和触摸数据) GPIO 排针(传输电源)

5英寸和7英寸

  • Raspberry Pi 5 及更新版本,以及所有 CMIO Boards:随附 22-way 转 15-way标准型 – Mini Display FFC

  • Raspberry Pi 4 及更早版本:随附 15-way 转 15-way FFC

随附的 GPIO 电源线将 Raspberry Pi 上的 GPIO 排针连接到显示屏。

10英寸

  • Raspberry Pi 5 及更新版本,以及所有 CMIO Boards:随附迷你 – 迷你22-way 转 22-way FFC

连接到 Raspberry Pi 设备

请遵循适用于你的 Touch Display 2 的相应步骤。

将设备连接到显示屏不需要任何特殊工具,但必须准备好正确的 FFC 排线。如果你不想将设备安装到显示屏上,可能需要更长的 FFC 排线。

你还需要你的设备、其启动介质及其电源。

如果你想将设备安装到显示屏上,需要一把适合显示屏随附 M2.5 螺丝的十字螺丝刀。

连接到 5 英寸或 7 英寸 Touch Display 2

Raspberry Pi B+ 及更高版本

Raspberry Pi B+ 及更高版本

开始步骤 1 前,请断开 Raspberry Pi 的电源。

步骤 1. 将 FFC 连接到 Touch Display 2

开始前,请检查您是否为 Raspberry Pi 型号选择了正确的柔性扁平电缆:

  • 对于树莓派 5请使用22 路转 15 路 FFC(Standard – Mini Display FFC)。

  • 对于所有其他 Raspberry Pi 型号,请使用15 芯转 15 芯 FFC.

要连接 FFC:

  1. 将 Touch Display 2 上 FFC 连接器两侧的固定夹向外滑出。

  2. 将 FFC 插入 Touch Display 2 的 FFC 连接器,然后将固定夹滑回原位以固定电缆。

    金属触点必须朝上,背向 Touch Display 2。

    如果要连接到 Raspberry Pi 5,因而使用 22-way to 15-way FFC,则 22-way 端是电缆较小的一端。将电缆较大的一端插入 Touch Display 2 的 FFC 连接器。

Image showing the flat flexible cable and GPIO connections correctly attached to the Touch Display 2
图 3. 柔性扁平电缆和 GPIO 电源电缆(见步骤 3)已正确连接到 Touch Display 2。

步骤 2. 将 FFC 连接到 Raspberry Pi

注意在此步骤中不要夹住 FFC。
  1. 从 Raspberry Pi 上 FFC 连接器的两侧向上滑动固定夹。此端口标记为DISPLAY on Raspberry Pi 4B and earlier.

  2. 将 FFC 的另一端连接到连接器,然后将固定夹滑回原位以固定电缆。

    金属触点必须朝向 Ethernet 和 USB-A 端口。

    The FFC connector attached to a Raspberry Pi device
    图 4. 连接到 Raspberry Pi 设备的 FFC 连接器。

步骤 3. 在设备和显示屏之间连接 GPIO 电源电缆

电源电缆连接不正确可能会损坏显示屏。
  1. 将 GPIO 电源电缆较小的一端插入J1 port on the Touch Display 2.

  2. 将 GPIO 电源电缆的三针端连接到您的Raspberry Pi 设备的 GPIO.

    使 USB 和以太网端口朝下,电源电缆必须垂直连接到 GPIO 排针的右上角。这意味着红色 5 V 电源电缆位于引脚块的右上角。

    这样,红色电缆连接到引脚 2(右上角),黑色电缆(接地)连接到引脚 6。

    The GPIO cable connected in the correct location and orientation, with the red 5 V cable at the top-right of the header
    图 5. 来自 Touch Display 2 的 GPIO 电缆连接到 Raspberry Pi 设备上 GPIO 排针的右上角。
  3. (可选)要将 Raspberry Pi 物理连接到 Touch Display 2,请将设备与 Touch Display 2 上的四个角支柱对齐,然后将四颗 M2.5 螺丝(附带)插入支柱,并拧紧直到您的 Raspberry Pi 固定牢靠。

步骤 4. 启动 Raspberry Pi

现在您已将 Raspberry Pi 连接到 Touch Display 2,请将其开机。

  1. 将启动介质连接到 Raspberry Pi。

  2. 将 Raspberry Pi 连接到电源。

    设备启动时 Touch Display 2 会开启,但 Raspberry Pi OS 可能需要长达一分钟才能在屏幕上开始显示输出。

树莓派计算模块

树莓派计算模块

本节假设你熟悉自己的 Compute Module。有关更多信息,请参阅树莓派计算模块.

你可以将 Touch Display 2 连接到已安装在 IO Board 上的 Raspberry Pi Compute Module。你需要一个 Raspberry Pi标准型 – Mini Display FFC(单独出售)来完成此操作。

步骤 1。在config.txt

Raspberry Pi Compute Modules 不会自动检测 Touch Display 2。

你必须通过在config.txt. The default connection is the port labelled 1, but you can use the port labelled 0.

如果你使用的是带有 eMMC 存储器的 Raspberry Pi Compute Module,请确保编辑用于启动该设备的配置文件中添加 overlay 条目,为 Compute Module 配置其要连接的设备:要么是存储在 eMMC 上的那个,要么是如果你重新配置了启动顺序后位于外部启动介质上的那个。参见rpiboot.

要启用 Touch Display 2:

  1. 启动你的 Raspberry Pi Compute Module,然后打开/boot/firmware/config.txt.

    如果你运行的是无头设置,可以在另一台计算机上打开启动介质,或者使用 Raspberry Pi Connect 或 SSH 远程连接到设备。

  2. 编辑config.txt file to 添加以下之一:

    • 对于5英寸显示,输入dtoverlay=vc4-kms-dsi-ili9881-5inch

    • 对于7英寸显示,输入dtoverlay=vc4-kms-dsi-ili9881-7inch

      要使用CAM/DISP 0 or DISP0 port, append ,dsi0 to the overlay name:

    • 对于5英寸显示,输入dtoverlay=vc4-kms-dsi-ili9881-5inch,dsi0

    • 对于7英寸显示,输入dtoverlay=vc4-kms-dsi-ili9881-7inch,dsi0

  3. 关闭设备电源,然后断开电源供应。

步骤 2. 将 FFC 连接到 Touch Display 2

如果你还没有这样做,请在继续之前断开 Raspberry Pi Compute Module 的电源。

要将 FFC 连接到显示屏:

  1. 将 Touch Display 2 上 FFC 连接器两侧的固定夹向外滑出。

  2. 将 FFC 最宽的一端插入 Touch Display 2 FFC 连接器,然后将固定夹滑回原位以固定电缆。

    金属触点必须朝上,背向 Touch Display 2。

Image showing the flat flexible cable correctly attached to the Touch Display 2
图 6. 连接到 Touch Display 2 的 FFC。

步骤 3. 将 FFC 连接到 Raspberry Pi Compute Module IO Board

  1. 打开 Raspberry Pi Compute Module IO Board 上 FFC 连接器上的固定夹。确保你选择的是你设置的连接器(CAM/DISP 1 or CAM/DISP 0) in the configuration file in Step 1.

  2. 将 FFC 的另一端插入连接器端口,然后合上固定夹以固定电缆。

    金属触点必须朝下。

  3. 将两个跳线添加到J6, as required:

    • 如果连接到CAM/DISP 1 on Raspberry Pi Compute Module 5 IO Board.

    • 如果连接到DISP0 interface on Raspberry Pi Compute Module 4 IO Board.

The FFC connector attached to a Raspberry Pi device
图 7。连接到 Raspberry Pi 设备的 FFC connector。请注意,DSI port 在某些设备上呈水平方向,在其他设备上呈垂直方向。

步骤 4。将 GPIO power cable 连接在设备和显示器之间

电源电缆连接不正确可能会损坏显示屏。

要将 GPIO power cable(随显示器提供)连接到 Raspberry Pi Compute Module 4 IO Board 及之后版本:

  1. 将 GPIO 电源电缆较小的一端插入J1 port on the Touch Display 2.

  2. 将 Compute Module IO Board 放置为 USB 和 HDMI 端口朝左。

  3. 将 GPIO power cable 的三针端连接到 GPIO header 的右上方(标有Rasperry Pi HAT on the silkscreen).

Image showing the correct installation of a GPIO power cable on a Raspberry Pi Compute Module IO Board.
图 8。连接到 Raspberry Pi Compute Module Board 上 GPIO header 的 GPIO power cable。

步骤 5。为您的 Compute Module 通电

Image showing a Raspberry Pi Compute Module IO Board attached to a Touch Display 2.
图 9。连接到 Touch Display 2 的 Raspberry Pi Compute Module IO Board。

现在您已将 Raspberry Pi Compute Module 连接到 Touch Display 2,请为 Compute Module 通电。

  1. 将您的 boot media 连接到 Raspberry Pi 设备——如果您从 eMMC 启动,请跳过此步骤。

  2. 将 Raspberry Pi 设备连接到您的电源。

  3. 如果您的 IO board 上有该按钮,请按下并松开电源按钮.

    设备启动时 Touch Display 2 会开启,但 Raspberry Pi OS 可能需要长达一分钟才能在屏幕上开始显示输出。

连接到 10 英寸 Touch Display 2

Raspberry Pi 5 及更高版本

Raspberry Pi 5 及更高版本

步骤 1。更新 Raspberry Pi 设备的软件和 bootloader

  1. 从命令行运行以下命令以更新设备的操作系统:

    $ sudo apt update && sudo apt full-upgrade
  2. 从命令行运行以下命令以更新设备的 EEPROM bootloader:

    $ sudo rpi-eeprom-update -a

步骤 2. 将 FFC 连接到 Touch Display 2

在开始 Step 2 之前,请断开 Raspberry Pi 设备的电源。

要连接迷你 – 迷你22-way to 22-way FFC:

  1. 将 Touch Display 2 上 FFC 连接器两侧的固定夹向外滑出。

  2. 将 FFC 插入 Touch Display 2 的 FFC 连接器,然后将固定夹滑回原位以固定电缆。

    金属触点必须朝上,背向 Touch Display 2。

Image showing the flat flexible cable correctly attached to the Touch Display 2 10-inch model
图 10。正确连接到 Touch Display 2 10 英寸型号的 flat flexible cable。

步骤 3。将 FFC 连接到 Raspberry Pi

注意在此步骤中不要夹住 FFC。
  1. 将 Raspberry Pi 上 FFC connector 两侧的 retaining clip 向上滑动。

  2. 将 FFC 的另一端连接到连接器,然后将固定夹滑回原位以固定电缆。

    金属触点必须朝向 Ethernet 和 USB-A 端口。

    步骤 4。将 GPIO power cable 连接在设备和显示器之间

电源电缆连接不正确可能会损坏显示屏。
  1. 将 GPIO 电源电缆较小的一端插入J1 port on the Touch Display 2.

  2. 将 GPIO 电源电缆的三针端连接到您的Raspberry Pi 设备的 GPIO.

    使 USB 和以太网端口朝下,电源电缆必须垂直连接到 GPIO 排针的右上角。这意味着红色 5 V 电源电缆位于引脚块的右上角。

    这样,红色电缆连接到引脚 2(右上角),黑色电缆(接地)连接到引脚 6。

    The GPIO cable connected in the correct location and orientation, with the red 5 V cable at the top-right of the header
    图 11。来自 Touch Display 2 的 GPIO cable 连接到 Raspberry Pi 设备上 GPIO header 的右上角。
  3. (可选)要将 Raspberry Pi 物理连接到 Touch Display 2,请将设备与 Touch Display 2 上的四个角支柱对齐,然后将四颗 M2.5 螺丝(附带)插入支柱,并拧紧直到您的 Raspberry Pi 固定牢靠。

步骤 5。为 Raspberry Pi 通电

现在您已将 Raspberry Pi 连接到 Touch Display 2,请将其开机。

  1. 将启动介质连接到 Raspberry Pi。

  2. 将 Raspberry Pi 连接到电源。

    设备启动时 Touch Display 2 会开启,但 Raspberry Pi OS 可能需要长达一分钟才能在屏幕上开始显示输出。

  3. 要放大 UI 元素以便更轻松查看,请选择偏好设置 > Control Centre,然后选择默认值 > 适用于大屏幕: > 设置默认值.

树莓派计算模块

树莓派计算模块

本节假设你熟悉自己的 Compute Module。有关更多信息,请参阅树莓派计算模块.

你可以将 Touch Display 2 连接到安装在 IO Board 上的 Raspberry Pi Compute Module。为此,请使用随附的迷你 – 迷你FFC。

10 英寸显示屏需要四路 DSI 数据。在 CM5 Board 及更高版本上,你可以使用任一DISP0 or the DISP1 port. On the CM4 Board and earlier, only port DISP1 supports this.

步骤 1。在config.txt

Raspberry Pi Compute Modules 不会自动检测 Touch Display 2 设备。

你必须为 Compute Module 配置其连接的设备,方法是在config.txt.

如果你使用的是带有 eMMC 存储器的 Raspberry Pi Compute Module,请确保编辑用于启动该设备的配置文件中添加 overlay 条目,为 Compute Module 配置其要连接的设备:要么是存储在 eMMC 上的那个,要么是如果你重新配置了启动顺序后位于外部启动介质上的那个。参见rpiboot.

要启用 Touch Display 2:

  1. 启动你的 Raspberry Pi Compute Module,然后打开/boot/firmware/config.txt.

    如果你运行的是无头设置,可以在另一台计算机上打开启动介质,或者使用 Raspberry Pi Connect 或 SSH 远程连接到设备。

  2. 编辑config.txt file to 添加以下内容中添加 overlay 条目:

    • dtoverlay=vc4-kms-dsi-ili79600-10-1inch

  3. 如果使用DISP0 port on a Compute Module 5, 添加以下内容中添加 overlay 条目:

    • dtoverlay=vc4-kms-dsi-ili79600-10-1inch,dsi0

步骤 2. 将 FFC 连接到 Touch Display 2

如果你还没有这样做,请在继续之前断开 Raspberry Pi Compute Module 的电源。

要将 FFC 连接到显示屏:

  1. 将 Touch Display 2 上 FFC 连接器两侧的固定夹向外滑出。

  2. 将 FFC 插入连接器,然后将固定夹滑回原位以固定排线。

    金属触点必须朝上,背向 Touch Display 2。

Image showing the flat flexible cable correctly attached to the Touch Display 2 10-inch model
图 12。扁平柔性排线已正确连接到 Touch Display 2 10 英寸型号。

步骤 3. 将 FFC 连接到 Raspberry Pi Compute Module IO Board

  1. 打开 Raspberry Pi Compute Module IO Board 上 FFC 连接器上的固定夹。确保你选择的是你设置的连接器(CAM/DISP 1 or CAM/DISP 0) in the configuration file in Step 1.

  2. 将 FFC 的另一端插入连接器端口,然后合上固定夹以固定电缆。

    金属触点必须朝下。

  3. 如果连接到 Raspberry Pi Compute Module 5 IO BoardDISP1, add two jumpers to J6.

步骤 4。将 GPIO power cable 连接在设备和显示器之间

电源电缆连接不正确可能会损坏显示屏。

要将 GPIO power cable(随显示器提供)连接到 Raspberry Pi Compute Module 4 IO Board 及之后版本:

  1. 将 GPIO 电源电缆较小的一端插入J1 port on the Touch Display 2.

  2. 将 Compute Module IO Board 放置为 USB 和 HDMI 端口朝左。

  3. 将 GPIO power cable 的三针端连接到 GPIO header 的右上方(标有Raspberry Pi HAT on the silkscreen).

Image showing the correct installation of a GPIO power cable on a Raspberry Pi Compute Module IO Board.
图 13。GPIO 电源线已连接到 Raspberry Pi Compute Module IO Board 上的 GPIO 排针。

步骤 5。为您的 Compute Module 通电

Image showing a Raspberry Pi Compute Module IO Board physically mounted and attached to a Touch Display 2 10-inch model.
图 14。已安装并连接到 Touch Display 2 10 英寸型号的 Raspberry Pi Compute Module IO Board。

现在您已将 Raspberry Pi Compute Module 连接到 Touch Display 2,请为 Compute Module 通电。

  1. 将您的 boot media 连接到 Raspberry Pi 设备——如果您从 eMMC 启动,请跳过此步骤。

  2. 将 Raspberry Pi 设备连接到您的电源。

  3. 如果您的 IO board 上有该按钮,请按下并松开电源按钮。

    设备启动时 Touch Display 2 会开启,但 Raspberry Pi OS 可能需要长达一分钟才能在屏幕上开始显示输出。

故障排除

您的显示屏现在可以使用了,但如果它没有开启或没有显示任何内容,请检查以下各项:

  • 软件更新。确保你运行的是最新版本的 Raspberry Pi OS,并且已安装最新的 EEPROM 引导加载程序固件。参见更新软件和引导加载程序.

  • DSI 连接。检查 FFC 排线两端是否已正确就位,金属条是否正确朝向连接处,以及是否连接到正确的 DSI 连接器。

  • GPIO 连接。显示屏由来自设备的 GPIO 线供电,因此请确保排线两端均已正确就位,并且排线的三针端已连接到 GPIO 排针的正确引脚。

  • 电源. 检查您的设备是否已通电并已连接启动介质(如需要)。如果您使用的是带电源开关的 Compute Module,请检查该开关是否已按下。

  • config.txt. 如果您使用的是 Compute Module,请检查您添加到 的 overlay 的语法config.txt in Step 1. Check also that you’ve specified the correct screen size in the overlay.

  • EEPROM 启动顺序. 如果您使用的是带板载启动介质的 Compute Module,或者您的 Compute Module 连接了多个驱动器,请确保config.txt file you edited in Step 1 is on the boot media you’re booting from.

屏幕键盘

Raspberry Pi OS书虫及更高版本包含Squeekboard 屏幕键盘.

使用 Touch Display 2 时,当你可输入文本时,此键盘会自动出现;当无法输入时,它会自动消失。

对于不支持文本输入检测的应用程序,你可以通过选择任务栏右上角的键盘图标来手动显示或隐藏键盘。

要使用 Raspberry Pi 图形界面始终显示或始终禁用屏幕键盘:

  1. 从 Raspberry Pi 菜单中,转到首选项 > 控制中心 > 显示.

  2. 选择始终启用或禁用,根据需要。

要使用命令行永久显示或禁用屏幕键盘:

  1. 打开终端,然后输入sudo raspi-config.

  2. 导航到显示以下部分:raspi-config, then choose your keyboard setting.

更改显示方向

如果你使用的是带桌面环境的 Raspberry Pi OS,你可以使用 Raspberry Pi Control Centre 应用程序更改 Touch Display 2 的方向。这样你可以独立更改多个已连接显示器的方向。

如果你使用的是 Raspberry Pi OS Lite(没有桌面环境),你可以通过编辑来更改 Touch Display 2 的方向/boot/firmware/cmdline.txt. However, if you have multiple displays connected, this method changes the orientation of them all.

有四种方向可供选择:

  • 正常(默认)。纵向格式。

  • 左. 显示器顺时针旋转 90 度。

  • 倒置. 显示器旋转 180 度。

  • 右. 显示器顺时针旋转 270 度。

使用桌面环境

使用 Raspberry Pi 桌面旋转显示:

  1. 访问首选项 > 控制中心 > 屏幕.

  2. 右键单击布局编辑器中代表你的 Touch Display 2 的矩形(可能标记为DSI-1).

  3. 选择方向(Orientation).

  4. 在以下选项之间选择正常, 左, 倒置,或右,以旋转显示器。

  5. 选择应用,然后选择确定以保留你的更改,或取消以放弃它。

使用 kernel command line

要通过编辑内核命令行在控制台模式下旋转显示:

  1. 打开/boot/firmware/cmdline.txt file, which contains parameters that Raspberry Pi OS reads when it boots.

  2. 将以下内容添加到文件末尾,替换<rotation-value> with the number of degrees clockwise to rotate by (0, 90, 180, or 270):

    video=DSI-1:720x1280@60,rotate=<rotation-value>

    该rotate= setting only rotates the text-mode console. For applications that write directly to DRM, such as cvlc or the libcamera apps, use the rotation options that come with them (if available).

更改显示亮度

  1. 访问首选项 > 控制中心 > 屏幕.

  2. 右键单击布局编辑器中代表你的 Touch Display 2 的矩形(可能标记为DSI-1).

  3. 选择亮度.

  4. 选择亮度级别。

    亮度级别会立即更改。

自定义触摸屏设置

这些设置仅在旋转显示器并在非桌面环境中使用触摸输入时才需要。

使用 Device Tree overlay 告诉 Raspberry Pi OS 在启动时如何配置 Touch Display 2。

  • 对于 5 英寸显示屏,该 overlay 称为vc4-kms-dsi-ili9881-5inch.

  • 对于 7 英寸显示屏,该 overlay 称为vc4-kms-dsi-ili9881-7inch.

  • 对于 10 英寸显示屏,该 overlay 称为vc4-kms-dsi-ili79600-10-1inch.

要在启动配置中修改 Device Tree overlay:

  1. 打开/boot/firmware/config.txt.

  2. 将所需的 Device Tree 参数添加到一个dtoverlay line, separated by commas. See the Device Tree options table below for details.

Device Tree 选项

参数 操作

sizex

设置触摸水平分辨率(5 英寸和 7 英寸型号默认为 720,10 英寸型号默认为 1200)

sizey

设置触摸垂直分辨率(5 英寸和 7 英寸型号默认为 1280,10 英寸型号默认为 1920)

invx

反转触摸 X 轴(左/右)

invy

反转触摸 Y 轴(上/下)

swapxy

交换触摸 X 和 Y 轴(逻辑上旋转 90°)

disable_touch

禁用触摸屏功能

  • 布尔值(invx, invy, swapxy, and disable_touch) default to true if present, but you can set them to false using the suffix =0.

  • 整数(sizex and sizey) require a number, for example, sizey=240.

示例

在以下针对 7 英寸 Touch Display 2 的示例中,invx inverts the X axis, and invy inverts the Y axis:

dtoverlay=vc4-kms-dsi-ili9881-7inch,invx,invy