cbus_app.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. //***************************************************************************
  2. //!file sk_app_cbus.c
  3. //!brief Wraps board and device functions for the CBUS component
  4. // and the application
  5. //
  6. //***************************************************************************/
  7. #include "cbus_debug.h"
  8. #include "cbus_mid.h"
  9. #include "cbus_drv.h"
  10. //#include <linux/string.h>
  11. typedef enum
  12. {
  13. ERRLED_NONE = 0,
  14. ERRLED_BAD_INIT = 0x06,
  15. } ErrorLedPatterns_t;
  16. typedef enum _CBUS_APP_FSM_STATE_e
  17. {
  18. CBUS_APP_FSM_UNATTACHED = 0,
  19. CBUS_APP_FSM_ATTATCHED = 1,
  20. CBUS_APP_FSM_CONNECTED = 2,
  21. CBUS_APP_FSM_PATH_ENABLED = 3,
  22. } CBUS_APP_FSM_STATE_e;
  23. //------------------------------------------------------------------------------
  24. // Module variables
  25. //------------------------------------------------------------------------------
  26. typedef struct
  27. {
  28. UINT8 cecCommand; //!< CEC RC command code
  29. UINT8 rcpKeyCode; //!< RCP CBUS Key Code
  30. UINT8 rc5KeyCode; //!< RC5 Key Code
  31. } RcpTranslate_t;
  32. #if (RCP_DEBUG == 1)
  33. typedef struct
  34. {
  35. UINT8 cecCommand; //!< CEC RC command code
  36. UINT8 rcpKeyCode; //!< RCP CBUS Key Code
  37. char rcpName[30];
  38. } CecRcpConversion_t;
  39. #endif
  40. #define CBUS_SRC_POLLING_W1 20 //
  41. #define CBUS_SRC_WP_WIDTH1 CBUS_SRC_POLLING_W1
  42. #define CBUS_SRC_WP_WIDTH1_MIN ((CBUS_SRC_WP_WIDTH1 - (CBUS_SRC_WP_WIDTH1 / 20)) - 2) // 5% tolerance
  43. #define CBUS_SRC_WP_WIDTH1_MAX ((CBUS_SRC_WP_WIDTH1 + (CBUS_SRC_WP_WIDTH1 / 20)) + 2) // 5% tolerance
  44. #define CBUS_SRC_POLLING_W2 60
  45. #define CBUS_SRC_WP_WIDTH2 CBUS_SRC_POLLING_W2
  46. #define CBUS_SRC_WP_WIDTH2_MIN ((CBUS_SRC_WP_WIDTH2 - (CBUS_SRC_WP_WIDTH2 / 20)) - 2) // 5% tolerance
  47. #define CBUS_SRC_WP_WIDTH2_MAX ((CBUS_SRC_WP_WIDTH2 + (CBUS_SRC_WP_WIDTH2 / 20)) + 2) // 5% tolerance
  48. #define CBUS_SRC_WP_DISCOVER_MIN 100
  49. #define CBUS_SRC_WP_DISCOVER_MAX 1000
  50. #define CBUS_SRC_WP_POLARITY 1
  51. #define CBUS_SRC_PULSE_MAX 6
  52. enum
  53. {
  54. CBUS_SRC_WAKE_PULSE,
  55. CBUS_SRC_DISCOVERY_PULSE,
  56. };
  57. //------------------------------------------------------------------------------
  58. // Global Data
  59. //------------------------------------------------------------------------------
  60. //-------------------------------------------------------------------------------
  61. // Function Prototypes
  62. //-------------------------------------------------------------------------------
  63. //-------------------------------------------------------------------------------------------------
  64. //! @brief Monitors device interrupts and notifies components that have received
  65. //! an interrupt.
  66. //-------------------------------------------------------------------------------------------------
  67. void MHLTaskInterruptMonitor(void);
  68. void CbusAppDeviceInit(void);
  69. void CbusAppTask(void);
  70. void MHLTaskCableDetect(BOOL fCdSense);