RK平台mipi屏初始化序列配置

更新时间:2023-12-09 21:26:16 阅读: 评论:0

2023年12月9日发(作者:珍惜爱)

-

RK平台mipi屏初始化序列配置

RK平台mipi屏初始化序列配置

RK平台mipi屏初始化序列都是在dts中进行配置,有两种方式,下面分别介绍两种方式的配置方法。

方式一

RK平台较老的SDK采用下面方式配置mipi参数,如:RK3128 5.1 SDK中就是采用的下面方式。

示例:

/ {

/* about mipi */

disp_mipi_init: mipi_dsi_init{

compatible = "rockchip,mipi_dsi_init";

rockchip,screen_init = <1>;

rockchip,dsi_lane = <4>;

rockchip,dsi_hs_clk = <550>;

rockchip,mipi_dsi_num = <1>;

};

disp_mipi_power_ctr: mipi_power_ctr {

compatible = "rockchip,mipi_power_ctr";

/*

mipi_lcd_rst:mipi_lcd_rst{

compatible = "rockchip,lcd_rst";

rockchip,gpios = <&gpio2 GPIO_D1 GPIO_ACTIVE_HIGH>;

rockchip,delay = <20>;

};

mipi_lcd_en:mipi_lcd_en {

compatible = "rockchip,lcd_en";

rockchip,gpios = <&gpio2 GPIO_D0 GPIO_ACTIVE_LOW>;

rockchip,delay = <100>;

};

*/

};

disp_mipi_init_cmds: screen-on-cmds {

compatible = "rockchip,screen-on-cmds";

rockchip,cmd_debug = <1>;

rockchip,on-cmds1 {

compatible = "rockchip,on-cmds";

rockchip,cmd_type = ;

rockchip,dsi_id = <0>;

rockchip,cmd = <0x15 0xE0 0x00>;

rockchip,cmd_delay = <0>;

};

rockchip,on-cmds2 {

compatible = "rockchip,on-cmds";

rockchip,cmd_type = ;

rockchip,dsi_id = <0>;

rockchip,cmd = <0x39 0x55 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10>;

rockchip,cmd_delay = <0>;

};

//SLP OUT

rockchip,on-cmds3 {

compatible = "rockchip,on-cmds";

rockchip,cmd_type = ;

rockchip,dsi_id = <0>;

rockchip,cmd = <0x05 0x11>;

rockchip,cmd_delay = <120>;

};

//DISP ON

rockchip,on-cmds4 {

rockchip,on-cmds4 {

compatible = "rockchip,on-cmds";

rockchip,cmd_type = ;

rockchip,dsi_id = <0>;

rockchip,cmd = <0x05 0x29>;

rockchip,cmd_delay = <5>;

};

};

disp_timings: display-timings {

native-mode = <&timing0>;

compatible = "rockchip,display-timings";

timing0: timing0 {

screen-type = ;

lvds-format = ;

out-face = ;

clock-frequency = <67330000>;

hactive = <800>;

vactive = <1280>;

hback-porch = <18>;

hfront-porch = <18>;

vback-porch = <10>;

vfront-porch = <20>;

hsync-len = <18>;

vsync-len = <4>;

hsync-active = <0>;

vsync-active = <0>;

de-active = <0>;

pixelclk-active = <0>;

swap-rb = <0>;

swap-rg = <0>;

swap-gb = <0>;

};

};

};

这里只分析disp_mipi_init_cmds的配置规则,disp_mipi_init、disp_mipi_power_ctl、disp_timings不分析,其中disp_timings可以参考另一

篇文章:《如何确定lcd timing参数》。

下面代码段为一条mipi初始化数据,主要关心的参数有“rockchip,cmd”和“rockchip,cmd_delay”。

rockchip,on-cmds1 {

compatible = "rockchip,on-cmds";

rockchip,cmd_type = ;

rockchip,dsi_id = <0>;

rockchip,cmd = <0x15 0xE0 0x00>;

rockchip,cmd_delay = <0>;

};

rockchip,cmd

命令格式如下:

0x15 0xE0 0x00

| | |

| | 数据

| 寄存器地址

命令类型(0x05: 单字节数据 0x15: 双字节数据 0x39: 多字节数据)

单字节数据举例:

rockchip,on-cmds3 {

compatible = "rockchip,on-cmds";

rockchip,cmd_type = ;

rockchip,dsi_id = <0>;

rockchip,cmd = <0x05 0x11>;

rockchip,cmd_delay = <120>;

};

双字节数据举例:

rockchip,on-cmds1 {

compatible = "rockchip,on-cmds";

rockchip,cmd_type = ;

rockchip,dsi_id = <0>;

rockchip,cmd = <0x15 0xE0 0x00>;

rockchip,cmd_delay = <0>;

};

多字节数据举例:

rockchip,on-cmds2 {

compatible = "rockchip,on-cmds";

rockchip,cmd_type = ;

rockchip,dsi_id = <0>;

rockchip,cmd = <0x39 0x55 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10>;

rockchip,cmd_delay = <0>;

};

rockchip,cmd_delay

此字段定义发送完命令后延时时长,单位毫秒(ms),大部分命令无须延时。

方式二

RK平台新的SDK已经统一采用下面方式配置mipi参数,如:RK3288 8.1 SDK中就是采用的下面方式。

示例:

&dsi0 {

status = "okay";

rockchip,lane-rate = <600>;

panel: panel {

compatible = "simple-panel-dsi";

reg = <0>;

backlight = <&backlight>;

enable-gpios = <&gpio7 3 GPIO_ACTIVE_HIGH>;

//ret-gpios = <&gpio7 4 GPIO_ACTIVE_HIGH>;

power-supply = <&vcc_lcd>;

dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST)>;

dsi,format = ;

dsi,lanes = <4>;

ret-delay-ms = <20>;

init-delay-ms = <20>;

enable-delay-ms = <120>;

prepare-delay-ms = <120>;

status = "okay";

panel-init-quence = [

15 00 02 80 77

15 00 02 81 77

15 00 02 82 77

15 00 02 83 77

15 00 02 84 77

15 00 02 85 77

15 00 02 86 77

05 64 01 11

05 14 01 29

];

panel-exit-quence = [

05 64 01 28

05 96 01 10

];

disp_timings: display-timings {

native-mode = <&timing2>;

timing2: timing0 {

clock-frequency = <52000000>;

hactive = <1024>;

vactive = <600>;

hback-porch = <160>;

hfront-porch = <160>;

vback-porch = <23>;

vfront-porch = <12>;

hsync-len = <10>;

vsync-len = <10>;

hsync-active = <0>;

vsync-active = <0>;

de-active = <0>;

pixelclk-active = <0>;

};

};

};

};

这里依然只分析panel-init-quence和panel-exit-quence的配置规则,其它配置可以参考另一篇文章:《如何确定lcd timing参数》。

新的mipi初始化序列配置规则与老方法其实是一致的,只是改写了表达方式,如下:

panel-init-quence = [

15 00 02 80 77

15 00 02 81 77

15 00 02 82 77

15 00 02 83 77

15 00 02 84 77

15 00 02 85 77

15 00 02 86 77

39 00 0D C3 01 66 13 23 00 66 85 33 20 38 38 00

05 64 01 11

05 14 01 29

];

中括号里的内容,每一行表示一串命令字,规则如下:

15 00 02 80 77

| | | | |

| | | | 数据

| | | | 寄存器地址

| | 数据长度

| 延时

命令类型(0x05: 单字节数据 0x15: 双字节数据 0x39: 多字节数据)

单字节数据举例:

05 64 01 11

双字节数据举例:

15 00 02 86 77

多字节数据举例:

39 00 0D C3 01 66 13 23 00 66 85 33 20 38 38 00

-

RK平台mipi屏初始化序列配置

本文发布于:2023-12-09 21:26:16,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/zhishi/a/170212837640125.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

本文word下载地址:RK平台mipi屏初始化序列配置.doc

本文 PDF 下载地址:RK平台mipi屏初始化序列配置.pdf

下一篇:返回列表
标签:配置   命令   数据   方式   规则   序列   参数   延时
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 实用文体写作网旗下知识大全大全栏目是一个全百科类宝库! 优秀范文|法律文书|专利查询|