DDC/CI(Display Data Channel / Command Interface)是一種顯示器和電腦之間的通訊協議,
用來讓電腦直接控制顯示器的設定,而不需要手動操作螢幕上的按鈕。
實體接口
HDMI透過 第15 pin(SCL), 16 pin(SDA), 17 pin(Gnd) 以I2C來溝通
DP (DisplayPort)則是以 AUX_CH(P)及AUX_CH(N)來通訊
DDC/CI Host Device
DDC/CI主機是I2C的master,I2C slave address為0x50 / 0x51
DDC/CI Display Device
DDC/CI顯示裝置的I2C slave address為0x6E / 0x6F
DDC/CI Communication Basic Commands
| Get VCP Feature | 0x01 | 告知要讀取 VCP opcode |
| VCP Feature Reply | 0x02 | 讀取 VCP 功能 最大值 / 目前值 |
| Set VCP Feature | 0x03 | 設定VCP功能值 |
| Reply Timing Message | 0x06 | 取得目前輸入影像時序(H/V freq、pixel clock) |
| Get Timing Report | 0x07 | 告知要讀取影像時序 |
| Save Current Setting | 0x0C | 儲存目前設定值 |
| Capabilities Request Reply | 0xE3 | 回傳 Capabilities String |
| Capabilities Request | 0xF3 | 要求顯示器回傳能力字串 |
Get VCP Feature & VCP Feature Reply
要讀取VCP code的內容必須先用Get VCP Feature 0x01告知裝置VCP code
然後再用VCP Feature Reply 0x02取值
VCP:Virtual Control Panel(虛擬控制面板)
Get VCP Feature
6E 51 82 01 CP CK
Destination address
Source address
Length
Get VCP Feature
VCP opcode
Checksum
- 6E:顯示裝置的I2C address
- 51:source的address
- 82:data的長度2個bytes,不包含checksum,bit 7固定為1
- 01:command "Get VCP Feature"
- CP:VCP code
- CK:checksum,所有位元做XOR
VCP Feature Reply
6F (read 11 bytes)
6E 88 02 RC CP TP MH ML SH SL CK
Destination address
Source address
Length
VCP Feature reply
Result Code
00h: No Error
01h: Unsupported VCP Code
VCP opcode
VCP type code
00h: Set parameter
01h: Momentary
Maximum value High byte
Maximum value Low byte
Present value High byte
Present value Low byte
Checksum
- 6F:顯示裝置的I2C read address
- (byte 0) 6E:顯示裝置的I2C address
- (byte 1) 88:Length | 0x80,data的長度8個bytes,不包含checksum
- (byte 2) 02:command "VCP Feature Reply"
- (byte 3) RC:Result code。00h:成功,01h:不支援的VCP code,02h:VCP code無效,03h:操作失敗
- (byte 4) CP:VCP code
- (byte 5) TP:資料的型態。00h:可設定參數,01h:觸發型
- (byte 6) MH:可設定最大值的高位元
- (byte 7) ML:可設定最大值的低位元
- (byte 8) SH:目前數值的高位元
- (byte 9) SL:目前數值的低位元
- (byte 10) SL:checksum
> I2C Write, Address = 6E, Data: 51 82 01 10 AC Delay = 0
OK
> I2C Read, Address = 6F, Read 11 bytes, Delay = 0
OK
< 6E 88 02 00 10 00 00 64 00 32 F2
讀取VCP code 0x10 (Luminance)亮度
最大值0x0064 (100),目前值為0x0032 (50)
Set VCP Feature
用於寫入某個 VCP Code 的值,相當於“設置顯示器參數”。
Set VCP Feature
6E 51 84 03 CP SH SL CK
Destination address
Source address
Length
Get VCP Feature
VCP opcode
High byte
Low byte
Checksum
- 6E:顯示裝置的I2C address
- 51:source的address
- 84:data的長度4個bytes,不包含checksum,bit 7固定為1
- 03:command "Set VCP Feature"
- CP:VCP code
- SH:輸入值的高位元
- SL:輸入值的低位元
- CK:checksum,所有位元做XOR
> I2C Write, Address = 6E, Data: 51 84 03 10 00 64 CC Delay = 0
OK
設定VCP code 0x10 (Luminance)亮度為100%
Get Timing Report & Reply Timing Message
用來取後影像訊號的H/V頻率
要讀取VCP code的內容必須先用Get Timing Report 0x07通知裝置VCP code
然後再用Reply Timing Message 0x06取值
Get Timing Report
6E 51 81 07 B9
Destination address
Source address
Length
Get Timing Report
Checksum
Reply Timing Message
6F (read 9 bytes)
6E 06 4E SS HH HL VH VL CK
Destination address
Source address
Reply Timing Message
Timing message op code
Timing Status byte
Bit 7 = 1 Sync.Freq. out of range
Bit 6 = 1 Unstable count
Bit 5-2 Reserved, shall be set to 0
Bit 1 = 1 Positive Horizontal sync polarity
Bit 1 = 0 Negative Horizontal sync polarity
Bit 0 = 1 Positive Vertical sync polarity
Bit 0 = 0 Negative Vertical sync polarity
Horizontal Frequency High byte
Horizontal Frequency Low byte
Vertical Frequency High byte
Vertical Frequency Low byte
Checksum
- 6E:顯示裝置的I2C address
- 06:Reply Timing Message
- 4E:Timing message op code
- SS:Timing Status byte
- HH:Horizontal Frequency High byte
- HL:Horizontal Frequency Low byte
- VH:Vertical Frequency High byte
- VL:Vertical Frequency Low byte
- CK:checksum,所有位元做XOR
> I2C Write, Address = 6E, Data: 51 81 07 B9 Delay = 0
OK
> I2C Read, Address = 6F, Read 9 bytes, Delay = 0
OK
< 6E 06 4E 02 34 1C 17 70 3B
Horizontal頻率為0x341C (13340 = 133.4MHz)
Vertical頻率為0x1770 (6000 = 60.0Hz)
Save Current Setting
儲存目前設定值
Save Current Setting
6E 51 81 0C B2
Destination address
Source address
Length
Save current settings
Checksum
Capabilities Request & Capabilities Request Reply
apabilities Request 用于獲取顯示器的 Capabilities String,也叫能力描述字符串。
Capabilities Request
6E 51 83 F3 OH OL CK
Destination address
Source address
Length
Capabilities Request
Offset value High byte
Offset value Low byte
Checksum
Capabilities Reply
6F (read 9 bytes)
6E XX E3 OH OL Data(n) CK
Destination address
Source address
Length (length=3~35)
Capabilities reply op code
Offset High byte
Offset Low byte
Capability string data
Checksum


留言
張貼留言