cbus_drv_internal.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. //***************************************************************************
  2. //!file cbus_drv_internal.h
  3. //!brief CBUS Component.
  4. //
  5. //***************************************************************************/
  6. #ifndef __DRV_CBUS_INTERNAL_H__
  7. #define __DRV_CBUS_INTERNAL_H__
  8. #include "cbus_enums.h"
  9. //------------------------------------------------------------------------------
  10. // CBUS Component Manifest Constants
  11. //------------------------------------------------------------------------------
  12. #define MHL_MSC_SUB_CMD_MAX_SIZE 10
  13. //------------------------------------------------------------------------------
  14. // API typedefs
  15. //------------------------------------------------------------------------------
  16. //------------------------------------------------------------------------------
  17. //
  18. // MHL Specs defined registers in device capability set
  19. //
  20. //
  21. typedef struct {
  22. unsigned char mhl_devcap_version; // 0x00
  23. unsigned char mhl_devcap_cbus_version; // 0x01
  24. unsigned char mhl_devcap_device_category; // 0x02
  25. unsigned char mhl_devcap_power_supply_capacity; // 0x03
  26. unsigned char mhl_devcap_power_supply_provided; // 0x04
  27. unsigned char mhl_devcap_video_link_mode_support; // 0x05
  28. unsigned char mhl_devcap_audio_link_mode_support; // 0x06
  29. unsigned char mhl_devcap_hdcp_status; // 0x07
  30. unsigned char mhl_devcap_logical_device_map; // 0x08
  31. unsigned char mhl_devcap_link_bandwidth_limit; // 0x09
  32. unsigned char mhl_devcap_reserved_1; // 0x0a
  33. unsigned char mhl_devcap_reserved_2; // 0x0b
  34. unsigned char mhl_devcap_reserved_3; // 0x0c
  35. unsigned char mhl_devcap_scratchpad_size; // 0x0d
  36. unsigned char mhl_devcap_interrupt_size; // 0x0e
  37. unsigned char mhl_devcap_devcap_size; // 0x0f
  38. } mhl_devcap_t;
  39. //------------------------------------------------------------------------------
  40. //
  41. // MHL Specs defined registers for interrupts
  42. //
  43. //
  44. typedef struct {
  45. unsigned char mhl_intr_0; // 0x00
  46. unsigned char mhl_intr_1; // 0x01
  47. unsigned char mhl_intr_2; // 0x02
  48. unsigned char mhl_intr_3; // 0x03
  49. } mhl_interrupt_t;
  50. //------------------------------------------------------------------------------
  51. //
  52. // MHL Specs defined registers for status
  53. //
  54. //
  55. typedef struct {
  56. unsigned char mhl_status_0; // 0x00
  57. unsigned char mhl_status_1; // 0x01
  58. unsigned char mhl_status_2; // 0x02
  59. unsigned char mhl_status_3; // 0x03
  60. } mhl_status_t;
  61. //------------------------------------------------------------------------------
  62. //
  63. // MHL Specs defined registers for local scratchpad registers
  64. //
  65. //
  66. typedef struct {
  67. unsigned char mhl_scratchpad[16];
  68. } mhl_scratchpad_t;
  69. //------------------------------------------------------------------------------
  70. // CBUS Component Data
  71. //------------------------------------------------------------------------------
  72. //------------------------------------------------------------------------------
  73. // CBUS Driver Instance Data
  74. //------------------------------------------------------------------------------
  75. typedef struct
  76. {
  77. UINT8 bCmdType[MHL_MSC_SUB_CMD_MAX_SIZE]; //RCP, RAP or UCP
  78. UINT8 bData[MHL_MSC_SUB_CMD_MAX_SIZE]; //received commands
  79. UINT8 bSize; //the size of unhandled commands
  80. UINT8 bStartIndex; //the index of the oldest received and unhandled commands
  81. UINT8 bEndIndex; //the index of the lastest received and unhandled commands
  82. BOOL bLock; //for race condition
  83. }CbusMscSubCmd_t;
  84. //------------------------------------------------------------------------------
  85. // Driver internal functions
  86. //------------------------------------------------------------------------------
  87. //------------------------------------------------------------------------------
  88. // Function: CbusDrvProcessInterrupts
  89. // Description: Check CBUS registers for a CBUS event
  90. //------------------------------------------------------------------------------
  91. void CbusDrvProcessInterrupts ( void );
  92. #endif // __SI_DRV_CBUS_INTERNAL_H__