本文整理汇总了C++中TUNER_MODULE::GetDeviceAddr方法的典型用法代码示例。如果您正苦于以下问题:C++ TUNER_MODULE::GetDeviceAddr方法的具体用法?C++ TUNER_MODULE::GetDeviceAddr怎么用?C++ TUNER_MODULE::GetDeviceAddr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TUNER_MODULE
的用法示例。
在下文中一共展示了TUNER_MODULE::GetDeviceAddr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//UINT32 MxL_I2C_Read(UINT8 DeviceAddr, UINT8 Addr, UINT8* mData)
UINT32 MxL_I2C_Read(MxL5007_TunerConfigS* myTuner, UINT8 Addr, UINT8* mData)
{
TUNER_MODULE *pTuner;
I2C_BRIDGE_MODULE *pI2cBridge;
unsigned char DeviceAddr;
unsigned char Buffer[LEN_2_BYTE];
// Get tuner module and I2C bridge.
pTuner = myTuner->pTuner;
pI2cBridge = pTuner->pI2cBridge;
// Get tuner device address.
pTuner->GetDeviceAddr(pTuner, &DeviceAddr);
// Set tuner register reading address.
// Note: The I2C format of tuner register reading address setting is as follows:
// start_bit + (DeviceAddr | writing_bit) + 0xfb + RegReadingAddr + stop_bit
Buffer[0] = (unsigned char)MXL5007T_I2C_READING_CONST;
Buffer[1] = (unsigned char)Addr;
if(pI2cBridge->ForwardI2cWritingCmd(pI2cBridge, DeviceAddr, Buffer, LEN_2_BYTE) != FUNCTION_SUCCESS)
goto error_status_set_tuner_register_reading_address;
// Get tuner register bytes.
// Note: The I2C format of tuner register byte getting is as follows:
// start_bit + (DeviceAddr | reading_bit) + reading_byte + stop_bit
if(pI2cBridge->ForwardI2cReadingCmd(pI2cBridge, DeviceAddr, Buffer, LEN_1_BYTE) != FUNCTION_SUCCESS)
goto error_status_get_tuner_registers;
*mData = (UINT8)Buffer[0];
return MxL_OK;
error_status_get_tuner_registers:
error_status_set_tuner_register_reading_address:
return MxL_ERR_OTHERS;
}
开发者ID:BalintBanyasz,项目名称:DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0,代码行数:42,代码来源:tuner_mxl5007t.c