接觸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
];