123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- //***************************************************************************
- //!file sk_app_cbus.c
- //!brief Wraps board and device functions for the CBUS component
- // and the application
- //
- //***************************************************************************/
- #include "cbus_debug.h"
- #include "cbus_mid.h"
- #include "cbus_drv.h"
- //#include <linux/string.h>
- typedef enum
- {
- ERRLED_NONE = 0,
- ERRLED_BAD_INIT = 0x06,
- } ErrorLedPatterns_t;
- typedef enum _CBUS_APP_FSM_STATE_e
- {
- CBUS_APP_FSM_UNATTACHED = 0,
- CBUS_APP_FSM_ATTATCHED = 1,
- CBUS_APP_FSM_CONNECTED = 2,
- CBUS_APP_FSM_PATH_ENABLED = 3,
-
- } CBUS_APP_FSM_STATE_e;
- //------------------------------------------------------------------------------
- // Module variables
- //------------------------------------------------------------------------------
- typedef struct
- {
- UINT8 cecCommand; //!< CEC RC command code
- UINT8 rcpKeyCode; //!< RCP CBUS Key Code
- UINT8 rc5KeyCode; //!< RC5 Key Code
- } RcpTranslate_t;
- #if (RCP_DEBUG == 1)
- typedef struct
- {
- UINT8 cecCommand; //!< CEC RC command code
- UINT8 rcpKeyCode; //!< RCP CBUS Key Code
- char rcpName[30];
- } CecRcpConversion_t;
- #endif
- #define CBUS_SRC_POLLING_W1 20 //
- #define CBUS_SRC_WP_WIDTH1 CBUS_SRC_POLLING_W1
- #define CBUS_SRC_WP_WIDTH1_MIN ((CBUS_SRC_WP_WIDTH1 - (CBUS_SRC_WP_WIDTH1 / 20)) - 2) // 5% tolerance
- #define CBUS_SRC_WP_WIDTH1_MAX ((CBUS_SRC_WP_WIDTH1 + (CBUS_SRC_WP_WIDTH1 / 20)) + 2) // 5% tolerance
- #define CBUS_SRC_POLLING_W2 60
- #define CBUS_SRC_WP_WIDTH2 CBUS_SRC_POLLING_W2
- #define CBUS_SRC_WP_WIDTH2_MIN ((CBUS_SRC_WP_WIDTH2 - (CBUS_SRC_WP_WIDTH2 / 20)) - 2) // 5% tolerance
- #define CBUS_SRC_WP_WIDTH2_MAX ((CBUS_SRC_WP_WIDTH2 + (CBUS_SRC_WP_WIDTH2 / 20)) + 2) // 5% tolerance
- #define CBUS_SRC_WP_DISCOVER_MIN 100
- #define CBUS_SRC_WP_DISCOVER_MAX 1000
- #define CBUS_SRC_WP_POLARITY 1
- #define CBUS_SRC_PULSE_MAX 6
- enum
- {
- CBUS_SRC_WAKE_PULSE,
- CBUS_SRC_DISCOVERY_PULSE,
- };
- //------------------------------------------------------------------------------
- // Global Data
- //------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------
- // Function Prototypes
- //-------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------------------------
- //! @brief Monitors device interrupts and notifies components that have received
- //! an interrupt.
- //-------------------------------------------------------------------------------------------------
- void MHLTaskInterruptMonitor(void);
- void CbusAppDeviceInit(void);
- void CbusAppTask(void);
- void MHLTaskCableDetect(BOOL fCdSense);
|