al_console_TpvRs232.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #ifndef __CONSOLE_TPV_RS232_H_
  2. #define __CONSOLE_TPV_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 TPV_RS232_HEAD 0x6E
  9. #define TPV_RW_READ 0x01
  10. #define TPV_RW_WRITE 0x03
  11. #define TPV_PRE2 0xFE
  12. #define TPV_FCode01 0xE1
  13. #define TPV_FCode02 0xE2
  14. #define TPV_FCode03 0xE3
  15. #define TPV_FCode04 0xE4
  16. #define TPV_FCode05 0xE5
  17. #define TPV_FCode06 0xE6
  18. #define TPV_FCode07 0xE7
  19. #define TPV_FCode08 0xE8
  20. #define TPV_FCode09 0xE9
  21. #define TPV_FCode0A 0xEA
  22. #define TPV_FCode0B 0xEB
  23. #define TPV_FCode0C 0xEC
  24. #define TPV_FCode0D 0xED
  25. #define TPV_FCode0E 0xEE
  26. #define TPV_FCode0F 0xEF
  27. #define TPV_FCode10 0xF0
  28. #define TPV_FCode11 0xF1
  29. /*
  30. Frame_Head(2 bytes) Size pre1 pre2 CMD Ext data1 data2 ... checksum
  31. 6E 51 0x80+size 03(R/W) FE XX YY zz ww ... ??
  32. Frame Head:6E 51
  33. eg: checksum:6E XOR 51 XOR 86 XOR 03 XOR FE XOR XX XOR YY XOR ZZ XOR WW X0R ... = ??
  34. */
  35. typedef struct TpvExtCommandFrame_t_{
  36. UINT8 FrameHead1;
  37. UINT8 FrameHead2;
  38. UINT8 CmdSize;//0x80+size,not include checksum
  39. UINT8 Pre1;
  40. UINT8 Pre2;
  41. UINT8 Cmd;
  42. UINT8 ExtByte;
  43. UINT8 *Data;//len = CmdSize - 0x80 - 0x4
  44. UINT8 CheckSum;
  45. }TpvExtCommandFrame_t;
  46. typedef enum{
  47. TpvRsp_State_OK = 0x1,
  48. TpvRsp_State_ERR = 0x2,
  49. TpvRsp_Data = 0x3,
  50. TpvRsp_Data_Invalid = 0x4,
  51. TpvRsp_Need_App_Resp = 0x5,
  52. }eTpvRspType;
  53. typedef enum{
  54. TPV_CMD_Factory_Mode = 0x0,
  55. TPV_CMD_Set_BurnInMode,
  56. TPV_CMD_Set_Smart_Picture_mode,
  57. TPV_CMD_Set_internal_Test_Pattern,
  58. TPV_CMD_Reset_Picture_mode_setting,
  59. TPV_CMD_set_picture_functon,
  60. TPV_CMD_Select_Input_Source,
  61. TPV_CMD_R_Get_WB_Default_Value,
  62. TPV_CMD_NUM_MAX,
  63. }TpvRS232Type;
  64. typedef int (*TpvRs232_autotest_Cbk_pf)(pCON_DEV pcon, UINT8 *msg);
  65. typedef struct TpvRs232_autoest_Cbk_t_
  66. {
  67. TpvRs232_autotest_Cbk_pf pfCallBack;
  68. } TpvRs232_autotest_Cbk_t;
  69. void al_tpvrs232_autotest_init(TpvRs232_autotest_Cbk_t *pConsole_autotest_Cfg);
  70. bool con_TpvRs232_AutoTest_parser(pCON_DEV pcon, UINT8* msg, UINT8 frameLen);
  71. #endif