hv_drv_HdmiInc.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. /**
  2. * @file drv_hdmi_inc.h
  3. * @brief HDMI RX driver layer interface.
  4. * @verbatim
  5. * ==============================================================================
  6. * ##### How to use this driver #####
  7. * ==============================================================================
  8. * (+) Use HS_HAL_WDT_Start(...) to start the wdt immediately.
  9. * (+) Use HS_HAL_WDT_Stop(...) to stop the wdt immediately.
  10. * (+) Use HS_HAL_WDT_Feed(...) to feed the watchdog and it will restart the counter immediately.
  11. * @endverbatim
  12. *
  13. * @author HiView SoC Software Team
  14. * @version 0.0.1
  15. * @date 2022-08-22
  16. */
  17. #ifndef __HV_DRV_HDMIINC_H__
  18. #define __HV_DRV_HDMIINC_H__
  19. #include "Common/hv_comm_DataType.h"
  20. #include "hv_cal_HdmiRx.h"
  21. #define CEC_ACTIVE_SOURCE 0x82 /*!< CEC command ID. Please refer to the HDMI spec. */
  22. #define CEC_IMAGE_VIEW_ON 0x04 /*!< CEC command ID. Please refer to the HDMI spec. */
  23. #define CEC_TEXT_VIEW_ON 0x0d /*!< CEC command ID. Please refer to the HDMI spec. */
  24. #define CEC_REQUEST_ACTIVE_SOURCE 0x85 /*!< CEC command ID. Please refer to the HDMI spec. */
  25. #define CEC_STANDBY 0x36 /*!< CEC command ID. Please refer to the HDMI spec. */
  26. #define CEC_GIVE_PHYSICAL_ADDRESS 0x83 /*!< CEC command ID. Please refer to the HDMI spec. */
  27. #define CEC_GET_MENU_LANGUAGE 0x91 /*!< CEC command ID. Please refer to the HDMI spec. */
  28. #define CEC_REPORT_PHYSICAL_ADDRESS 0x84 /*!< CEC command ID. Please refer to the HDMI spec. */
  29. #define CEC_SET_MENU_LANGUAGE 0x32 /*!< CEC command ID. Please refer to the HDMI spec. */
  30. #define CEC_DEVICE_VENDOR_ID 0x87 /*!< CEC command ID. Please refer to the HDMI spec. */
  31. #define CEC_GIVE_DEVICE_VENDOR_ID 0x8c /*!< CEC command ID. Please refer to the HDMI spec. */
  32. #define CEC_VENDOR_COMMAND 0x89 /*!< CEC command ID. Please refer to the HDMI spec. */
  33. #define CEC_VENDOR_RC_BUTTON_DOWN 0x8a /*!< CEC command ID. Please refer to the HDMI spec. */
  34. #define CEC_VENDOR_RC_BUTTON_UP 0x8b /*!< CEC command ID. Please refer to the HDMI spec. */
  35. #define CEC_SET_OSD_STRING 0x64 /*!< CEC command ID. Please refer to the HDMI spec. */
  36. #define CEC_GIVE_OSD_NAME 0x46 /*!< CEC command ID. Please refer to the HDMI spec. */
  37. #define CEC_SET_OSD_NAME 0x47 /*!< CEC command ID. Please refer to the HDMI spec. */
  38. #define CEC_MENU_REQUEST 0x8d /*!< CEC command ID. Please refer to the HDMI spec. */
  39. #define CEC_MENU_STATUS 0x8e /*!< CEC command ID. Please refer to the HDMI spec. */
  40. #define CEC_USER_CONTROL_PRESSED 0x44 /*!< CEC command ID. Please refer to the HDMI spec. */
  41. #define CEC_USER_CONTROL_RELEASED 0x45 /*!< CEC command ID. Please refer to the HDMI spec. */
  42. #define CEC_GIVE_DEVICE_POWER_STATUS 0x8f /*!< CEC command ID. Please refer to the HDMI spec. */
  43. #define CEC_REPORT_POWER_STATUS 0x90 /*!< CEC command ID. Please refer to the HDMI spec. */
  44. #define CEC_FEATURE_ABORT 0x00 /*!< CEC command ID. Please refer to the HDMI spec. */
  45. #define CEC_RECORD_OFF 0x0b /*!< CEC command ID. Please refer to the HDMI spec. */
  46. #define CEC_RECORD_ON 0x09 /*!< CEC command ID. Please refer to the HDMI spec. */
  47. #define CEC_RECORD_STATUS 0x0a /*!< CEC command ID. Please refer to the HDMI spec. */
  48. #define CEC_RECORD_TV_SCREEN 0x0f /*!< CEC command ID. Please refer to the HDMI spec. */
  49. #define CEC_SELECT_DIGITAL_SOURCE 0x93 /*!< CEC command ID. Please refer to the HDMI spec. */
  50. #define CEC_INACTIVE_SOURCE 0x9D /*!< CEC command ID. Please refer to the HDMI spec. */
  51. #define CEC_VERSION 0x9E /*!< CEC command ID. Please refer to the HDMI spec. */
  52. #define CEC_GET_VERSION 0x9F /*!< CEC command ID. Please refer to the HDMI spec. */
  53. #define CEC_INITIATE_ARC 0xC0
  54. #define CEC_REPORT_ARC_INITIATED 0xC1
  55. #define CEC_ABORT_TEST 0xff /*!< CEC command ID. Please refer to the HDMI spec. */
  56. #define CEC_CMD_NULL 0x00
  57. #define CEC_PWR_ON 0x01
  58. #define CEC_PWR_OFF 0x02
  59. #define CEC_PWR_ONOFF 0x03
  60. #define CEC_USER_CTRL_POWER 0x40 /*!< Power command of CEC user control. */
  61. #if 0
  62. typedef enum _CEC_COMMAND
  63. {
  64. eFeatureAbort =0x00,
  65. // One Touch Play Feature
  66. eActiveSource =0x82, // follower:TV, switch --> Broadcst , Directly address
  67. eImageViewOn =0x04, // follower:TV, switch --> Broadcst
  68. eTextViewOn =0x0D, // follower:TV
  69. // Routing Control Feature
  70. eRoutingChange =0x80, // follower:TV, switch --> Broadcst
  71. eRoutingInformation =0x81, // follower:switch --> Broadcst
  72. eRequestActiveSource =0x85, // follower:switch --> Broadcst , AVR to request active source when Audio ocntrol feature is active
  73. eSetStreamPath =0x86, // follower:switch --> Broadcst
  74. eInactiveSource =0x9D, //
  75. eStandBy =0x36, // follower:All --> Broadcst
  76. // One Touch Record Feature
  77. eRecordOff =0x0B,
  78. eRecordOn =0x09,
  79. eRecordStatus =0x0A,
  80. eRecordTVScreen =0x0F,
  81. // Timer Programming Feature
  82. eClearAnalogueTimer =0x33,
  83. eClearDigitalTimer =0x99,
  84. eClearExternalTimer =0xA1,
  85. eSetAnalogueTimer =0x34,
  86. eSetDigitalTimer =0x97,
  87. eSetExternalTimer =0xA2,
  88. eSetTimerProgramTitle =0x67,
  89. eTimerClearedStatus =0x43,
  90. eTimerStatus =0x35,
  91. // System Information Feature
  92. eCECVersioin =0x9E,
  93. eGetCECVersion =0x9F,
  94. eGivePhysicalAddress =0x83, // follower:All
  95. eGetMenuLanguage =0x91, // follower:TV
  96. eReportPhysicalAddress =0x84, // follower:TV
  97. eSetMenuLanguage =0x32, // follower:All, Initiator:TV
  98. eReportFeatures =0xA6,
  99. eGiveFeatures =0xA5,
  100. // Deck Control Feature
  101. eDeckControl =0x42,
  102. eDeckStatus =0x1B,
  103. eGiveDeckStatus =0x1A,
  104. ePlay =0x41,
  105. // Tuner Control Featuer
  106. eGiveTunerDeviceStatus =0x08,
  107. eSelectAnalogueService =0x92,
  108. eSelectDigitalService =0x93,
  109. eTunerDeviceStatus =0x07,
  110. eTunerStepDecrement =0x06,
  111. eTunerStepIncrement =0x05,
  112. // Vendor Specific Commands Feature
  113. eDeviceVendorID =0x87,
  114. eGiveDeviceVendorID =0x8C,
  115. eVendorCommand =0x89,
  116. eGiveDevicePowerStatus =0x8F,
  117. eReportPowerStatus =0x90,
  118. eVendorCommandWithID =0xA0,
  119. eRemoteButtonDown =0x8A,
  120. eRemoteButtonUp =0x8B,
  121. // OSD Display Feature
  122. eSetOSDString =0x64,
  123. // Device OSD Transfer Feature
  124. eGiveOSDName =0x46,
  125. eSetOSDName =0x47,
  126. // Device Menu Control Feature
  127. eMenuRequest =0x8D,
  128. eMenuStatus =0x8E,
  129. eUserControlPressed =0x44,
  130. eUserControlReleased =0x45,
  131. // System Audio Control Feature
  132. eSystemAudioModeRequest =0x70,
  133. eGiveAudioStatus =0x71,
  134. eSetSystemAudioMode =0x72,
  135. eReportAudioStatus =0x7A,
  136. eGiveSystemAudioModeStatus =0x7D,
  137. eSystemAudioModeStatus =0x7E,
  138. eReportAudioDescriptor =0xA3,
  139. eRequestAudioDescriptor =0xA4,
  140. // Audio Rate Control Feature
  141. eSetAudioRate =0x9A,
  142. // ACR
  143. eInitiateARC =0xC0,
  144. eReportARCInitiated =0xC1,
  145. eReportARCTerminated =0xC2,
  146. eRequestARCInitiation =0xC3,
  147. eRequestARCTermination =0xC4,
  148. eTerminateARC =0xC5,
  149. // Dynamic Auto Lipsync Featuer
  150. eRequestCurrentLatency =0xA7,
  151. eReportCurrentLatency =0xA8,
  152. // HEC
  153. eCDCMessage =0xF8,
  154. //Audio Format Feature
  155. eReportShortAudioDescription = 0xA3 ,
  156. eRequestShortAudioDescription = 0xA4 ,
  157. // Polling Mesage
  158. ePollingMessage,
  159. eAbort =0xff,
  160. eCECNone
  161. } eCEC_CMD;
  162. #endif
  163. typedef enum{
  164. eCDCFeature = 0,
  165. eOTPFeature,
  166. eRoutingCtlFeature,
  167. eStandByFeature,
  168. eOTRFeature,
  169. eTimerProgFeature,
  170. eSysInfoFeature,
  171. eDeckCtrlFeature,
  172. eTunerCtrlFeature,
  173. eVenSpecCmdFeature,
  174. eOSDDisplayFeature,
  175. eDevOSDTransferFeature,
  176. eDevMenuCtrlFeature,
  177. eRemoteCtlPassthroughFeature,
  178. ePowerStatusFeature,
  179. eGeneralProtocolMessage,
  180. eSysAudioCtlFeature,
  181. eAudioRateCtrlFeature,
  182. eARCFeature,
  183. eDynAutoLipsyncFeature,
  184. eHECFeature,
  185. eAudioFormatFeature ,
  186. eNoneFeature
  187. }CECOpCodeType;
  188. typedef enum {
  189. eCecPowerStatusOn = 0x00,
  190. eCecPowerStatusOff = 0x01,
  191. eCecPowerStatusOnToOff = 0x02,
  192. eCecPowerStatusOffToOn = 0x03
  193. }CECPowerStatus;
  194. typedef enum {
  195. eSelect = 0x00 ,
  196. eUp = 0x01 ,
  197. eDown = 0x02 ,
  198. eLeft = 0x03 ,
  199. eRight = 0x04 ,
  200. eRightUp = 0x05 ,
  201. eRightDown = 0x06 ,
  202. eLeftUp = 0x07 ,
  203. eLeftDown = 0x08 ,
  204. eRootMenu = 0x09 ,
  205. eSetupMenu = 0x0A ,
  206. eContentsMenu = 0x0B ,
  207. eFavoriteMenu = 0x0C ,
  208. eExit = 0x0D ,
  209. eMediaTopMenu = 0x10 ,
  210. eMediaContentSensitiveMenu = 0x11 ,
  211. eNumberEntryMode = 0x1D ,
  212. eDot = 0x2A ,
  213. eEnter = 0x2B ,
  214. eClear = 0x2C ,
  215. eNextFavorite = 0x2F ,
  216. eChannelUp = 0x30 ,
  217. eChannelDown= 0x31 ,
  218. ePreViousChannel = 0x32 ,
  219. eSoundSelect= 0x33 ,
  220. eInputSelect= 0x34 ,
  221. eDisplayInformation = 0x35 ,
  222. eHelp = 0x36,
  223. ePageUp = 0x37,
  224. ePageDown = 0x38,
  225. ePower = 0x40,
  226. eVolumeUp = 0x41 ,
  227. eVolumeDown = 0x42 ,
  228. eMute = 0x43 ,
  229. ePlayCmd = 0x44 ,
  230. eStop = 0x45 ,
  231. ePause = 0x46 ,
  232. eRecord = 0x47 ,
  233. eRewind = 0x48 ,
  234. eFastForward= 0x49 ,
  235. eEject = 0x4A ,
  236. eForward = 0x4B ,
  237. eBackward = 0x4C ,
  238. eStopRecord = 0x4D ,
  239. ePauseRecord= 0x4E ,
  240. eAngle = 0x50 ,
  241. eSubPicture = 0x51 ,
  242. eVideoOnDemand = 0x52 ,
  243. eElectronicProgramGuide = 0x53 ,
  244. etimerProgramming = 0x54 ,
  245. einitialConfiguration = 0x55 ,
  246. eSelectBroadcastType = 0x56 ,
  247. eSelectSoundPresentation = 0x57 ,
  248. ePlayFunction = 0x60 ,
  249. ePausePlayFunction = 0x61 ,
  250. eRecordFunction = 0x62 ,
  251. ePauseRecordFunction = 0x63 ,
  252. eStopFunction = 0x64 ,
  253. eMuteFunction = 0x65 ,
  254. eRestoreVolumnFunction = 0x66 ,
  255. eTuneFunction = 0x67 ,
  256. eSelectMediaFunction = 0x68 ,
  257. eSelectAVInputFunction = 0x69 ,
  258. eSelectAudioInputFunction = 0x6A ,
  259. ePowerToggleFunction = 0x6B ,
  260. ePowerOffFunction = 0x6C ,
  261. ePowerOnFunction = 0x6D ,
  262. }CECUICmd;
  263. typedef enum _CEC_Logic_DEVICE_ID_t
  264. {
  265. DEVICE_ID_TV=0,
  266. DEVICE_ID_RECORDING1, // 1
  267. DEVICE_ID_RECORDING2, // 2
  268. DEVICE_ID_TUNER1, // 3
  269. DEVICE_ID_PLAYBACK1, // 4
  270. DEVICE_ID_AUDIO, // 5
  271. DEVICE_ID_TUNER2, // 6
  272. DEVICE_ID_TUNER3, // 7
  273. DEVICE_ID_PLAYBACK2, // 8
  274. DEVICE_ID_RECORDING3, // 9
  275. DEVICE_ID_TUNER4, // 10
  276. DEVICE_ID_PLAYBACK3, // 11
  277. DEVICE_ID_RESERVED1, // 12
  278. DEVICE_ID_RESERVED2, // 13
  279. DEVICE_ID_FREEUSE, // 14
  280. DEVICE_ID_BROADCAST, // 15
  281. DEVICE_ID_MAX
  282. } CEC_Logic_DEVICE_ID_t;
  283. typedef struct
  284. {
  285. UCHAR8 ucHeader;
  286. UCHAR8 ucOPCode;
  287. UCHAR8 aucOperandBuf[14];
  288. }SCecMsg;
  289. typedef struct
  290. {
  291. UCHAR8 ucGet;
  292. UCHAR8 ucPut;
  293. UCHAR8 aucCmdBuf[DCEC_CMD_CACHE_NUM];
  294. }SCecCmd;
  295. typedef struct
  296. {
  297. UCHAR8 ucDestinationLA;
  298. SCecCmd stCecCmd;
  299. HV_VOS_QUEUE_S *pstCECMsgQueue;
  300. }SCecControl;
  301. #endif