al_console_CtvRs232.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. #ifndef __CONSOLE_CTV_RS232_H_
  2. #define __CONSOLE_CTV_RS232_H_
  3. #include "types.h"
  4. #include "al_basictypes.h"
  5. #include "app_event.h"
  6. #include "al_console.h"
  7. #include "al_console_customer.h"
  8. #define ACCUVIEW_RS232_AutoTest_HEAD 0x79
  9. #define ACCUVIEW_RS232_AutoTest_TAIL 0xFE
  10. #define CMD_DATA_MAX 64
  11. /*
  12. Frame_Head Type Cmd_ID Data_Len Data_Content Frame No Frame Sum Frame CRC Frame Tail
  13. 1B 4b(H)4b(L) 2B 1B 64B 1B 1B 1B 1B
  14. Frame Head:0x79
  15. Data Length:max is 64B
  16. Frame No:start with 0
  17. Frame Sum:start with 1
  18. CRC: frame type -> frame Sum
  19. Frame Tail:0xFE
  20. */
  21. typedef struct CommandFrame_t_{
  22. UINT8 FrameHead;
  23. UINT8 frameType;
  24. UINT8 cmdType;
  25. UINT8 Command_H;
  26. UINT8 Command_L;
  27. UINT8 dataLen;
  28. UINT8 * data;
  29. UINT8 FrameNo;
  30. UINT8 FrameSum;
  31. UINT8 FrameCrc;
  32. UINT8 FrameTail;
  33. }CommandFrame_t;
  34. typedef struct IrEvent_t_{
  35. UINT32 Irevent;
  36. UINT8 *EventString;
  37. UINT8 stringLen;
  38. }IrEvent_t;
  39. typedef enum DownloadBuffer_e_ {
  40. DB_CI_PLUS_KEY,
  41. DB_HDCP14_KEY,
  42. //DB_HDCP22_KEY,
  43. DB_BUFFER_MAX,
  44. }DownloadBuffer_e;
  45. typedef enum{
  46. CTV_RS232_CMD_TEST_CONFIG_NOTIFYE = 0x0,
  47. CTV_RS232_CMD_TEST_READY_NOTIFYE = 0x1,
  48. CTV_RS232_CMD_PCBA_SERIAL_WRITE = 0x2,
  49. CTV_RS232_CMD_PCBA_SERIAL_READ = 0x3,
  50. CTV_RS232_CMD_HDCP14_KEY_WRITE = 0x4,
  51. CTV_RS232_CMD_HDCP14_KEY_CRC_READ = 0x5,
  52. CTV_RS232_CMD_HDCP22_KEY_WRITE = 0x6,
  53. CTV_RS232_CMD_HDCP22_KEY_READ = 0x7,
  54. CTV_RS232_CMD_CI_PLUS_KEY_WRITE = 0x8,
  55. CTV_RS232_CMD_CI_PLUS_KEY_CRC_READ = 0x9,
  56. CTV_RS232_CMD_KEY_EVENT = 0xa,
  57. CTV_RS232_CMD_SOURCE_CONTROL = 0xb,
  58. CTV_RS232_CMD_SOURCE_SINGAL_CHECK = 0xc,
  59. CTV_RS232_CMD_CIFUNCTION_CHECK = 0xd,
  60. CTV_RS232_CMD_YPP_ADC_ADJUST = 0xe,
  61. CTV_RS232_CMD_VGA_ADC_ADJUST = 0xf,
  62. CTV_RS232_CMD_BL_ADJMAX = 0x10,
  63. CTV_RS232_CMD_BL_ADJMIN = 0x11,
  64. CTV_RS232_CMD_BL_ADJDEF = 0x12,
  65. CTV_RS232_CMD_KEY_EVENT_IR = 0x13,
  66. CTV_RS232_CMD_PWM_ADJREAD = 0x14,
  67. CTV_RS232_CMD_BURNNING_TIME = 0x15,
  68. CTV_RS232_CMD_VERSION = 0x16,
  69. CTV_RS232_CMD_TEST_RECORD = 0x17,
  70. CTV_RS232_CMD_FAC_MODE_EXIT = 0x18,
  71. CTV_RS232_CMD_FAC_SHIPPING_MODE = 0x19,
  72. CTV_RS232_CMD_FAC_RESSET_ALL = 0x1a,
  73. CTV_RS232_CMD_STORAGE_CHK = 0x1b,
  74. CTV_RS232_CMD_AUDIO_CONTROL_VOL = 0x1c,
  75. CTV_RS232_CMD_LED_CONTROL = 0x1d,
  76. CTV_RS232_CMD_POWER_CONTROL = 0x1e,//not use yet
  77. CTV_RS232_CMD_AUDIO_CONTROL_MUT = 0x1f,
  78. CTV_RS232_CMD_TV_CONTROL_ASC = 0x20,
  79. CTV_RS232_CMD_TV_CONTROL_CAB = 0x21,
  80. CTV_RS232_CMD_TV_CONTROL_CCH = 0x22,
  81. CTV_RS232_CMD_TV_CONTROL_CHU = 0x23,
  82. CTV_RS232_CMD_TV_CONTROL_CHD = 0x24,
  83. CTV_RS232_CMD_OTHER_CONTROL_SLP = 0x25,
  84. CTV_RS232_CMD_OTHER_CONTROL_ASP = 0x26,
  85. CTV_RS232_CMD_OTHER_CONTROL_ECC = 0x27,
  86. CTV_RS232_CMD_KEYPAD_LOCK = 0x28,
  87. CTV_RS232_CMD_DTV_CHANGE_CHANNLE = 0x29,
  88. CTV_RS232_CMD_PANEL_CONTROL,
  89. CTV_RS232_CMD_FAC_RESET,
  90. CTV_RS232_CMD_NUM,
  91. }AccuviewRS232Type;
  92. typedef void (* AccuviewRS232)(al_uint8 eventID, al_uint32 addr);
  93. typedef void (* RS232_IR_CallBack_t)(UINT32 KeyCode, UINT32 KeyValue,UINT8 keyP);
  94. bool con_AccuviewRs232_AutoTest_parser(pCON_DEV pcon, UINT8* msg, UINT8 frameLen);
  95. bool con_AccuviewRs232_Demux_KeyData_Packets(pCON_DEV pcon,UINT8* msg, UINT16 frameLen);
  96. void con_RegAccuviewRs232CallBackFunc(AccuviewRS232 pCallBackFunc);
  97. void con_AccuviewRs232_HeaderParse(unsigned char* buff, unsigned int bufflen, unsigned int *commandlen);
  98. void con_RegAccuviewRs232IR_CallBackFunc(RS232_IR_CallBack_t pfCallBack);
  99. void AccuviewRs232StartTask(void *arg);
  100. /*****************************************************************************
  101. ** FUNCTION : con_AccuviewRs232_CMD_Response
  102. **
  103. ** DESCRIPTION :
  104. ** Response command result to control when app execute funtion.
  105. **
  106. ** PARAMETERS :
  107. ** cmdType : command event type
  108. ** returnValue: result
  109. **
  110. ** RETURN VALUES:
  111. ** None
  112. *****************************************************************************/
  113. void con_AccuviewRs232_CMD_Response(AccuviewRS232Type cmdType, UINT8 returnValue);
  114. /*****************************************************************************
  115. ** FUNCTION : con_AccuviewRs232_IR_Response
  116. **
  117. ** DESCRIPTION :
  118. ** Response ir command to control when app execute funtion.
  119. **
  120. ** PARAMETERS :
  121. ** irEvent -Ir event type
  122. **
  123. **
  124. ** RETURN VALUES:
  125. ** None
  126. *****************************************************************************/
  127. void con_AccuviewRs232_IR_Response(AppGlobalEvent_t irEvent);
  128. #endif