al_console_customer.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. #ifndef __CONSOLE_CUSTOM_H_
  2. #define __CONSOLE_CUSTOM_H_
  3. #include "types.h"
  4. #include "al_basictypes.h"
  5. #include "customize.h"
  6. #define CMD_ECHO 0x0
  7. #define CMD_MMIOWRITE 0x1
  8. #define CMD_MMIOREAD 0x2
  9. #define CMD_MULTIPLE_READ 0x10
  10. #define CMD_LEAVECONSOLE 0x0100
  11. #define CMD_WHITEBALANCE 0x0101
  12. #define CMD_GAMMACORRECTION 0x0102
  13. #define CMD_SAVEGAMMA 0x0103
  14. #define CMD_CHANGESOURCE 0x0104
  15. #define CMD_MULTIWRITE 0x0105
  16. #define CMD_READMMIOMASK 0x0200
  17. #define CMD_WRITEMMIOMASK 0x0201
  18. #define CMD_GPIOREAD 0x0202
  19. #define CMD_GPIOWRITE 0x0203
  20. #define CMD_I2CREAD 0x0204
  21. #define CMD_I2CWRITE 0x0205
  22. #define CMD_REBOOT 0x0300
  23. #define CMD_WRITEFLASH 0x0301
  24. #define CMD_READFLASH 0x0302
  25. #define CMD_PQ_TOOL_SYNC 0x0401
  26. #define CMD_SIS_SYNC 0xFA
  27. #define CMD_PQ_Leave 0x00
  28. #define CMD_PQ_Echo 0x01
  29. #define CMD_PQ_Reboot 0x02
  30. #define CMD_PQ_Read_Flash 0x10
  31. #define CMD_PQ_Write_Flash 0x11
  32. #define CMD_PQ_MMIO_Read 0x12
  33. #define CMD_PQ_MMIO_Write 0x13
  34. #define CMD_PQ_Set_GammaTab 0x14
  35. #define CMD_PQ_Cmd_Set 0x15
  36. #define CMD_PQ_Read_Table_Info 0x16
  37. #define CMD_SIS_HDCP_Read 0x20
  38. #define CMD_SIS_HDCP_Write 0x21
  39. #define CMD_Audio_SetEffectExt 0x30
  40. #define CMD_Audio_GetEffectExt 0x31
  41. #define CMD_Audio_SetNRExt 0x32
  42. #define CMD_Audio_GetNRExt 0x33
  43. #define CMD_PQ_Read_DynXastInfo 0x40
  44. #define CMD_PQ_Write_DynXastInfo 0x41
  45. #define CMD_System_Call 0x60
  46. #define CMD_SFU_Set_TvConnenction 0xA9
  47. #define CMD_SFU_Set_SymbolRate 0xC9
  48. #define CMD_SFU_Set_SpecifiedChannel 0xE9
  49. #define CMD_SFU_Get_MosaicStatus 0x89
  50. #define CMD_DBX_Audio 0x64
  51. #define AutoTest_CMD_VoltageCheck 0x81
  52. #define AutoTest_CMD_SourceCheck 0x82
  53. #define AutoTest_CMD_KeyCheck 0x83
  54. #define AutoTest_CMD_Reset 0x84
  55. #define AutoTest_CMD_CIInfoCheck 0x85
  56. #define AutoTest_CMD_UpdateKey 0x86
  57. #define AutoTest_CMD_NetCheck 0x87
  58. #define AutoTest_CMD_WifiCheck 0x88
  59. #define AutoTest_CMD_LNBCheck 0x89
  60. #define AutoTest_CMD_USBCheck 0x8a
  61. #define AutoTest_CMD_UpdateSW 0x8b
  62. #define AutoTest_CMD_IRCheck 0x8c
  63. #define AutoTest_CMD_NotSupport 0xfe
  64. #define TOOL_DEFAULT_TYPE1_KEY 0xABCD5678
  65. #define RESERVED_C__KEY_TOOL_TYPE_SIT 488
  66. #define C_KEY_VALUE_BYTE 512
  67. #define V_KEY_VALUE_BYTE 32
  68. #define R_KEY_VALUE_BYTE 40
  69. #define CRC_KEY_VALUE_BYTE 4
  70. #define CMD_AUTOTEST_SYNC_AA 0xAA
  71. #define CMD_AUTOTEST_SYNC_AB 0xAB
  72. #define CMD_HK_SYNC_80 0x80
  73. #define BUFFER_MAX 1500
  74. typedef struct
  75. {
  76. UINT32 CMD_ID;
  77. void (*FactoryFun)(pCON_DEV pcon, UINT8 *pValue);
  78. }Factory_CMD;
  79. enum {
  80. QSD_fail,
  81. QSD_success,
  82. QSD_done,
  83. };
  84. enum{
  85. RS232_SERIAL_MODE,
  86. RS232_USB_MODE
  87. };
  88. enum {
  89. MEDIA_JPEG,
  90. MEDIA_MPEG,
  91. };
  92. enum{
  93. Index_Console_Leave,
  94. Index_Console_Echo,
  95. Index_Console_Reboot,
  96. Index_Console_Read_Flash,
  97. Index_Console_Write_Flash,
  98. Index_Console_MMIO_Read,
  99. Index_Console_MMIO_Write,
  100. Index_Console_Set_GammaTab,
  101. Index_Max,
  102. };
  103. enum{
  104. DBXTV_LoadPresetsFile,
  105. DBXTV_GetParamCoeff,
  106. DBXTV_SetParamCoeff,
  107. };
  108. typedef enum{
  109. AutoTest_CMD_SetVoltageCheck,
  110. AutoTest_CMD_SetSourceCheck,
  111. AutoTest_CMD_SetKeyCheck,
  112. AutoTest_CMD_SetReset,
  113. AutoTest_CMD_SetCIInfoCheck,
  114. AutoTest_CMD_SetHDCPKeyUpdate,
  115. AutoTest_CMD_SetCIPKeyUpdate,
  116. AutoTest_CMD_SetMACAddr,
  117. AutoTest_CMD_SetNetCheck,
  118. AutoTest_CMD_SetWifiCheck,
  119. AutoTest_CMD_SetLNBCheck,
  120. AutoTest_CMD_SetUSBCheck,
  121. AutoTest_CMD_SetUpdateSW,
  122. AutoTest_CMD_SetIRCheck,
  123. AutoTest_CMD_SetNotSupport,
  124. }AutoTest_SET_CMD;
  125. typedef enum{
  126. AutoTest_ack_none=0,
  127. AutoTest_ack_source=0x01,
  128. AutoTest_ack_key=0x02,
  129. AutoTest_ack_reset=0x04,
  130. AutoTest_ack_usb_check=0x08,
  131. AutoTest_ack_ir=0x10,
  132. AutoTest_ack_update_sw = 0x20,
  133. AutoTest_ack_update_hdcp = 0x40,
  134. AutoTest_ack_not_support = 0x80,
  135. }AutoTest_ACK_TYPE;
  136. typedef enum{
  137. AutoTest_usb_none = 0,
  138. AutoTest_usb_success = 1,
  139. AutoTest_usb_no_device = 2,
  140. AutoTest_usb_no_file = 3,
  141. AutoTest_usb_init_fail = 4,
  142. AutoTest_usb_error = 5,
  143. }AutoTest_USB_RESULT;
  144. typedef bool (*Console_sfu_Cbk_pf)(pCON_DEV pcon, UINT8 *msg);
  145. typedef struct Console_sfu_Cbk_t_
  146. {
  147. Console_sfu_Cbk_pf pfCallBack;
  148. } Console_sfu_Cbk_t;
  149. typedef void (* con_CallBack_t)(al_uint8 eventID, al_uint8 data1, al_uint8 data2);
  150. void al_console_sfu_init(Console_sfu_Cbk_t *pConsole_Sfu_Cfg);
  151. bool con_suf_parser(pCON_DEV pcon, UINT8 *msg);
  152. void con_echo_sfu(UINT32 count, UINT8 *pdata);
  153. void con_echo_sfu_Save2Usb(UINT32 count, UINT8 *pdata);
  154. typedef int (*Console_ats_Cbk_pf)(pCON_DEV pcon, UINT8 *msg);
  155. typedef struct Console_ats_Cbk_t_
  156. {
  157. Console_ats_Cbk_pf pfCallBack;
  158. } Console_ats_Cbk_t;
  159. typedef bool (*Console_autotest_Cbk_pf)(pCON_DEV pcon, UINT8 *msg);
  160. typedef struct Console_autoest_Cbk_t_
  161. {
  162. Console_autotest_Cbk_pf pfCallBack;
  163. } Console_autotest_Cbk_t;
  164. void al_console_ats_init(Console_ats_Cbk_t *pConsole_ats_Cfg);
  165. int con_ats_parser(pCON_DEV pcon, UINT8 *msg);
  166. void con_print(/*pCON_DEV pcon,*/char* str ,int size);
  167. void con_echo(pCON_DEV pcon, unsigned int parm);
  168. pCON_DEV get_pCON_DEV(void);
  169. bool con_parser(pCON_DEV pcon, UINT32 *msg);
  170. bool con_SIS_parser(pCON_DEV pcon, UINT8 *msg);
  171. void con_echo1(pCON_DEV pcon, UINT8 data1, UINT8 data2);
  172. void con_ShowHexValuetoOSD(UINT8 bTx, UINT8 len, UINT8 *pStr);
  173. void con_SaveDbgMsgtoUSB(UINT8 bTx, short len, UINT8 *pStr);
  174. extern bool con_src_parser(pCON_DEV pcon,unsigned char *msg);
  175. extern bool con_new_src_parser(pCON_DEV pcon,unsigned char *msg);
  176. void con_RegCallBackFunc(con_CallBack_t pCallBackFunc);
  177. void con_mmiotest_status(UINT8 status);
  178. void con_echo_respond_message(UINT16 count, UINT8 *pdata);
  179. void con_autotest_HeaderParse(unsigned char* buff, unsigned int bufflen, unsigned int *commandlen);
  180. void al_console_autotest_init(Console_autotest_Cbk_t *pConsole_autotest_Cfg);
  181. bool con_autotest_parser(pCON_DEV pcon, UINT8 *msg);
  182. #if defined(SUPPORT_FACTORY_AUTO_TEST_MODE4)
  183. UINT32 AutoTest_TransTVSource(UINT8 cmdSrc, UINT32 srcID);
  184. void AutoTest_SendCommand(AutoTest_SET_CMD cmd, UINT8 *pValue);
  185. unsigned int AutoTest_crc_check(unsigned char *fp_CRC,int count);
  186. bool con_AutoTestCMD_parser(pCON_DEV pcon,unsigned char *msg);
  187. int AutoTest_GetUsbPathWithPort(int port, char *usbPath);
  188. AutoTest_USB_RESULT AutoTest_USB_Test(UINT8 devNum);
  189. void AutoTest_SetSendAck(AutoTest_ACK_TYPE SendAck);
  190. AutoTest_ACK_TYPE AutoTest_GetSendAck(void);
  191. void AutoTest_SetReceiveIRTest(UINT8 ReceiveIRTest);
  192. UINT8 AutoTest_GetReceiveIRTest(void);
  193. #endif
  194. #ifdef CONFIG_SUPPORT_DBX
  195. void al_DBXTV_echo(UINT8 count, UINT8 * pdata);
  196. al_uint8 al_DBXTV_loadPresetFile();
  197. al_uint8 al_DBXTV_SetParamCoeff(al_uint32 ParamCoeff, al_uint32 ParamCoeffOffset, al_uint32 ParamCoeffValue);
  198. al_uint8 al_DBXTV_GetParamCoeff(al_uint32 ParamCoeff, al_uint32 ParamCoeffOffset);
  199. #endif
  200. #endif