本文整理汇总了C++中DVBT_DEMOD_MODULE::SetRegBitsWithPage方法的典型用法代码示例。如果您正苦于以下问题:C++ DVBT_DEMOD_MODULE::SetRegBitsWithPage方法的具体用法?C++ DVBT_DEMOD_MODULE::SetRegBitsWithPage怎么用?C++ DVBT_DEMOD_MODULE::SetRegBitsWithPage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DVBT_DEMOD_MODULE
的用法示例。
在下文中一共展示了DVBT_DEMOD_MODULE::SetRegBitsWithPage方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/**
@see DVBT_NIM_FP_UPDATE_FUNCTION
*/
int
rtl2832_fc0013_UpdateFunction(
DVBT_NIM_MODULE *pNim
)
{
DVBT_DEMOD_MODULE *pDemod;
RTL2832_FC0013_EXTRA_MODULE *pNimExtra;
// Get demod module.
pDemod = pNim->pDemod;
// Get NIM extra module.
pNimExtra = &(pNim->Extra.Rtl2832Fc0013);
// Update demod particular registers.
if(pDemod->UpdateFunction(pDemod) != FUNCTION_SUCCESS)
goto error_status_execute_function;
// Increase tuner LNA_GAIN update waiting time.
pNimExtra->LnaUpdateWaitTime += 1;
// Check if need to update tuner LNA_GAIN according to update waiting time.
if(pNimExtra->LnaUpdateWaitTime == pNimExtra->LnaUpdateWaitTimeMax)
{
// Reset update waiting time.
pNimExtra->LnaUpdateWaitTime = 0;
// Enable demod DVBT_IIC_REPEAT.
if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS)
goto error_status_set_registers;
// Update tuner LNA gain with RSSI.
if(rtl2832_fc0013_UpdateTunerLnaGainWithRssi(pNim) != FUNCTION_SUCCESS)
goto error_status_execute_function;
// Disable demod DVBT_IIC_REPEAT.
if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS)
goto error_status_set_registers;
}
return FUNCTION_SUCCESS;
error_status_set_registers:
error_status_execute_function:
return FUNCTION_ERROR;
}
开发者ID:BalintBanyasz,项目名称:DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0,代码行数:57,代码来源:nim_rtl2832_fc0013.c
示例2: demod_pdcontrol_reset
UData_t demod_pdcontrol_reset(handle_t demod_handle, handle_t tuner_handle, uint8_t *agc_current_state) {
DVBT_DEMOD_MODULE *pDemod;
unsigned long BinaryValue;
// Get demod module.
pDemod = (DVBT_DEMOD_MODULE *)demod_handle;
// Reset AGC current state.
*agc_current_state = AGC_STATE_START;
// Calculate RTL2832_MT2266_IF_AGC_MIN_INT_MIN binary value.
BinaryValue = SignedIntToBin(RTL2832_MT2266_IF_AGC_MIN_INT_MIN, RTL2832_MT2266_IF_AGC_MIN_BIT_NUM);
// Set IF_AGC_MIN with binary value.
if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IF_AGC_MIN, BinaryValue) != FUNCTION_SUCCESS)
goto error_status_set_registers;
// Set tuner bandwidth with normal setting.
if(MT_IS_ERROR(tuner_set_bw_normal(tuner_handle, demod_handle)))
goto error_status_set_tuner_bandwidth;
return MT_OK;
error_status_set_tuner_bandwidth:
error_status_set_registers:
return MT_COMM_ERR;
}
示例3: BinToSignedInt
UData_t
demod_set_bbagclim(
handle_t demod_handle,
int on_off_status
)
{
DVBT_DEMOD_MODULE *pDemod;
unsigned long IfAgcMinBinary;
long IfAgcMinInt;
// Get demod module.
pDemod = (DVBT_DEMOD_MODULE *)demod_handle;
// Get IF_AGC_MIN binary value.
if(pDemod->GetRegBitsWithPage(pDemod, DVBT_IF_AGC_MIN, &IfAgcMinBinary) != FUNCTION_SUCCESS)
goto error_status_get_registers;
// Convert IF_AGC_MIN binary value to integer.
IfAgcMinInt = BinToSignedInt(IfAgcMinBinary, RTL2832_MT2266_IF_AGC_MIN_BIT_NUM);
// Modify IF_AGC_MIN integer according to on_off_status.
switch(on_off_status)
{
case 1:
IfAgcMinInt += RTL2832_MT2266_IF_AGC_MIN_INT_STEP;
if(IfAgcMinInt > RTL2832_MT2266_IF_AGC_MIN_INT_MAX)
IfAgcMinInt = RTL2832_MT2266_IF_AGC_MIN_INT_MAX;
break;
default:
case 0:
IfAgcMinInt -= RTL2832_MT2266_IF_AGC_MIN_INT_STEP;
if(IfAgcMinInt < RTL2832_MT2266_IF_AGC_MIN_INT_MIN)
IfAgcMinInt = RTL2832_MT2266_IF_AGC_MIN_INT_MIN;
break;
}
// Convert modified IF_AGC_MIN integer to binary value.
IfAgcMinBinary = SignedIntToBin(IfAgcMinInt, RTL2832_MT2266_IF_AGC_MIN_BIT_NUM);
// Set IF_AGC_MIN with modified binary value.
if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IF_AGC_MIN, IfAgcMinBinary) != FUNCTION_SUCCESS)
goto error_status_set_registers;
return MT_OK;
error_status_set_registers:
error_status_get_registers:
return MT_COMM_ERR;
}
示例4:
/**
@see DVBT_NIM_FP_SET_PARAMETERS
*/
int
rtl2832_fc2580_SetParameters(
DVBT_NIM_MODULE *pNim,
unsigned long RfFreqHz,
int BandwidthMode
)
{
TUNER_MODULE *pTuner;
DVBT_DEMOD_MODULE *pDemod;
FC2580_EXTRA_MODULE *pTunerExtra;
int TunerBandwidthMode;
// Get tuner module and demod module.
pTuner = pNim->pTuner;
pDemod = pNim->pDemod;
// Get tuner extra module.
pTunerExtra = (FC2580_EXTRA_MODULE *)pTuner->pExtra;
// Enable demod DVBT_IIC_REPEAT.
if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS)
goto error_status_set_registers;
// Set tuner RF frequency in Hz.
if(pTuner->SetRfFreqHz(pTuner, RfFreqHz) != FUNCTION_SUCCESS)
goto error_status_execute_function;
// Determine TunerBandwidthMode according to bandwidth mode.
switch(BandwidthMode)
{
default:
case DVBT_BANDWIDTH_6MHZ: TunerBandwidthMode = FC2580_BANDWIDTH_6000000HZ; break;
case DVBT_BANDWIDTH_7MHZ: TunerBandwidthMode = FC2580_BANDWIDTH_7000000HZ; break;
case DVBT_BANDWIDTH_8MHZ: TunerBandwidthMode = FC2580_BANDWIDTH_8000000HZ; break;
}
// Set tuner bandwidth mode with TunerBandwidthMode.
if(pTunerExtra->SetBandwidthMode(pTuner, TunerBandwidthMode) != FUNCTION_SUCCESS)
goto error_status_execute_function;
// Disable demod DVBT_IIC_REPEAT.
if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS)
goto error_status_set_registers;
// Set demod bandwidth mode.
if(pDemod->SetBandwidthMode(pDemod, BandwidthMode) != FUNCTION_SUCCESS)
goto error_status_execute_function;
// Reset demod particular registers.
if(pDemod->ResetFunction(pDemod) != FUNCTION_SUCCESS)
goto error_status_execute_function;
// Reset demod by software reset.
if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS)
goto error_status_execute_function;
return FUNCTION_SUCCESS;
error_status_execute_function:
error_status_set_registers:
return FUNCTION_ERROR;
}
示例5:
/**
@see DVBT_NIM_FP_SET_PARAMETERS
*/
s32
rtl2832_tda18272_SetParameters(
DVBT_NIM_MODULE *pNim,
u64 RfFreqHz,
s32 BandwidthMode
)
{
TUNER_MODULE *pTuner;
DVBT_DEMOD_MODULE *pDemod;
TDA18272_EXTRA_MODULE *pTunerExtra;
s32 TunerStandardBandwidthMode;
u64 IfFreqHz;
// Get tuner module and demod module.
pTuner = pNim->pTuner;
pDemod = pNim->pDemod;
// Get tuner extra module.
pTunerExtra = &(pTuner->Extra.Tda18272);
// Enable demod DVBT_IIC_REPEAT.
if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS)
goto error_status_set_registers;
// Determine TunerBandwidthMode according to bandwidth mode.
switch(BandwidthMode)
{
default:
case DVBT_BANDWIDTH_6MHZ: TunerStandardBandwidthMode = TDA18272_STANDARD_BANDWIDTH_DVBT_6MHZ; break;
case DVBT_BANDWIDTH_7MHZ: TunerStandardBandwidthMode = TDA18272_STANDARD_BANDWIDTH_DVBT_7MHZ; break;
case DVBT_BANDWIDTH_8MHZ: TunerStandardBandwidthMode = TDA18272_STANDARD_BANDWIDTH_DVBT_8MHZ; break;
}
// Set tuner standard and bandwidth mode with TunerStandardBandwidthMode.
if(pTunerExtra->SetStandardBandwidthMode(pTuner, TunerStandardBandwidthMode) != FUNCTION_SUCCESS)
goto error_status_execute_function;
// Set tuner RF frequency in Hz.
// Note: Must run SetRfFreqHz() after SetStandardBandwidthMode(), because SetRfFreqHz() needs some
// SetStandardBandwidthMode() information.
if(pTuner->SetRfFreqHz(pTuner, RfFreqHz) != FUNCTION_SUCCESS)
goto error_status_execute_function;
// Get tuner IF frequency in Hz.
// Note: 1. Must run GetIfFreqHz() after SetRfFreqHz(), because GetIfFreqHz() needs some SetRfFreqHz() information.
// 2. TDA18272 tuner uses dynamic IF frequency.
if(pTunerExtra->GetIfFreqHz(pTuner, &IfFreqHz) != FUNCTION_SUCCESS)
goto error_status_execute_function;
// Disable demod DVBT_IIC_REPEAT.
if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS)
goto error_status_set_registers;
// Set demod IF frequency according to IfFreqHz.
// Note: TDA18272 tuner uses dynamic IF frequency.
if(pDemod->SetIfFreqHz(pDemod, IfFreqHz) != FUNCTION_SUCCESS)
goto error_status_execute_function;
// Set demod bandwidth mode.
if(pDemod->SetBandwidthMode(pDemod, BandwidthMode) != FUNCTION_SUCCESS)
goto error_status_execute_function;
// Reset demod particular registers.
if(pDemod->ResetFunction(pDemod) != FUNCTION_SUCCESS)
goto error_status_execute_function;
// Reset demod by software reset.
if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS)
goto error_status_execute_function;
return FUNCTION_SUCCESS;
error_status_execute_function:
error_status_set_registers:
return FUNCTION_ERROR;
}
示例6:
/**
@see DVBT_NIM_FP_INITIALIZE
*/
int
rtl2832_max3543_Initialize(
DVBT_NIM_MODULE *pNim
)
{
typedef struct
{
int RegBitName;
unsigned long Value;
}
REG_VALUE_ENTRY;
static const REG_VALUE_ENTRY AdditionalInitRegValueTable[RTL2832_MAX3543_ADDITIONAL_INIT_REG_TABLE_LEN] =
{
// RegBitName, Value
{DVBT_DAGC_TRG_VAL, 0x39 },
{DVBT_AGC_TARG_VAL_0, 0x0 },
{DVBT_AGC_TARG_VAL_8_1, 0x4b },
{DVBT_AAGC_LOOP_GAIN, 0x16 },
{DVBT_LOOP_GAIN2_3_0, 0x6 },
{DVBT_LOOP_GAIN2_4, 0x1 },
{DVBT_LOOP_GAIN3, 0x16 },
{DVBT_VTOP1, 0x35 },
{DVBT_VTOP2, 0x21 },
{DVBT_VTOP3, 0x21 },
{DVBT_KRF1, 0x0 },
{DVBT_KRF2, 0x40 },
{DVBT_KRF3, 0x10 },
{DVBT_KRF4, 0x10 },
{DVBT_IF_AGC_MIN, 0x80 },
{DVBT_IF_AGC_MAX, 0x7f },
{DVBT_RF_AGC_MIN, 0x80 },
{DVBT_RF_AGC_MAX, 0x7f },
{DVBT_POLAR_RF_AGC, 0x0 },
{DVBT_POLAR_IF_AGC, 0x0 },
{DVBT_AD7_SETTING, 0xe9d4 },
{DVBT_AD_EN_REG1, 0x0 },
{DVBT_CKOUT_PWR_PID, 0x0 },
};
TUNER_MODULE *pTuner;
DVBT_DEMOD_MODULE *pDemod;
int i;
int RegBitName;
unsigned long Value;
// Get tuner module and demod module.
pTuner = pNim->pTuner;
pDemod = pNim->pDemod;
// Enable demod DVBT_IIC_REPEAT.
if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS)
goto error_status_set_registers;
// Initialize tuner.
if(pTuner->Initialize(pTuner) != FUNCTION_SUCCESS)
goto error_status_execute_function;
// Disable demod DVBT_IIC_REPEAT.
if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS)
goto error_status_set_registers;
// Initialize demod.
if(pDemod->Initialize(pDemod) != FUNCTION_SUCCESS)
goto error_status_execute_function;
// Set demod IF frequency with NIM default.
if(pDemod->SetIfFreqHz(pDemod, RTL2832_MAX3543_IF_FREQ_HZ_DEFAULT) != FUNCTION_SUCCESS)
goto error_status_execute_function;
// Set demod spectrum mode with NIM default.
if(pDemod->SetSpectrumMode(pDemod, RTL2832_MAX3543_SPECTRUM_MODE_DEFAULT) != FUNCTION_SUCCESS)
goto error_status_execute_function;
// Set demod registers.
for(i = 0; i < RTL2832_MAX3543_ADDITIONAL_INIT_REG_TABLE_LEN; i++)
{
// Get register bit name and its value.
RegBitName = AdditionalInitRegValueTable[i].RegBitName;
Value = AdditionalInitRegValueTable[i].Value;
// Set demod registers
if(pDemod->SetRegBitsWithPage(pDemod, RegBitName, Value) != FUNCTION_SUCCESS)
goto error_status_set_registers;
}
//.........这里部分代码省略.........
示例7:
/**
@see DVBT_NIM_FP_UPDATE_FUNCTION
*/
int
rtl2832_mt2266_UpdateFunction(
DVBT_NIM_MODULE *pNim
)
{
TUNER_MODULE *pTuner;
DVBT_DEMOD_MODULE *pDemod;
MT2266_EXTRA_MODULE *pMt2266Extra;
RTL2832_MT2266_EXTRA_MODULE *pRtl2832Mt2266Extra;
Handle_t Mt2266Handle;
UData_t Status;
// Get tuner module and demod module.
pTuner = pNim->pTuner;
pDemod = pNim->pDemod;
// Get tuner extra module and tuner handle.
pMt2266Extra = (MT2266_EXTRA_MODULE *)pTuner->pExtra;
pMt2266Extra->GetHandle(pTuner, &Mt2266Handle);
// Get NIM extra module.
pRtl2832Mt2266Extra = (RTL2832_MT2266_EXTRA_MODULE *)pNim->pExtra;
// Update demod particular registers.
if(pDemod->UpdateFunction(pDemod) != FUNCTION_SUCCESS)
goto error_status_execute_function;
// Enable demod DVBT_IIC_REPEAT.
if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS)
goto error_status_set_registers;
// Update demod and tuner register setting.
Status = demod_pdcontrol(
pDemod,
Mt2266Handle,
&pRtl2832Mt2266Extra->LnaConfig,
&pRtl2832Mt2266Extra->UhfSens,
&pRtl2832Mt2266Extra->AgcCurrentState,
(uint32_t *)&pRtl2832Mt2266Extra->LnaGainOld
);
if(MT_IS_ERROR(Status))
goto error_status_execute_function;
// Disable demod DVBT_IIC_REPEAT.
if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS)
goto error_status_set_registers;
return FUNCTION_SUCCESS;
error_status_execute_function:
error_status_set_registers:
return FUNCTION_ERROR;
}
示例8:
/**
@see DVBT_NIM_FP_UPDATE_FUNCTION
*/
int
rtl2832_mt2266_UpdateFunction(
DVBT_NIM_MODULE *pNim
)
{
TUNER_MODULE *pTuner;
DVBT_DEMOD_MODULE *pDemod;
MT2266_EXTRA_MODULE *pTunerExtra;
RTL2832_MT2266_EXTRA_MODULE *pNimExtra;
Handle_t Mt2266Handle;
UData_t Status;
// Get tuner module and demod module.
pTuner = pNim->pTuner;
pDemod = pNim->pDemod;
// Get tuner extra module and tuner handle.
pTunerExtra = &(pTuner->Extra.Mt2266);
pTunerExtra->GetHandle(pTuner, &Mt2266Handle);
// Get NIM extra module.
pNimExtra = &(pNim->Extra.Rtl2832Mt2266);
// Update demod particular registers.
if(pDemod->UpdateFunction(pDemod) != FUNCTION_SUCCESS)
goto error_status_execute_function;
// Enable demod DVBT_IIC_REPEAT.
if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS)
goto error_status_set_registers;
// Update demod and tuner register setting.
Status = demod_pdcontrol(
pDemod,
Mt2266Handle,
&pNimExtra->LnaConfig,
&pNimExtra->UhfSens,
&pNimExtra->AgcCurrentState,
&pNimExtra->LnaGainOld
);
/*
handle_t demod_handle,
handle_t tuner_handle,
unsigned char* lna_config,
unsigned char* uhf_sens,
unsigned char *agc_current_state,
unsigned long *lna_gain_old
unsigned char LnaConfig;
unsigned char UhfSens;
unsigned char AgcCurrentState;
unsigned long LnaGainOld;
*/
if(MT_IS_ERROR(Status))
goto error_status_execute_function;
// Disable demod DVBT_IIC_REPEAT.
if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS)
goto error_status_set_registers;
return FUNCTION_SUCCESS;
error_status_execute_function:
error_status_set_registers:
return FUNCTION_ERROR;
}
示例9:
/**
@see DVBT_NIM_FP_INITIALIZE
*/
int
rtl2832_r820t_Initialize(
DVBT_NIM_MODULE *pNim
)
{
typedef struct
{
int RegBitName;
unsigned long Value;
}
REG_VALUE_ENTRY;
static const REG_VALUE_ENTRY AdditionalInitRegValueTable[RTL2832_R820T_ADDITIONAL_INIT_REG_TABLE_LEN] =
{
// RegBitName, Value
{DVBT_DAGC_TRG_VAL, 0x39 },
{DVBT_AGC_TARG_VAL_0, 0x0 },
{DVBT_AGC_TARG_VAL_8_1, 0x40 },
{DVBT_AAGC_LOOP_GAIN, 0x16 },
{DVBT_LOOP_GAIN2_3_0, 0x8 },
{DVBT_LOOP_GAIN2_4, 0x1 },
{DVBT_LOOP_GAIN3, 0x18 },
{DVBT_VTOP1, 0x35 },
{DVBT_VTOP2, 0x21 },
{DVBT_VTOP3, 0x21 },
{DVBT_KRF1, 0x0 },
{DVBT_KRF2, 0x40 },
{DVBT_KRF3, 0x10 },
{DVBT_KRF4, 0x10 },
{DVBT_IF_AGC_MIN, 0x80 },
{DVBT_IF_AGC_MAX, 0x7f },
{DVBT_RF_AGC_MIN, 0x80 },
{DVBT_RF_AGC_MAX, 0x7f },
{DVBT_POLAR_RF_AGC, 0x0 },
{DVBT_POLAR_IF_AGC, 0x0 },
{DVBT_AD7_SETTING, 0xe9f4 },
};
TUNER_MODULE *pTuner;
DVBT_DEMOD_MODULE *pDemod;
int i;
int RegBitName;
unsigned long Value;
// Get tuner module and demod module.
pTuner = pNim->pTuner;
pDemod = pNim->pDemod;
// Enable demod DVBT_IIC_REPEAT.
if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS)
goto error_status_set_registers;
// Initialize tuner.
if(pTuner->Initialize(pTuner) != FUNCTION_SUCCESS)
goto error_status_execute_function;
// Disable demod DVBT_IIC_REPEAT.
if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS)
goto error_status_set_registers;
// Initialize demod.
if(pDemod->Initialize(pDemod) != FUNCTION_SUCCESS)
goto error_status_execute_function;
// Set demod spectrum mode with SPECTRUM_INVERSE.
if(pDemod->SetSpectrumMode(pDemod, SPECTRUM_INVERSE) != FUNCTION_SUCCESS)
goto error_status_execute_function;
// Set demod registers.
for(i = 0; i < RTL2832_R820T_ADDITIONAL_INIT_REG_TABLE_LEN; i++)
{
// Get register bit name and its value.
RegBitName = AdditionalInitRegValueTable[i].RegBitName;
Value = AdditionalInitRegValueTable[i].Value;
// Set demod registers
if(pDemod->SetRegBitsWithPage(pDemod, RegBitName, Value) != FUNCTION_SUCCESS)
goto error_status_set_registers;
}
// Reset demod by software reset.
if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS)
goto error_status_execute_function;
return FUNCTION_SUCCESS;
//.........这里部分代码省略.........