MIPI DSI command模式不同的Data Type: Generic/DCS
接触mipi dsi显示这块有几年的时间了,现在有空整理下,给大家分享下;同时重点讲下数据包类型。
1、传输模式
LP(Low-Power) 模式:用于传输控制信号,最高速率 10 MHz
HS(High-Speed)模式:用于高速传输数据,速率范围 [80 Mbps, 1Gbps] per Lane
传输的最小单元为 1 个字节,采用小端的方式及 LSB first,MSB last。
2、Lane States
* LP mode 有 4 种状态: LP00、LP01(0)、LP10(1)、LP11 (Dp、Dn)
* HS mode 有 2 种状态: HS-0、HS-1
HS 发送器发送的数据 LP 接收器看到的都是 LP00,
3、Lane Levels
* LP: 0 ~ 1.2V
* HS: 100 ~ 300mV,HS common level = 200mV,swing = 200 mv
二、DSI
1、线路构成
在 DSI 中需要 1 根时钟线以及 1 ~ 4 根数据线。
2、两种接口的 LCD
* Comman mode(对应 MPU 接口)
* Video mode(对应 RGB 接口)
该模式下视频数据只能通过 HS mode 传输。
3、数据包类型
短包:4 bytes,由 3 部分组成:
* Data Identifier (DI) * 1byte: Contains the Virtual Channel[7:6] and Data Type[5:0].
* Packet Data * 2byte:Length is fixed at two bytes
* Error Correction Code (ECC) * 1byte:allows single-bit errors to be corrected and 2-bit errors to be detected.
长包:6 ~ 65541 bytes,同样由 3 部分组成:
* Packet Header(4 bytes) - 包头
Data Identifier (DI) * 1byte:Contains the Virtual Channel[7:6] and Data Type[5:0].
Word Count (WC) * 2byte:defines the number of bytes in the Data Payload.
Error Correction Code (ECC) * 1byte:allows single-bit errors to be corrected and 2-bit errors to be detected.
* Data Payload(0~65535 bytes) - 有效数据
Length = WC × bytes
* Packet Footer(2 bytes):Checksum - 包尾
If the payload has length 0, then the Checksum calculation results in FFFFh
If the Checksum isn’t calculated, the Checksum value is 0000h
4、从控制器到外设发送的包类型,一般用于屏初始化控制,
下面以rk3288+andrid7.1驱动ILI9881 mipi屏为例写一下初始化参数:
&dsi0 {
status = "okay";
panel: panel {
compatible = "simple-panel-dsi";
reg = <0>;
//backlight = <&backlight>;
bus-format = <MEDIA_BUS_FMT_RGB666_1X18>;
enable-gpios = <&gpio7 0 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio7 4 GPIO_ACTIVE_LOW>;
power-supply = <&vcc_lcd>;
dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)>;
dsi,format = <MIPI_DSI_FMT_RGB888>; //<MIPI_DSI_FMT_RGB666>; //<MIPI_DSI_FMT_RGB888>;
dsi,lanes = <4>;
reset-delay-ms = <80>;
init-delay-ms = <80>;
enable-delay-ms = <120>;
prepare-delay-ms = <120>;
status = "okay";
panel-init-sequence = [
05 10 01 01
23 00 02 B0 00
29 00 06 B3 14 08 00 22 00
29 00 02 B4 0C
29 00 03 B6 3A D3
15 00 02 51 E6
15 00 02 53 2C
05 10 01 29
05 A0 01 11
];