hv_app_Ddcci.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  1. /*
  2. * @file hv_app_Ddcci.h
  3. * @brief Header file of ddcci.
  4. *
  5. * @verbatim
  6. * ==============================================================================
  7. * ##### How to use #####
  8. * ==============================================================================
  9. * (+) Use
  10. *
  11. * @author HiView SoC Software Team
  12. * @version 1.0.0
  13. * @date 2023-01-31
  14. */
  15. #ifndef _HV_APP_DDCCI_H
  16. #define _HV_APP_DDCCI_H
  17. #include "hv_comm_DataType.h"
  18. #include "hv_vos_Comm.h"
  19. #include "hv_mw_Ddcci.h"
  20. #define DDC_LOG_ENABLE
  21. #ifdef DDC_LOG_ENABLE
  22. #define DDC_PRINT(...) HV_LOG_INFO(DDCCI, __VA_ARGS__)
  23. #define DDC_BUF_PRINT(...) HV_LOG_BUF_INFO(__VA_ARGS__)
  24. #else
  25. #define DDC_PRINT(...)
  26. #define DDC_BUF_PRINT(...)
  27. #endif
  28. #define LOBYTE(w) ((UCHAR8)(w))
  29. #define HIBYTE(w) ((UCHAR8)(((USHORT16)(w) >> 8) & 0x00FF))
  30. #define LOWORD(dw) ((USHORT16)(dw))
  31. #define HIWORD(dw) ((USHORT16)((dw) >> 16))
  32. #define TO_WORD(byte_h, byte_l) (((USHORT16)((UCHAR8)(byte_h)) << 8) |\
  33. ((USHORT16)((UCHAR8)(byte_l)) << 0))
  34. #define TO_DWORD(byte_hh, byte_hl,\
  35. byte_lh, byte_ll) (((USHORT16)((UCHAR8)(byte_hh)) << 24) |\
  36. ((USHORT16)((UCHAR8)(byte_hl)) << 16) |\
  37. ((USHORT16)((UCHAR8)(byte_lh)) << 8) |\
  38. ((USHORT16)((UCHAR8)(byte_ll)) << 0))
  39. #define DDCCI_TYPE_JUDGE_BYTE 1
  40. #define DDCCI_CONTROL_STATUS_FLAG 0x80
  41. #define DDCCI_FAC_CMD_TYPE_READ 0x12
  42. #define DDCCI_FAC_CMD_TYPE_WRITE 0x11
  43. #define DDCCI_FAC_OFFSET_LEN_HIGH 4
  44. #define DDCCI_FAC_OFFSET_LEN_LOW 5
  45. typedef enum
  46. {
  47. DDCCI_RW_READ,
  48. DDCCI_RW_WRITE,
  49. DDCCI_RW_UNKNOWN
  50. } DDCCI_CMD_RW_E;
  51. typedef enum
  52. {
  53. DDCCI_TYPE_HIVIEW_TOOL,
  54. DDCCI_TYPE_HIVIEW_OTA,
  55. DDCCI_TYPE_VCP_STANDARD,
  56. DDCCI_TYPE_VCP_TPV,
  57. DDCCI_TYPE_VCP_AUO,
  58. DDCCI_TYPE_VCP_CTX,
  59. DDCCI_TYPE_UNKNOWN
  60. } DDCCI_CMD_TYPE_E;
  61. typedef VOID (*DDCCI_PROC_HANDLE)(UCHAR8, UCHAR8 *, USHORT16);
  62. //--------------------------------------------------
  63. // Definitions of DDCCI Commands. From DDC CI v1.1(12. Appendix C: Summary of Op. Codes).
  64. //--------------------------------------------------
  65. #define DDCCI_CMD_GET_VCP_FEATURE 0x01
  66. #define DDCCI_CMD_GET_VCP_FEATURE_REPLY 0x02
  67. #define DDCCI_CMD_SET_VCP_FEATURE 0x03
  68. #define DDCCI_CMD_REPLY_TIMING_MESSAGE 0x06
  69. #define DDCCI_CMD_GET_TIMING_REPORT 0x07
  70. #define DDCCI_CMD_SAVE_CURRENT_SETTINGS 0x0C
  71. #define DDCCI_CMD_CAPABILITIES_REQUEST_REPLY 0xE3
  72. #define DDCCI_CMD_CAPABILITIES_REQUEST 0xF3
  73. #define DDCCI_CMD_MANUFACTURER_AT_REQ_1 0xC0
  74. #define DDCCI_CMD_MANUFACTURER_AT_REQ_2 0xD0
  75. #define DDCCI_CMD_MANUFACTURER_FW_UPDATE 0xC6
  76. // RC
  77. #define DDCCI_CMD_GETVCP_RC_NO_ERROR 0x00
  78. #define DDCCI_CMD_GETVCP_RC_UNSUPPORTED 0x01
  79. // TP
  80. #define DDCCI_CMD_GETVCP_TP_SET_PARAMETER 0x00
  81. #define DDCCI_CMD_GETVCP_TP_MOMENTARY 0x01
  82. //--------------------------------------------------
  83. // Definitions of DDCCI Address
  84. //--------------------------------------------------
  85. #define DDCCI_DEST_ADDRESS 0x6E
  86. #define DDCCI_SRC_ADDRESS 0x51
  87. #define DDCCI_DATA_LEN_CTRL (~DDCCI_CONTROL_STATUS_FLAG)
  88. /**
  89. * @brief MCCS消息头的长度,包括addr(1B)+len(1B)+crc(1B)
  90. */
  91. #define DDCCI_HEADER_LEN 3
  92. /**
  93. * @brief Capabilities消息返回时的冗余数据长度,包括addr(1B)+len(1B)+opcode(1B)+ofsh(1B)+ofsL(1B)+crc(1B)
  94. */
  95. #define DDCCI_GET_CAP_HEADER_LEN 6
  96. #define DDCCI_GET_VCP_DATA_LEN 8
  97. #define DDCCI_HDMI_CAP_TX_LEN 32
  98. #define DDCCI_DP_CAP_TX_LEN 16
  99. //--------------------------------------------------
  100. // Definitions of DDCCI Protocol Items. Byte Order.
  101. //--------------------------------------------------
  102. #define DDCCI_SOURCE 0
  103. #define DDCCI_LENGTH 1
  104. #define DDCCI_COMMAND 2
  105. #define DDCCI_SOURCE_OPCODE 3
  106. #define DDCCI_RESULT_CODE 3
  107. #define DDCCI_SINK_OPCODE 4
  108. #define DDCCI_TYPE_CODE 5
  109. #define DDCCI_MAX_HIGH_BYTE 6
  110. #define DDCCI_MAX_LOW_BYTE 7
  111. #define DDCCI_PRESENT_HIGH_BYTE 8
  112. #define DDCCI_PRESENT_LOW_BYTE 9
  113. #define DDCCI_SET_HIGH_BYTE 4
  114. #define DDCCI_SET_LOW_BYTE 5
  115. #define DDCCI_OFS_HIGH_BYTE 3
  116. #define DDCCI_OFS_LOW_BYTE 4
  117. #define DDCCI_TIMING_MSG_COMMAND 1
  118. #define DDCCI_TIMING_MSG_OPCODE 2
  119. #define DDCCI_TIMING_STATUS 3
  120. #define DDCCI_TIMING_HFREQ_HBYTE 4
  121. #define DDCCI_TIMING_HFREQ_LBYTE 5
  122. #define DDCCI_TIMING_VFREQ_HBYTE 6
  123. #define DDCCI_TIMING_VFREQ_LBYTE 7
  124. //--------------------------------------------------
  125. // Definitions of DDCCI Commands. From DDC CI v1.1(12. Appendix C: Summary of Op. Codes).
  126. //--------------------------------------------------
  127. #define DDCCI_CMD_GET_VCP_FEATURE 0x01
  128. #define DDCCI_CMD_GET_VCP_FEATURE_REPLY 0x02
  129. #define DDCCI_CMD_SET_VCP_FEATURE 0x03
  130. #define DDCCI_CMD_REPLY_TIMING_MESSAGE 0x06
  131. #define DDCCI_CMD_GET_TIMING_REPORT 0x07
  132. #define DDCCI_CMD_SAVE_CURRENT_SETTINGS 0x0C
  133. #define DDCCI_CMD_CAPABILITIES_REQUEST_REPLY 0xE3
  134. #define DDCCI_CMD_CAPABILITIES_REQUEST 0xF3
  135. #define DDCCI_CMD_MANUFACTURER_AT_REQ_1 0xC0
  136. #define DDCCI_CMD_MANUFACTURER_AT_REQ_2 0xD0
  137. #define DDCCI_CMD_MANUFACTURER_FW_UPDATE 0xC6
  138. #define DDCCI_VIRTUAL_HOST_ADDRESS 0x50
  139. //--------------------------------------------------
  140. // Definitions of DDCCI VCP Opcode. From MCCS2.2a Table 11-1(VCP Code).
  141. //--------------------------------------------------
  142. #define DDCCI_OPCODE_VCP_CODE_PAGE 0x00
  143. #define DDCCI_OPCODE_VCP_DEGAUSS 0x01
  144. #define DDCCI_OPCODE_VCP_NEW_CONTROL_VALUE 0x02
  145. #define DDCCI_OPCODE_VCP_SOFT_CONTROLS 0x03
  146. #define DDCCI_OPCODE_VCP_FACTORY_RESET 0x04
  147. #define DDCCI_OPCODE_VCP_RECAL_BRI_CON 0x05
  148. #define DDCCI_OPCODE_VCP_GEOMETRY_RESET 0x06
  149. #define DDCCI_OPCODE_VCP_COLOR_RESET 0x08
  150. #define DDCCI_OPCODE_VCP_FACTORY_TV_RESET 0x0A
  151. #define DDCCI_OPCODE_VCP_COLOR_TEMP_INCREMENT 0x0B
  152. #define DDCCI_OPCODE_VCP_COLOR_TEMP_REQUEST 0x0C
  153. #define DDCCI_OPCODE_VCP_CLOCK 0x0E
  154. #define DDCCI_OPCODE_VCP_BACKLIGHT 0x10
  155. #define DDCCI_OPCODE_VCP_FLESH_TONE_ENHANCEMENT 0x11
  156. #define DDCCI_OPCODE_VCP_CONTRAST 0x12
  157. #define DDCCI_OPCODE_VCP_SELECT_COLOR_PRESET 0x14
  158. #define DDCCI_OPCODE_VCP_RED_GAIN 0x16
  159. #define DDCCI_OPCODE_VCP_COLOR_VISION_COMPENSATION 0x17
  160. #define DDCCI_OPCODE_VCP_GREEN_GAIN 0x18
  161. #define DDCCI_OPCODE_VCP_BLUE_GAIN 0x1A
  162. #define DDCCI_OPCODE_VCP_FOCUS 0x1C
  163. #define DDCCI_OPCODE_VCP_AUTO_SET_UP 0x1E
  164. #define DDCCI_OPCODE_VCP_AUTO_COLOR 0x1F
  165. #define DDCCI_OPCODE_VCP_HPOSITION 0x20
  166. #define DDCCI_OPCODE_VCP_HSIZE 0x22
  167. #define DDCCI_OPCODE_VCP_HPINCUSHION 0x24
  168. #define DDCCI_OPCODE_VCP_HPINCUSHION_BALANCE 0x26
  169. #define DDCCI_OPCODE_VCP_HCONVERGENCE_RB 0x28
  170. #define DDCCI_OPCODE_VCP_HCONVERGENCE_MG 0x29
  171. #define DDCCI_OPCODE_VCP_HLINEARITY 0x2A
  172. #define DDCCI_OPCODE_VCP_HLINEARITY_BALANCE 0x2C
  173. #define DDCCI_OPCODE_VCP_GRAY_SCALE_EXPANSION 0x2E
  174. #define DDCCI_OPCODE_VCP_VPOSITION 0x30
  175. #define DDCCI_OPCODE_VCP_VSIZE 0x32
  176. #define DDCCI_OPCODE_VCP_VPINCUSHION 0x34
  177. #define DDCCI_OPCODE_VCP_VPINCUSHION_BALANCE 0x36
  178. #define DDCCI_OPCODE_VCP_VCONVERGENCE_RB 0x38
  179. #define DDCCI_OPCODE_VCP_VCONVERGENCE_MG 0x39
  180. #define DDCCI_OPCODE_VCP_VLINEARITY 0x3A
  181. #define DDCCI_OPCODE_VCP_VLINEARITY_BALANCE 0x3C
  182. #define DDCCI_OPCODE_VCP_CLOCK_PHASE 0x3E
  183. #define DDCCI_OPCODE_VCP_HPARALLELOGRAM 0x40
  184. #define DDCCI_OPCODE_VCP_VPARALLELOGRAM 0x41
  185. #define DDCCI_OPCODE_VCP_HKEYSTONE 0x42
  186. #define DDCCI_OPCODE_VCP_VKEYSTONE 0x43
  187. #define DDCCI_OPCODE_VCP_ROTATION 0x44
  188. #define DDCCI_OPCODE_VCP_TOP_CORNER_FLARE 0x46
  189. #define DDCCI_OPCODE_VCP_TOP_CORNER_HOOK 0x48
  190. #define DDCCI_OPCODE_VCP_BOTTOM_CORNER_FLARE 0x4A
  191. #define DDCCI_OPCODE_VCP_BOTTOM_CORNER_HOOK 0x4C
  192. #define DDCCI_OPCODE_VCP_TIMING_MSG 0x4E
  193. #define DDCCI_OPCODE_VCP_ACTIVE_CONTROL 0x52
  194. #define DDCCI_OPCODE_VCP_COLORTEMP 0x54
  195. #define DDCCI_OPCODE_VCP_HMOIRE 0x56
  196. #define DDCCI_OPCODE_VCP_VMOIRE 0x58
  197. #define DDCCI_OPCODE_VCP_SAT_RED 0x59
  198. #define DDCCI_OPCODE_VCP_SAT_YELLOW 0x5A
  199. #define DDCCI_OPCODE_VCP_SAT_GREEN 0x5B
  200. #define DDCCI_OPCODE_VCP_SAT_CYAN 0x5C
  201. #define DDCCI_OPCODE_VCP_SAT_BLUE 0x5D
  202. #define DDCCI_OPCODE_VCP_SAT_MAGENTA 0x5E
  203. #define DDCCI_OPCODE_VCP_INPUT_SOURCE 0x60
  204. #define DDCCI_OPCODE_VCP_AUDIO_VOLUME 0x62
  205. #define DDCCI_OPCODE_VCP_SPEAKER_SELECT 0x63
  206. #define DDCCI_OPCODE_VCP_MICROPHONE_VOLUME 0x64
  207. #define DDCCI_OPCODE_VCP_AMBIENT_LIGHT_SENSOR 0x66
  208. #define DDCCI_OPCODE_VCP_BACKLIGHT_LEVEL_WHITE 0x6B
  209. #define DDCCI_OPCODE_VCP_RED_BLACK_LEVEL 0x6C
  210. #define DDCCI_OPCODE_VCP_BACKLIGHT_LEVEL_RED 0x6D
  211. #define DDCCI_OPCODE_VCP_GREEN_BLACK_LEVEL 0x6E
  212. #define DDCCI_OPCODE_VCP_BACKLIGHT_LEVEL_GREEN 0x6F
  213. #define DDCCI_OPCODE_VCP_BLUE_BLACK_LEVEL 0x70
  214. #define DDCCI_OPCODE_VCP_BACKLIGHT_LEVEL_BLUE 0x71
  215. #define DDCCI_OPCODE_VCP_GAMMA 0x72
  216. #define DDCCI_OPCODE_VCP_LUT_SIZE 0x73
  217. #define DDCCI_OPCODE_VCP_SINGLE_POINT_LUT 0x74
  218. #define DDCCI_OPCODE_VCP_BLOCK_LUT 0x75
  219. #define DDCCI_OPCODE_VCP_REMOTE_PROC_CALL 0x76
  220. #define DDCCI_OPCODE_VCP_ID_DATA_OPERATION 0x78
  221. #define DDCCI_OPCODE_VCP_ADJUST_ZOOM 0x7C
  222. #define DDCCI_OPCODE_VCP_PRODUCTKEY 0x7E
  223. #define DDCCI_OPCODE_VCP_HMIRROR 0x82
  224. #define DDCCI_OPCODE_VCP_VMIRROR 0x84
  225. #define DDCCI_OPCODE_VCP_DISPLAY_SCALING 0x86
  226. #define DDCCI_OPCODE_VCP_SHARPNESS 0x87
  227. #define DDCCI_OPCODE_VCP_VELOCITY_SCAN_MODULATION 0x88
  228. #define DDCCI_OPCODE_VCP_TV_SATURATION 0x8A
  229. #define DDCCI_OPCODE_VCP_TV_CHANNEL_UP_DOWN 0x8B
  230. #define DDCCI_OPCODE_VCP_TV_SHARPNESS 0x8C
  231. #define DDCCI_OPCODE_VCP_AUDIO_MUTE 0x8D
  232. #define DDCCI_OPCODE_VCP_TV_CONTRAST 0x8E
  233. #define DDCCI_OPCODE_VCP_AUDIO_TREBLE 0x8F
  234. #define DDCCI_OPCODE_VCP_HUE 0x90
  235. #define DDCCI_OPCODE_VCP_AUDIO_BASS 0x91
  236. #define DDCCI_OPCODE_VCP_TV_BLACK_LEVEL 0x92
  237. #define DDCCI_OPCODE_VCP_AUDIO_BALANCE 0x93
  238. #define DDCCI_OPCODE_VCP_AUDIO_PROCESSOR_MODE 0x94
  239. #define DDCCI_OPCODE_VCP_WINDOW_POSITION_TL_X 0x95
  240. #define DDCCI_OPCODE_VCP_WINDOW_POSITION_TL_Y 0x96
  241. #define DDCCI_OPCODE_VCP_WINDOW_POSITION_BR_X 0x97
  242. #define DDCCI_OPCODE_VCP_WINDOW_POSITION_BR_Y 0x98
  243. #define DDCCI_OPCODE_VCP_WINDOW_BACKGROUND 0x9A
  244. #define DDCCI_OPCODE_VCP_RED 0x9B
  245. #define DDCCI_OPCODE_VCP_YELLOW 0x9C
  246. #define DDCCI_OPCODE_VCP_GREEN 0x9D
  247. #define DDCCI_OPCODE_VCP_CYAN 0x9E
  248. #define DDCCI_OPCODE_VCP_BLUE 0x9F
  249. #define DDCCI_OPCODE_VCP_MAGENDA 0xA0
  250. #define DDCCI_OPCODE_VCP_AUTO_SETUP 0xA2
  251. #define DDCCI_OPCODE_VCP_WINDOW_MASK_CONTROL 0xA4
  252. #define DDCCI_OPCODE_VCP_WINDOW_SELECT 0xA5
  253. #define DDCCI_OPCODE_VCP_WINDOW_SIZE 0xA6
  254. #define DDCCI_OPCODE_VCP_WINDOW_TRANSPARENCY 0xA7
  255. #define DDCCI_OPCODE_VCP_SYNC_TYPE 0xA8
  256. #define DDCCI_OPCODE_VCP_SCREEN_ORIENTATION 0xAA
  257. #define DDCCI_OPCODE_VCP_HFREQ 0xAC
  258. #define DDCCI_OPCODE_VCP_VFREQ 0xAE
  259. #define DDCCI_OPCODE_VCP_STORE_SETTING 0xB0
  260. #define DDCCI_OPCODE_VCP_PANEL_TYPE 0xB2
  261. #define DDCCI_OPCODE_VCP_RGB_ORDERING 0xB4
  262. #define DDCCI_OPCODE_VCP_COLOR_CODING 0xB5
  263. #define DDCCI_OPCODE_VCP_MONITOR_TYPE 0xB6
  264. #define DDCCI_OPCODE_VCP_MONITOR_STATUS 0xB7
  265. #define DDCCI_OPCODE_VCP_PACKET_COUNT 0xB8
  266. #define DDCCI_OPCODE_VCP_MONITOR_X_ORIGIN 0xB9
  267. #define DDCCI_OPCODE_VCP_MONITOR_Y_ORIGIN 0xBA
  268. #define DDCCI_OPCODE_VCP_HEADER_ERROR_COUNT 0xBB
  269. #define DDCCI_OPCODE_VCP_BODY_CRC_ERROR_COUNT 0xBC
  270. #define DDCCI_OPCODE_VCP_CLIENT_ID 0xBD
  271. #define DDCCI_OPCODE_VCP_LINK_CONTROL 0xBE
  272. #define DDCCI_OPCODE_VCP_USAGE_TIME 0xC0
  273. #define DDCCI_OPCODE_VCP_DISP_DESCRIPTOR_LENGTH 0xC2
  274. #define DDCCI_OPCODE_VCP_TRANSMIT_DISP_DESCRIPTOR 0xC3
  275. #define DDCCI_OPCODE_VCP_DISP_DESCRIPTOR_EN 0xC4
  276. #define DDCCI_OPCODE_VCP_APPLICATION_ENABLE 0xC6
  277. #define DDCCI_OPCODE_VCP_DISP_ENABLE_KEY 0xC7
  278. #define DDCCI_OPCODE_VCP_CONTROLLER_TYPE 0xC8
  279. #define DDCCI_OPCODE_VCP_FW_LEVEL 0xC9
  280. #define DDCCI_OPCODE_VCP_OSD_ON_OFF 0xCA
  281. #define DDCCI_OPCODE_VCP_OSD_LANGUAGE 0xCC
  282. #define DDCCI_OPCODE_VCP_STATUS_INDICATOR 0xCD
  283. #define DDCCI_OPCODE_VCP_AUXILIARY_DISP_SIZE 0xCE
  284. #define DDCCI_OPCODE_VCP_AUXILIARY_DISP_DATA 0xCF
  285. #define DDCCI_OPCODE_VCP_OUTPUT_SELECT 0xD0
  286. #define DDCCI_OPCODE_VCP_ASSET_TAG 0xD2
  287. #define DDCCI_OPCODE_VCP_STEREO_VIDEO_MODE 0xD4
  288. #define DDCCI_OPCODE_VCP_POWER_MODE 0xD6
  289. #define DDCCI_OPCODE_VCP_AUXILIARY_POWER_OUTPUT 0xD7
  290. #define DDCCI_OPCODE_VCP_SCAN_MODE 0xDA
  291. #define DDCCI_OPCODE_VCP_IMAGE_MODE 0xDB
  292. #define DDCCI_OPCODE_VCP_DISPLAY_APPLICATION 0xDC
  293. #define DDCCI_OPCODE_VCP_SCRACHPAD 0xDE
  294. #define DDCCI_OPCODE_VCP_VERSION 0xDF
  295. #define DDCCI_OPCODE_VCP_MANUFACTURER_ENERGY_LEVEL 0xE2
  296. #define DDCCI_OPCODE_VCP_AMD_FREE_SYNC_ON_OFF 0xE6
  297. //Color Preset
  298. #define COLOR_SRGB 0x01
  299. #define COLOR_NATIVE 0x02
  300. #define COLOR_5000K 0x04
  301. #define COLOR_WARM 0x05 //6500K
  302. #define COLOR_NORMAL 0x06 //7300K or 7500K
  303. #define COLOR_8200K 0x07
  304. #define COLOR_COOL 0x08 //9300K
  305. #define COLOR_11500K 0x0A
  306. #define COLOR_USER 0x0B
  307. #define COLOR_ADOBE_RGB 0x0E
  308. //Input Source
  309. #define SRC_DP1 0x0F
  310. #define SRC_DP2 0x10
  311. #define SRC_HDMI1 0x11
  312. #define SRC_HDMI2 0x12
  313. #define SRC_TYPEC1 0x15
  314. #define SRC_TYPEC2 0x16
  315. //Display Scaling
  316. #define SCALING_1_1 0x01
  317. #define SCALING_FULL_SCREEN_WIDE 0x02
  318. #define SCALING_FULL_SCREEN_4_3 0x05
  319. #define SCALING_17INCH_4_3 0x0B
  320. #define SCALING_19INCH_4_3 0x0C
  321. #define SCALING_19INCH_5_4 0x0D
  322. #define SCALING_19INCH_16_10 0x0E
  323. #define SCALING_21P5INCH_16_9 0x0F
  324. #define SCALING_22INCH_16_10 0x10
  325. #define SCALING_23INCH_16_9 0x11
  326. #define SCALING_23P6INCH_16_9 0x12
  327. #define SCALING_24INCH_16_9 0x13
  328. #define SCALING_27INCH_16_9 0x14
  329. #define SCALING_MOVIE1 0x21
  330. #define SCALING_MOVIE2 0x22
  331. #define SCALING_ASPECT 0x23
  332. //Display Application-->
  333. //Gaming Mode
  334. #define APP_GAMING_MODE_OFF 0x00
  335. #define APP_GAMING_MODE_FPS 0x0B
  336. #define APP_GAMING_MODE_RTS 0x0C
  337. #define APP_GAMING_MODE_RACING 0x0D
  338. #define APP_GAMING_MODE_GAMER1 0x0E
  339. #define APP_GAMING_MODE_GAMER2 0x0F
  340. #define APP_GAMING_MODE_GAMER3 0x10
  341. //Eco Mode
  342. #define APP_ECO_MODE_STANDARD 0x80
  343. #define APP_ECO_MODE_TEXT 0x81
  344. #define APP_ECO_MODE_READING 0x82
  345. #define APP_ECO_MODE_INTERNET 0x83
  346. #define APP_ECO_MODE_MOVIE 0x84
  347. #define APP_ECO_MODE_SPORTS 0x85
  348. #define APP_ECO_MODE_PHOTOGRAPHER 0x86
  349. //HDR Mode
  350. #define APP_HDR_MODE_PICTURE 0x87
  351. #define APP_HDR_MODE_MOVIE 0x88
  352. #define APP_HDR_MODE_GAME 0x89
  353. //HDR(Source is hdr on really)
  354. #define APP_HDR_OFF 0x90
  355. #define APP_HDR_DISPLAY_HDR 0x91
  356. #define APP_HDR_PICTURE 0x92
  357. #define APP_HDR_MOVIE 0x93
  358. #define APP_HDR_GAME 0x94
  359. UCHAR8 Hv_App_Ddcci_LangConvertToOsd(UCHAR8 ucLang);
  360. UCHAR8 Hv_App_Ddcci_LangConvertFromOsd(UCHAR8 ucLang);
  361. /**
  362. * @brief Send ddcci message by Specified Port.
  363. * @param[in] enDdcciPort Indicates the ddcci port.
  364. * @param[in] pucData Pointer of the data.
  365. * @param[in] ucLen Length of the data.
  366. * @return Status HV_SUCCESS.
  367. */
  368. Status Hv_App_Ddcci_SendData(DdcciPortEnum enDdcciPort, UCHAR8 *pucData, UINT32 uiLen);
  369. /**
  370. * @brief Send Null-Message.
  371. * @param[in] enDdcciPort 表征是哪个通道.
  372. * @return None.
  373. */
  374. VOID Hv_App_Ddcci_SendNullMsg(DdcciPortEnum enDdcciPort);
  375. /**
  376. * @brief Calculate the CRC.
  377. * @param[in] pucData Pointer of the data.
  378. * @return UCHAR8 CRC value.
  379. */
  380. UCHAR8 Hv_App_Ddcci_CalCheckSum(UCHAR8 *pucData);
  381. /**
  382. * @brief Calculate the CRC of incoming message. Used for any array with mccs header.
  383. * @param[in] VOID.
  384. * @return Status HV_SUCCESS:verify pass, HV_FAILURE:verify fail.
  385. */
  386. Status Hv_App_Ddcci_VerifyCheckSum(UCHAR8 *pucData);
  387. /**
  388. * @brief App层对ddcci通道上消息的处理函数.
  389. * @param[in] pstDdcEvt Poniter of the ddcci event.
  390. * @return Status 消息处理成功后返回HV_SUCCESS.
  391. */
  392. Status Hv_App_Ddcci_HandleMsg(DdcciEvent *pstDdcEvt);
  393. /**
  394. * @brief Initial app layer of ddcci.
  395. * @param[in] None.
  396. * @return None.
  397. */
  398. VOID Hv_App_Ddcci_Init(VOID);
  399. /**
  400. * @brief Send event to osd
  401. * @param[in] usEventId OSD_EVENT_MCCS
  402. * @param[in] usValue unused
  403. * @return Status.
  404. */
  405. Status Hv_App_Ddcci_SendEventToOsd(USHORT16 usEventId, USHORT16 usValue);
  406. VOID Hv_Mw_Ddcci_JudgeCmdParam(UCHAR8 *pucData, DDCCI_CMD_TYPE_E *, UINT32 *);
  407. VOID Hv_App_Ddcci_Register(DDCCI_PROC_HANDLE pfHandle);
  408. #endif