5. 屏幕模组

5.1. mipi屏

LubanCat-RK系列板卡支持野火自家提供的mipi屏以及树莓派5寸屏(需要转接板)

  • 屏幕名称:野火mipi屏

  • 屏幕类型:LCD

  • 分辨率:1080x1920

  • 色彩:RGB888

  • 接口:四通道mipi-dsi

购买链接: (野火)5.5寸电容屏1920X1080 MIPI接口5点触控 颜色深度24位 RGB888

  • 屏幕名称:树莓派5寸屏(需要转接板)

  • 屏幕类型:LCD

  • 分辨率:800x480

  • 色彩:RGB888

  • 接口:四通道mipi-dsi

购买链接(仅供参考): (淘宝)树莓派屏幕购买链接

5.2. 接入mipi屏

将刷入专用镜像:Image-rk3568_lubancat_2_mipi1080p,rk3568支持MIPI+HDMI显示。rk3566默认关闭。

注意

接入HDMI时,两边会有黑边现象,这是因为HDMI作为副屏会根据主屏MIPI的宽高比进行缩放。

LubanCat-RK系列板卡的mipi接口类型都一样,使用的都是30pin的fpc排座,如图下

../../_images/screen4.png

与mipi屏幕的连接如图下

../../_images/screen3.png

危险

mipi-dsi接口不支持热插拔,请勿在上电的时候安装或者卸载屏幕, 上电时安装和卸载可能会导致板卡短路, 轻则板卡保护关机,重则损坏芯片的接口或者烧坏芯片

上电启动板子,开机显示:

../../_images/screen1.png

5.3. 设置屏幕横屏方法

我们需要在系统启动时配置好屏幕的参数,并通过mipi接口发送正确的信号给屏幕控制器。这样,屏幕就能正常显示系统的图形界面,方便用户操作和交互。

提供SDK默认竖屏,需要改横屏请参考我们修改方法如下: 找到文件修改:

rk356x:android11-dev/device/rockchip/rk356x/BoardConfig.mk
rk3588:android12-dev/device/rockchip/rk3588/BoardConfig.mk

屏幕信息参考下:

#rotate screen to 0, 90, 180, 270
#0:   ROTATION_NONE      ORIENTATION_0  : 0       #竖屏
#90:  ROTATION_RIGHT     ORIENTATION_90 : 90      #横屏
#180: ROTATION_DOWN      ORIENTATION_180: 180
#270: ROTATION_LEFT      ORIENTATION_270: 270

将Recovery和Android系统改为横屏:

- TARGET_RECOVERY_DEFAULT_ROTATION ?= ROTATION_NONE
+ TARGET_RECOVERY_DEFAULT_ROTATION ?= ROTATION_RIGHT

- SF_PRIMARY_DISPLAY_ORIENTATION ?= 0
+ SF_PRIMARY_DISPLAY_ORIENTATION ?= 90

修改横屏触摸位置:

5.5寸MIPI屏幕设备树路径:android11/kernel/arch/arm64/boot/dts/rockchip/rk3568-lubancat-dsi0-ebf410125_1080p.dtsi

找到&i2c1节点,
&i2c1 {
    status = "okay";
    clock-frequency = <100000>;

    gt911: gt911@5d {
            status = "okay";
            compatible = "goodix,gt911";
            reg = <0x5d>;
            interrupt-parent = <&gpio0>;
            interrupts = <RK_PB5 IRQ_TYPE_LEVEL_LOW>;
            reset-gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_LOW>;
            irq-gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
-           //touchscreen-inverted-x = <1>;  注释
            touchscreen-inverted-y = <1>;
+           touchscreen-swapped-x-y = <1>;  //添加
    };
};

10.1寸MIPI屏屏幕设备树路径:android11/kernel/arch/arm64/boot/dts/rockchip/rk3568-lubancat-dsi0-10.1-800x1280.dtsi

找到&i2c1节点,
&i2c1 {
    status = "okay";
    clock-frequency = <100000>;

    gt911: gt911@5d {
            status = "okay";
            compatible = "goodix,gt928";
            reg = <0x5d>;
            interrupt-parent = <&gpio0>;
            interrupts = <RK_PB5 IRQ_TYPE_LEVEL_LOW>;
            reset-gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_LOW>;
            irq-gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
            //touchscreen-inverted-y;
+           touchscreen-inverted-x = <1>;
+           touchscreen-swapped-x-y = <1>;  //添加
    };
};

Android12:禁用dsi1,防止启动vp2与3导致卡死系统

// 野火10.1寸屏幕
  #include "rk3588s-lubancat-dsi0-ebf410177_800x1280.dtsi"
- #include "rk3588s-lubancat-dsi1-ebf410177_800x1280.dtsi"
+ #include "rk3588s-lubancat-dsi1-ebf410177_800x1280.dtsi" //禁用dsi1

以上修改完成后,重新编译刷上开机屏幕已是横屏了。

../../_images/screen2.png