高通mipi dsi代碼理解

在bootloader是lcd代碼

長類型代碼:

示例:static char video_on_cmd[] = {0x03, 0x00, 0x29, 0xC0, 0xFF, 0x12, 0x87 ,0xFF};

說明:4字節Hdr,Hdr=2長度+1類型+1標記,數據6~65541


---------------------Package Header------------

長度:0x03,0x00

類型:0x29  //Long Write

標記:0xC0 //第30位是長類型標記,31位結束標記

----------------------Data----------------------------

命令:0xFF

參數:0x12, 0x87

對齊:0xFF //4字節對齊


短類型代碼:

示例:static char test_cmd[4] = {0xA1, 0x01, 0x14,0xA0};

說明:4字節,2位數據+1類型+1標記


--------------------Package Header--------------

命令:0xA1

參數:0x01

類型:0x14 //DCS_READ,1parameters

標記:0xA0


我理解高通平臺和mipi協議標準有出入.


mipi協議標準:


Short Packet Structure

Packet Header (4 bytes)
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.
Packet Size
Fixed length 4 bytes
The first byte of any packet is the DI (Data Identifier) byte.
DI[7:6]:These two bits identify the data as directed to one of four virtual channels.
DI[5:0]:These six bits specify the Data Type.

Long Packet Structure

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
Packet Size
4 + (0~65535) + 2 = 6 ~ 65541 bytes

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章