no-OS
edid.h
Go to the documentation of this file.
1 /***************************************************************************/
34 #ifndef _EDID_H_
35 #define _EDID_H_
36 
37 /******************************************************************************/
38 /***************************** Include Files **********************************/
39 /******************************************************************************/
40 
41 #include <stdbool.h>
42 #include <stdint.h>
43 #include "wrapper.h"
44 
45 /******************************************************************************/
46 /********************** Macros and Constants Definitions **********************/
47 /******************************************************************************/
48 
49 /* when defined, SINK 3D is filtered by chip supported 3D formats */
50 #define EDID_MSG if(edid_msg_enable)DBG_MSG
51 #define STD_DESC_LEN sizeof(struct std_timing)
52 
53 /******************************************************************************/
54 /*************************** Types Declarations *******************************/
55 /******************************************************************************/
56 
57 struct std_timing {
58  uint8_t pixel_clk[2]; /* Divide by 100 to get MHZ */
59  uint8_t h_active; /* In pixels */
60  uint8_t h_blanking;
61  uint8_t h_act_blnk44;
62  uint8_t v_active; /* In lines */
63  uint8_t v_blanking;
64  uint8_t v_act_blnk44;
65  uint8_t h_sync_offs; /* In pixels */
66  uint8_t h_sync_width;
67  uint8_t v_offs_pulse; /* In lines */
68  uint8_t hv_offs_pulse; /* H offs: H sync width: V Offs: V sync width */
69  uint8_t h_sizemm;
70  uint8_t v_sizemm;
71  uint8_t hv_sizemm44;
72  uint8_t h_border;
73  uint8_t v_border;
74  uint8_t flags;
75 };
76 
77 struct strg_desc {
78  uint8_t zero_3[3];
79  uint8_t tag; /* 0xfc=MonName 0xfe=String 0xff=MonSerial */
80  uint8_t zero;
81  uint8_t string[13];
82 };
83 
85  uint8_t zero_3[3];
86  uint8_t tag_0xfd;
87  uint8_t zero;
88  uint8_t min_v_freq; /* Hz */
89  uint8_t max_v_freq;
90  uint8_t min_h_freq;
91  uint8_t max_h_freq;
92  uint8_t max_pix_clk; /* Multiply by 10 to get MHz */
93  uint8_t sec_timing_tag;
94  uint8_t sec_timing[7];
95 };
96 
97 struct vsdb_block {
98  uint8_t tag_len; /* b0-4=Len b5-7=Tag(3) */
99  uint8_t reg_id[3]; /* 0x03 0x0C 0x00 */
100  uint8_t spa[2]; /* AB:CD */
101  uint8_t deep_clr; /* If Len > 5 */
102  uint8_t max_tmds; /* If Len > 5 */
103  uint8_t latency_flags; /* If Len > 5 */
104 };
105 
106 /* Structure that maps an EDID block 0 */
107 struct edid_struct {
108  uint8_t header[8]; /* 0x00 */
109  uint8_t man_id[2]; /* 0x08 */
110  uint8_t prod_code[2];
111  uint8_t serial[4];
112  uint8_t man_week;
113  uint8_t man_year;
114  uint8_t edid_rev[2]; /* 0x12 */
115  uint8_t vid_inp_def; /* 0x14 */
116  uint8_t max_h_size_cm;
117  uint8_t max_v_size_cm;
118  uint8_t disp_gamma;
119  uint8_t feat_support;
120  uint8_t color_specs[10]; /* 0x19 */
121  uint8_t est_timing[3]; /* 0x23 */
122  uint8_t stnd_timing[16]; /* 0x26 */
123  uint8_t detailed_timing[72]; /* 0x36 */
124  uint8_t ext_blk_count; /* 0x7E */
125  uint8_t checksum; /* 0x7F */
126 };
127 
128 /* Structure that maps an EDID extension block (CEA block) */
129 struct cea_ext {
130  uint8_t tag;
131  uint8_t rev_num;
132  uint8_t desc_offs;
133  uint8_t res;
134  uint8_t data[123];
135  uint8_t checksum;
136 };
137 
138 struct edid_info {
139  uint8_t deep_color;
140  uint16_t spa_offset;
141  bool csum_err;
142  uint16_t svd_offset;
143 };
144 
146  uint8_t format;
147  uint8_t sample_rate;
148  uint8_t max_channels;
149  uint16_t bit;
150 };
151 
152 /******************************************************************************/
153 /************************ Functions Declarations ******************************/
154 /******************************************************************************/
155 
156 /* Parse and display the EDID message received. */
157 uint8_t ADIAPI_mw_edid_parse(uint8_t *edid_ptr, uint16_t *spa_offset,
158  uint8_t seg_num);
159 
160 /* Parse the EDID message received without displaying to the terminal. */
161 uint8_t ADIAPI_mw_edid_parse_silent(uint8_t *edid_ptr, uint16_t *spa_offset,
162  uint8_t seg_num);
163 
164 /* Get the information about the last parsed EDID. */
165 void ADIAPI_mw_edid_get_info(struct edid_info *info_ptr);
166 
167 /* Get the audio information about the last parsed EDID. */
168 void ADIAPI_mw_edid_get_audio_info(struct edid_audio_info *audio_info_ptr);
169 
170 /* Enable or disable EDID verbose output. */
171 void ADIAPI_mw_edid_enable_debug_msg(bool enable);
172 
173 #endif
edid_struct::color_specs
uint8_t color_specs[10]
Definition: edid.h:120
ADIAPI_mw_edid_get_audio_info
void ADIAPI_mw_edid_get_audio_info(struct edid_audio_info *audio_info_ptr)
Definition: edid.c:1006
edid_struct::est_timing
uint8_t est_timing[3]
Definition: edid.h:121
edid_struct::checksum
uint8_t checksum
Definition: edid.h:125
std_timing::h_sync_offs
uint8_t h_sync_offs
Definition: edid.h:65
ADIAPI_mw_edid_parse_silent
uint8_t ADIAPI_mw_edid_parse_silent(uint8_t *edid_ptr, uint16_t *spa_offset, uint8_t seg_num)
Definition: edid.c:971
std_timing::h_sync_width
uint8_t h_sync_width
Definition: edid.h:66
edid_struct::man_id
uint8_t man_id[2]
Definition: edid.h:109
cea_ext
Definition: edid.h:129
std_timing::v_active
uint8_t v_active
Definition: edid.h:62
mon_range_desc::max_h_freq
uint8_t max_h_freq
Definition: edid.h:91
vsdb_block
Definition: edid.h:97
strg_desc::string
uint8_t string[13]
Definition: edid.h:81
vsdb_block::deep_clr
uint8_t deep_clr
Definition: edid.h:101
mon_range_desc::sec_timing_tag
uint8_t sec_timing_tag
Definition: edid.h:93
mon_range_desc::max_v_freq
uint8_t max_v_freq
Definition: edid.h:89
edid_struct::serial
uint8_t serial[4]
Definition: edid.h:111
vsdb_block::latency_flags
uint8_t latency_flags
Definition: edid.h:103
wrapper.h
mon_range_desc::sec_timing
uint8_t sec_timing[7]
Definition: edid.h:94
edid_struct::man_week
uint8_t man_week
Definition: edid.h:112
vsdb_block::reg_id
uint8_t reg_id[3]
Definition: edid.h:99
ADIAPI_mw_edid_enable_debug_msg
void ADIAPI_mw_edid_enable_debug_msg(bool enable)
Definition: edid.c:1021
edid_info::csum_err
bool csum_err
Definition: edid.h:141
edid_struct::edid_rev
uint8_t edid_rev[2]
Definition: edid.h:114
edid_struct::detailed_timing
uint8_t detailed_timing[72]
Definition: edid.h:123
edid_audio_info::max_channels
uint8_t max_channels
Definition: edid.h:148
std_timing
Definition: edid.h:57
edid_struct::ext_blk_count
uint8_t ext_blk_count
Definition: edid.h:124
std_timing::h_active
uint8_t h_active
Definition: edid.h:59
edid_info
Definition: edid.h:138
EDID_MSG
#define EDID_MSG
Definition: edid.h:50
cea_ext::data
uint8_t data[123]
Definition: edid.h:134
std_timing::hv_sizemm44
uint8_t hv_sizemm44
Definition: edid.h:71
std_timing::v_act_blnk44
uint8_t v_act_blnk44
Definition: edid.h:64
vsdb_block::tag_len
uint8_t tag_len
Definition: edid.h:98
edid_struct::vid_inp_def
uint8_t vid_inp_def
Definition: edid.h:115
edid_audio_info::bit
uint16_t bit
Definition: edid.h:149
std_timing::v_border
uint8_t v_border
Definition: edid.h:73
std_timing::v_sizemm
uint8_t v_sizemm
Definition: edid.h:70
vsdb_block::spa
uint8_t spa[2]
Definition: edid.h:100
std_timing::v_offs_pulse
uint8_t v_offs_pulse
Definition: edid.h:67
edid_audio_info::sample_rate
uint8_t sample_rate
Definition: edid.h:147
ADIAPI_mw_edid_parse
uint8_t ADIAPI_mw_edid_parse(uint8_t *edid_ptr, uint16_t *spa_offset, uint8_t seg_num)
Definition: edid.c:896
std_timing::pixel_clk
uint8_t pixel_clk[2]
Definition: edid.h:58
cea_ext::tag
uint8_t tag
Definition: edid.h:130
edid_struct::max_v_size_cm
uint8_t max_v_size_cm
Definition: edid.h:117
strg_desc::zero
uint8_t zero
Definition: edid.h:80
ADIAPI_mw_edid_get_audio_info
void ADIAPI_mw_edid_get_audio_info(struct edid_audio_info *audio_info_ptr)
Definition: edid.c:1006
ADIAPI_mw_edid_parse_silent
uint8_t ADIAPI_mw_edid_parse_silent(uint8_t *edid_ptr, uint16_t *spa_offset, uint8_t seg_num)
Definition: edid.c:971
strg_desc
Definition: edid.h:77
mon_range_desc::min_h_freq
uint8_t min_h_freq
Definition: edid.h:90
edid_struct::feat_support
uint8_t feat_support
Definition: edid.h:119
edid_struct
Definition: edid.h:107
ADIAPI_mw_edid_get_info
void ADIAPI_mw_edid_get_info(struct edid_info *info_ptr)
Definition: edid.c:993
edid_struct::disp_gamma
uint8_t disp_gamma
Definition: edid.h:118
mon_range_desc::zero
uint8_t zero
Definition: edid.h:87
std_timing::flags
uint8_t flags
Definition: edid.h:74
edid_struct::stnd_timing
uint8_t stnd_timing[16]
Definition: edid.h:122
strg_desc::tag
uint8_t tag
Definition: edid.h:79
mon_range_desc::zero_3
uint8_t zero_3[3]
Definition: edid.h:85
edid_struct::prod_code
uint8_t prod_code[2]
Definition: edid.h:110
strg_desc::zero_3
uint8_t zero_3[3]
Definition: edid.h:78
ADIAPI_mw_edid_parse
uint8_t ADIAPI_mw_edid_parse(uint8_t *edid_ptr, uint16_t *spa_offset, uint8_t seg_num)
Definition: edid.c:896
std_timing::v_blanking
uint8_t v_blanking
Definition: edid.h:63
edid.h
EDID control module header.
cea_ext::checksum
uint8_t checksum
Definition: edid.h:135
edid_struct::max_h_size_cm
uint8_t max_h_size_cm
Definition: edid.h:116
std_timing::hv_offs_pulse
uint8_t hv_offs_pulse
Definition: edid.h:68
NULL
#define NULL
Definition: wrapper.h:64
vsdb_block::max_tmds
uint8_t max_tmds
Definition: edid.h:102
cea_ext::desc_offs
uint8_t desc_offs
Definition: edid.h:132
mon_range_desc::min_v_freq
uint8_t min_v_freq
Definition: edid.h:88
edid_info::spa_offset
uint16_t spa_offset
Definition: edid.h:140
mon_range_desc
Definition: edid.h:84
cea_ext::res
uint8_t res
Definition: edid.h:133
edid_struct::header
uint8_t header[8]
Definition: edid.h:108
ADIAPI_mw_edid_enable_debug_msg
void ADIAPI_mw_edid_enable_debug_msg(bool enable)
Definition: edid.c:1021
edid_struct::man_year
uint8_t man_year
Definition: edid.h:113
edid_audio_info
Definition: edid.h:145
mon_range_desc::max_pix_clk
uint8_t max_pix_clk
Definition: edid.h:92
std_timing::h_border
uint8_t h_border
Definition: edid.h:72
std_timing::h_act_blnk44
uint8_t h_act_blnk44
Definition: edid.h:61
std_timing::h_sizemm
uint8_t h_sizemm
Definition: edid.h:69
edid_info::deep_color
uint8_t deep_color
Definition: edid.h:139
edid_info::svd_offset
uint16_t svd_offset
Definition: edid.h:142
ADIAPI_mw_edid_get_info
void ADIAPI_mw_edid_get_info(struct edid_info *info_ptr)
Definition: edid.c:993
cea_ext::rev_num
uint8_t rev_num
Definition: edid.h:131
std_timing::h_blanking
uint8_t h_blanking
Definition: edid.h:60
mon_range_desc::tag_0xfd
uint8_t tag_0xfd
Definition: edid.h:86
edid_audio_info::format
uint8_t format
Definition: edid.h:146