平凉市网站建设_网站建设公司_云服务器_seo优化
2026/1/17 20:30:27 网站建设 项目流程

设备树HZ-RK3506_MiniEVM_MIPI3.1.dtsi

#include <dt-bindings/display/drm_mipi_dsi.h>
#include <dt-bindings/input/rk-input.h>
#include <dt-bindings/suspend/rockchip-rk3506.h>&i2c0 {status = "okay";clock-frequency = <400000>;//pinctrl-0 = <&rm_io26_i2c0_scl &rm_io25_i2c0_sda>;pinctrl-0 = <&rm_io25_i2c0_scl&rm_io26_i2c0_sda>;myts@38 {compatible = "my,touch";reg = <0x38>;tp-size = <89>;tp-supply = <&vcc_sys>;max-x = <480>;max-y = <800>;touch-gpio = <&gpio1 RK_PB6 IRQ_TYPE_LEVEL_LOW>;reset-gpio = <&gpio1 RK_PB0 GPIO_ACTIVE_HIGH>;};GP7101@58 {compatible = "gp7101-backlight";reg = <0x58>;max-brightness-levels = <255>;default-brightness-level = <100>;};
};&pinctrl {dsi {dsi_rst_gpio: dsi-rst-gpio {rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;};};myts{touch_gpio: touch-gpio {rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_up>;};};
};&dsi {status = "okay";rockchip,lane-rate = <1000>;dsi_panel: panel@0 {status = "okay";compatible = "simple-panel-dsi";reset-gpios = <&gpio0 RK_PA1 GPIO_ACTIVE_LOW>;reg = <0>;backlight = <&backlight>;reset-delay-ms = <30>;enable-delay-ms = <100>;prepare-delay-ms = <20>;unprepare-delay-ms = <20>;disable-delay-ms = <20>;init-delay-ms = <120>;dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET)>;dsi,format = <MIPI_DSI_FMT_RGB888>;dsi,lanes  = <2>;panel-init-sequence = [// init code05 78 01 0105 78 01 1139 00 06 FF 77 01 00 00 1115 00 02 D1 1115 00 02 55 B0 // 80 90 b039 00 06 FF 77 01 00 00 1039 00 03 C0 63 0039 00 03 C1 09 0239 00 03 C2 37 0815 00 02 C7 00 // x-dir rotate 0:0x00,rotate 180:0x0415 00 02 CC 3839 00 11 B0 00 11 19 0C 10 06 07 0A 09 22 04 10 0E 28 30 1C39 00 11 B1 00 12 19 0D 10 04 06 07 08 23 04 12 11 28 30 1C39 00 06 FF 77 01 00 00 11 // enable  bk fun of  command 2  BK115 00 02 B0 4D15 00 02 B1 60 // 0x56  0x4a  0x5b15 00 02 B2 0715 00 02 B3 8015 00 02 B5 4715 00 02 B7 8A15 00 02 B8 2115 00 02 C1 7815 00 02 C2 7815 64 02 D0 8839 00 04 E0 00 00 0239 00 0C E1 01 A0 03 A0 02 A0 04 A0 00 44 4439 00 0D E2 00 00 00 00 00 00 00 00 00 00 00 0039 00 05 E3 00 00 33 3339 00 03 E4 44 4439 00 11 E5 01 26 A0 A0 03 28 A0 A0 05 2A A0 A0 07 2C A0 A039 00 05 E6 00 00 33 3339 00 03 E7 44 4439 00 11 E8 02 26 A0 A0 04 28 A0 A0 06 2A A0 A0 08 2C A0 A039 00 08 EB 00 01 E4 E4 44 00 4039 00 11 ED FF F7 65 4F 0B A1 CF FF FF FC 1A B0 F4 56 7F FF39 00 06 FF 77 01 00 00 0015 00 02 36 00 //U&D  Y-DIR rotate 0:0x00,rotate 180:0x1015 00 02 3A 5505 78 01 1105 14 01 29];panel-exit-sequence = [05 00 01 2805 00 01 10];disp_timings0: display-timings {native-mode = <&dsi_timing0>;dsi_timing0: timing0 {clock-frequency = <27000000>;hactive = <480>;   	vactive = <800>;   	 hfront-porch = <32>;  hsync-len = <4>;   	 hback-porch = <32>;  vfront-porch = <9>;  vsync-len = <4>;     vback-porch = <3>;   hsync-active = <0>;vsync-active = <0>;de-active = <0>;pixelclk-active = <0>;};};ports {#address-cells = <1>;#size-cells = <0>;port@0 {reg = <0>;panel_in_dsi: endpoint {remote-endpoint = <&dsi_out_panel>;status = "okay";};};};};ports {#address-cells = <1>;#size-cells = <0>;port@1 {reg = <1>;dsi_out_panel: endpoint {remote-endpoint = <&panel_in_dsi>;};};};
};&display_subsystem {status = "okay";logo-memory-region = <&drm_logo>;
};&vop {status = "okay";
};&dsi_in_vop {status = "okay";
};&rgb_in_vop {status = "disabled";
};&route_dsi {status = "okay";//logo,rotate = <3>;
};&route_rgb {status = "disabled";
};&dsi_dphy {status = "okay";
};&backlight {compatible = "pwm-backlight";pwms = <&pwm0_4ch_2 0 25000 0>;status = "okay";
};

驱动

其实设备树背光pwm节点没有用到,因为屏幕亮度通过I2C转pwm芯片来实现的(原因是3.1寸屏幕最大电流25ma,而泰山派板载背光驱动电路110ma,有烧毁风险)

I2C-->PWM-->SY7201ABC

触摸驱动使用的就是官方的驱动,my_touch.c和gp7101_bl.c,放到指定文件夹然后在对应的makefile加上使其编译进内核

屏幕显示kernel logo和开机log

image

image

CONFIG_FB=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_LOGO=y

image

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询