📄 tmdlhdmitx_cfg.c
字号:
&enableVideoPortRGB444[1][0], /* filled dynamically, do not modify */ &groundVideoPortRGB444[1][0], /* filled dynamically, do not modify */ &enableAudioPortSPDIF[1], &groundAudioPortSPDIF[1], &enableAudioClockPortSPDIF[1], &groundAudioClockPortSPDIF[1], &enableAudioPortI2S[1], &groundAudioPortI2S[1], &enableAudioPortI2S8C[1], &groundAudioPortI2S8C[1], &enableAudioClockPortI2S[1], &groundAudioClockPortI2S[1], &enableAudioPortOBA[1], &groundAudioPortOBA[1], &enableAudioClockPortOBA[1], &groundAudioClockPortOBA[1], &enableAudioPortDST[1], &groundAudioPortDST[1], &enableAudioClockPortDST[1], &groundAudioClockPortDST[1], &enableAudioPortHBR[1], &groundAudioPortHBR[1], &enableAudioClockPortHBR[1], &groundAudioClockPortHBR[1], KEY_SEED, TMDL_HDMITX_PATTERN_BLUE }};#endif /* endif TMFL_OS_WINDOWS *//*============================================================================*//* FUNCTIONS *//*============================================================================*/#if 0/*def TMFL_OS_WINDOWS */ /* OS Windows *//****************************************************************************** \brief Read to BSL driver through I2C bus \param pSysArgs Pointer to the I2C read structure \return The call result: - TM_OK: the call was successful******************************************************************************/tmErrorCode_t windowsI2cReadFunction( tmbslHdmiTxSysArgs_t *pSysArgs){ tmErrorCode_t errCode; errCode = i2cRead(reg_TDA998X, (tmbslHdmiSysArgs_t *) pSysArgs); return errCode;}/****************************************************************************** \brief Write to BSL driver through I2C bus \param pSysArgs Pointer to the I2C write structure \return The call result: - TM_OK: the call was successful******************************************************************************/tmErrorCode_t windowsI2cWriteFunction( tmbslHdmiTxSysArgs_t *pSysArgs){ tmErrorCode_t errCode; errCode = i2cWrite(reg_TDA998X, (tmbslHdmiSysArgs_t *) pSysArgs); return errCode;}#else /* OS ARM7 *//*============================================================================*//****************************************************************************** \brief Write to BSL driver through I2C bus \param pSysArgs Pointer to the I2C read structure \return The call result: - TM_OK: the call was successful******************************************************************************/extern STI2C_Handle_t HDMI_I2C_HANDLER;tmErrorCode_t RtxTxI2cReadFunction(tmbslHdmiTxSysArgs_t *pSysArgs){ tmErrorCode_t errCode; U8 ActLen; STI2C_Read ( HDMI_I2C_HANDLER, pSysArgs->pData, pSysArgs->lenData, 1000, (U32 *)ActLen); return errCode;}/****************************************************************************** \brief Write to BSL driver through I2C bus \param pSysArgs Pointer to the I2C write structure \return The call result: - TM_OK: the call was successful******************************************************************************/tmErrorCode_tRtxTxI2cWriteFunction( tmbslHdmiTxSysArgs_t *pSysArgs){ tmErrorCode_t errCode; U8 ActLen; STI2C_Write( HDMI_I2C_HANDLER, pSysArgs->pData, pSysArgs->lenData, 1000, (U32 *)ActLen); return errCode;}#endif /* endif TMFL_OS_WINDOWS *//************************************************************************************************************************************************************ THIS PART MUST NOT BE MODIFIED BY CUSTOMER ************************************************************************************************************************************************************//****************************************************************************** \brief Generate swap and mirror tables in function of video port mapping tables. \param unit Unit identifier. \return NA.******************************************************************************/static void dlHdmiTxGenerateCfgVideoPortTables( tmUnitSelect_t unit, tmdlHdmiTxDriverConfigTable_t *pConfig){ UInt8 i; for (i=0; i<6; i++) { /* CCIR656 */ if (videoPortMapping_CCIR656[unit][i] != TMDL_HDMITX_VIDCCIR_NOT_CONNECTED) { pConfig->pSwapTableCCIR656[videoPortMapping_CCIR656[unit][i] & 0x07F] = 5-i; pConfig->pMirrorTableCCIR656[videoPortMapping_CCIR656[unit][i] & 0x07F] = (UInt8)(videoPortMapping_CCIR656[unit][i] >> 7); /* Enable port and disable ground port */ if (((5-i) % 2) == 0) { pConfig->pEnableVideoPortCCIR656[i/2] |= 0x0F; pConfig->pGroundVideoPortCCIR656[i/2] &= 0xF0; } else { pConfig->pEnableVideoPortCCIR656[i/2] |= 0xF0; pConfig->pGroundVideoPortCCIR656[i/2] &= 0x0F; } } /* YUV422 */ if (videoPortMapping_YUV422[unit][i] != TMDL_HDMITX_VID422_NOT_CONNECTED) { pConfig->pSwapTableYUV422[videoPortMapping_YUV422[unit][i] & 0x07F] = 5-i; pConfig->pMirrorTableYUV422[videoPortMapping_YUV422[unit][i] & 0x07F] = (UInt8)(videoPortMapping_YUV422[unit][i] >> 7); /* Enable port and disable ground port */ if (((5-i) % 2) == 0) { pConfig->pEnableVideoPortYUV422[i/2] |= 0x0F; pConfig->pGroundVideoPortYUV422[i/2] &= 0xF0; } else { pConfig->pEnableVideoPortYUV422[i/2] |= 0xF0; pConfig->pGroundVideoPortYUV422[i/2] &= 0x0F; } } /* YUV444 */ if (videoPortMapping_YUV444[unit][i] != TMDL_HDMITX_VID444_NOT_CONNECTED) { pConfig->pSwapTableYUV444[videoPortMapping_YUV444[unit][i] & 0x07F] = 5-i; pConfig->pMirrorTableYUV444[videoPortMapping_YUV444[unit][i] & 0x07F] = (UInt8)(videoPortMapping_YUV444[unit][i] >> 7); /* Enable port and disable ground port */ if (((5-i) % 2) == 0) { pConfig->pEnableVideoPortYUV444[i/2] |= 0x0F; pConfig->pGroundVideoPortYUV444[i/2] &= 0xF0; } else { pConfig->pEnableVideoPortYUV444[i/2] |= 0xF0; pConfig->pGroundVideoPortYUV444[i/2] &= 0x0F; } } /* RGB444 */ if (videoPortMapping_RGB444[unit][i] != TMDL_HDMITX_VID444_NOT_CONNECTED) { pConfig->pSwapTableRGB444[videoPortMapping_RGB444[unit][i] & 0x07F] = 5-i; pConfig->pMirrorTableRGB444[videoPortMapping_RGB444[unit][i] & 0x07F] = (UInt8)(videoPortMapping_RGB444[unit][i] >> 7); /* Enable port and disable ground port */ if (((5-i) % 2) == 0) { pConfig->pEnableVideoPortRGB444[i/2] |= 0x0F; pConfig->pGroundVideoPortRGB444[i/2] &= 0xF0; } else { pConfig->pEnableVideoPortRGB444[i/2] |= 0xF0; pConfig->pGroundVideoPortRGB444[i/2] &= 0x0F; } } }}/****************************************************************************** \brief This function allows to the main driver to retrieve its configuration parameters. \param pConfig Pointer to the config structure \return The call result: - TM_OK: the call was successful - TMDL_ERR_DLHDMITX_BAD_UNIT_NUMBER: the unit number is wrong or the receiver instance is not initialised - TMDL_ERR_DLHDMITX_INCONSISTENT_PARAMS: an input parameter is inconsistent******************************************************************************/tmErrorCode_t tmdlHdmiTxCfgGetConfig( tmUnitSelect_t unit, tmdlHdmiTxDriverConfigTable_t *pConfig){ /* Check if unit number is in range */ RETIF((unit < 0) || (unit >= MAX_UNITS), TMDL_ERR_DLHDMITX_BAD_UNIT_NUMBER) /* Check if pointer is Null */ RETIF(pConfig == Null, TMDL_ERR_DLHDMITX_INCONSISTENT_PARAMS) *pConfig = driverConfigTableTx[unit]; /* Done here because of const declaration of tables in ARM7 case */ pConfig->pResolutionInfo = (ptmdlHdmiTxCfgResolution_t)resolutionInfoTx; /* Generate swap and mirror tables in function of video port mapping tables */ dlHdmiTxGenerateCfgVideoPortTables(unit, pConfig); return TM_OK;}/****************************************************************************** \brief Driver callback function for i2c EDID read (REQUIRED SW INTERFACE) \param \param \return The call result: TM_OK: the call was successfull TMBSL_ERR_HDMI_I2C_READ: failed when reading the I2C bus ******************************************************************************/tmErrorCode_t edidReadFunction (tmbslHdmiTxSysArgsEdid_t *pSysArgs){ UInt8 seg_address = pSysArgs->segPtrAddr; UInt8 segptr = pSysArgs->segPtr; UInt8 data_address = pSysArgs->dataRegAddr; UInt8 offset = pSysArgs->wordOffset; UInt8 *ptr = pSysArgs->pData; UInt8 nb_char = pSysArgs->lenData; UInt8 i=0; tmErrorCode_t Err; do { Err = 0;/*(STI2c(seg_address, segptr, data_address, offset, nb_char, ptr))? TMBSL_ERR_HDMI_I2C_READ : TM_OK;*/ i++; } while ( (Err != TM_OK) && (i<3) ); return Err;}/*============================================================================*//* END OF FILE *//*============================================================================*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -