本文整理汇总了C++中DVBT_DEMOD_MODULE类的典型用法代码示例。如果您正苦于以下问题:C++ DVBT_DEMOD_MODULE类的具体用法?C++ DVBT_DEMOD_MODULE怎么用?C++ DVBT_DEMOD_MODULE使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DVBT_DEMOD_MODULE类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dvbt_nim_default_GetParameters
/**
@see DVBT_NIM_FP_GET_PARAMETERS
*/
s32
dvbt_nim_default_GetParameters(
DVBT_NIM_MODULE *pNim,
u64 *pRfFreqHz,
s32 *pBandwidthMode
)
{
TUNER_MODULE *pTuner;
DVBT_DEMOD_MODULE *pDemod;
// Get tuner module and demod module.
pTuner = pNim->pTuner;
pDemod = pNim->pDemod;
// Get tuner RF frequency in Hz.
if(pTuner->GetRfFreqHz(pTuner, pRfFreqHz) != FUNCTION_SUCCESS)
goto error_status_execute_function;
// Get demod bandwidth mode.
if(pDemod->GetBandwidthMode(pDemod, pBandwidthMode) != FUNCTION_SUCCESS)
goto error_status_execute_function;
return FUNCTION_SUCCESS;
error_status_execute_function:
return FUNCTION_ERROR;
}
示例2: rtl2832_tda18272_GetRfPowerLevelDbm
/**
@see DVBT_NIM_FP_GET_RF_POWER_LEVEL_DBM
*/
s32 rtl2832_tda18272_GetRfPowerLevelDbm(DVBT_NIM_MODULE *pNim, s64 *pRfPowerLevelDbm)
{
DVBT_DEMOD_MODULE *pDemod;
u64 FsmStage;
s64 IfAgc;
// Get demod module.
pDemod = pNim->pDemod;
// Get FSM stage and IF AGC value.
if(pDemod->GetRegBitsWithPage(pDemod, DVBT_FSM_STAGE, &FsmStage) != FUNCTION_SUCCESS)
goto error_status_get_registers;
if(pDemod->GetIfAgc(pDemod, &IfAgc) != FUNCTION_SUCCESS)
goto error_status_get_registers;
// Determine signal strength according to FSM stage and IF AGC value.
if(FsmStage < 10)
*pRfPowerLevelDbm = -120;
else
{
if(IfAgc > -1250)
*pRfPowerLevelDbm = -71 - (IfAgc / 165);
else
*pRfPowerLevelDbm = -60;
}
return FUNCTION_SUCCESS;
error_status_get_registers:
return FUNCTION_ERROR;
}
示例3: dvbt_nim_default_GetBer
/**
@see DVBT_NIM_FP_GET_BER
*/
s32
dvbt_nim_default_GetBer(
DVBT_NIM_MODULE *pNim,
u64 *pBerNum,
u64 *pBerDen
)
{
DVBT_DEMOD_MODULE *pDemod;
// Get demod module.
pDemod = pNim->pDemod;
// Get BER from demod.
if(pDemod->GetBer(pDemod, pBerNum, pBerDen) != FUNCTION_SUCCESS)
goto error_status_execute_function;
return FUNCTION_SUCCESS;
error_status_execute_function:
return FUNCTION_ERROR;
}
示例4: demod_get_pd
// Additional definition for mt_control.c
UData_t
demod_get_pd(
handle_t demod_handle,
uint16_t *pd_value
)
{
DVBT_DEMOD_MODULE *pDemod;
unsigned long RssiR;
// Get demod module.
pDemod = (DVBT_DEMOD_MODULE *)demod_handle;
// Get RSSI_R value.
if(pDemod->GetRegBitsWithPage(pDemod, DVBT_RSSI_R, &RssiR) != FUNCTION_SUCCESS)
goto error_status_get_registers;
// Set pd_value according to RSSI_R.
*pd_value = (uint16_t)RssiR;
return MT_OK;
error_status_get_registers:
return MT_COMM_ERR;
}
示例5: 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;
}
示例6: get_rtl2832_ioctrl_8bit_demodbytes
int
get_rtl2832_ioctrl_8bit_demodbytes(
struct dvb_frontend *fe,
unsigned char page,
unsigned char reg_addr,
unsigned char* data,
unsigned short bytelength)
{
int ret = -1;
int i=0;
struct rtl2832_state* p_state = fe->demodulator_priv;
unsigned char data_temp[128];
DVBT_NIM_MODULE *pNim;
DVBT_DEMOD_MODULE *pDemod;
deb_info("+%s: page= %d reg_addr=0x%x bytelength=%d \n", __FUNCTION__,page, reg_addr,bytelength);
if (bytelength > 128 ) {
deb_info("ERROR::bytelength > 128\n");
return -1;
}
if (p_state->demod_type != RTL2832) {
deb_info("ERROR::demod type not rtl2832u...\n");
return -1;
}
pNim = p_state->pNim;
if (pNim == NULL) {
return -1;
}
if( mutex_lock_interruptible(&p_state->i2c_repeater_mutex) ) {
return -1;
}
pDemod=pNim->pDemod;
if(pDemod->SetRegPage(pDemod, page) != FUNCTION_SUCCESS) {
ret=-1;
goto error;
}
if(pDemod->GetRegBytes(pDemod, reg_addr, data_temp, bytelength) != FUNCTION_SUCCESS) {
ret=-1;
goto error;
}
deb_info("->%s: data[%d,%x]= \n", __FUNCTION__,page, reg_addr);
for (i=0; i<bytelength; i++) {
data[i]=data_temp[i];
deb_info("%x(%x),",data[i],data_temp[i]);
}
deb_info("\n");
ret=0;
error:
mutex_unlock(&p_state->i2c_repeater_mutex);
deb_info("-%s: page=%d reg_addr=0x%x bytelength=%d \n", __FUNCTION__,page, reg_addr,bytelength);
return ret;
}
示例7: demod_set_bbagclim
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;
}
示例8: rtl2832_fc0013_GetTunerRssiCalOn
/**
@brief Get tuner RSSI value when calibration is on.
One can use rtl2832_fc0013_GetTunerRssiCalOn() to get tuner calibration-on RSSI value.
@param [in] pNim The NIM module pointer
@retval FUNCTION_SUCCESS Get tuner calibration-on RSSI value successfully.
@retval FUNCTION_ERROR Get tuner calibration-on RSSI value unsuccessfully.
*/
int
rtl2832_fc0013_GetTunerRssiCalOn(
DVBT_NIM_MODULE *pNim
)
{
TUNER_MODULE *pTuner;
DVBT_DEMOD_MODULE *pDemod;
FC0013_EXTRA_MODULE *pTunerExtra;
RTL2832_FC0013_EXTRA_MODULE *pNimExtra;
BASE_INTERFACE_MODULE *pBaseInterface;
// Get tuner module and demod module.
pTuner = pNim->pTuner;
pDemod = pNim->pDemod;
// Get tuner extra module.
pTunerExtra = &(pTuner->Extra.Fc0013);
// Get NIM extra module.
pNimExtra = &(pNim->Extra.Rtl2832Fc0013);
// Get NIM base interface.
pBaseInterface = pNim->pBaseInterface;
// Set tuner EN_CAL_RSSI to 0x1.
if(fc0013_SetRegMaskBits(pTuner, 0x9, 4, 4, 0x1) != FC0013_I2C_SUCCESS)
goto error_status_set_registers;
// Set tuner LNA_POWER_DOWN to 0x1.
if(fc0013_SetRegMaskBits(pTuner, 0x6, 0, 0, 0x1) != FC0013_I2C_SUCCESS)
goto error_status_set_registers;
// Wait 100 ms.
pBaseInterface->WaitMs(pBaseInterface, 100);
// Get demod RSSI_R when tuner RSSI calibration is on.
if(pDemod->GetRegBitsWithPage(pDemod, DVBT_RSSI_R, &(pNimExtra->RssiRCalOn)) != FUNCTION_SUCCESS)
goto error_status_get_registers;
// Set tuner EN_CAL_RSSI to 0x0.
if(fc0013_SetRegMaskBits(pTuner, 0x9, 4, 4, 0x0) != FC0013_I2C_SUCCESS)
goto error_status_set_registers;
// Set tuner LNA_POWER_DOWN to 0x0.
if(fc0013_SetRegMaskBits(pTuner, 0x6, 0, 0, 0x0) != FC0013_I2C_SUCCESS)
goto error_status_set_registers;
return FUNCTION_SUCCESS;
error_status_get_registers:
error_status_set_registers:
return FUNCTION_ERROR;
}
开发者ID:BalintBanyasz,项目名称:DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0,代码行数:73,代码来源:nim_rtl2832_fc0013.c
示例9: rtl2832_fc0013_UpdateFunction
/**
@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
示例10: tuner_set_bw_normal
UData_t
tuner_set_bw_normal(
handle_t tuner_handle,
handle_t demod_handle
)
{
DVBT_DEMOD_MODULE *pDemod;
int DemodBandwidthMode;
unsigned int TunerBandwidthHz;
unsigned int TargetTunerBandwidthHz;
// Get demod module.
pDemod = (DVBT_DEMOD_MODULE *)demod_handle;
// Get demod bandwidth mode.
if(pDemod->GetBandwidthMode(pDemod, &DemodBandwidthMode) != FUNCTION_SUCCESS)
goto error_status_execute_function;
// Determine tuner target bandwidth.
switch(DemodBandwidthMode)
{
case DVBT_BANDWIDTH_6MHZ: TargetTunerBandwidthHz = MT2266_BANDWIDTH_6MHZ; break;
case DVBT_BANDWIDTH_7MHZ: TargetTunerBandwidthHz = MT2266_BANDWIDTH_7MHZ; break;
default:
case DVBT_BANDWIDTH_8MHZ: TargetTunerBandwidthHz = MT2266_BANDWIDTH_8MHZ; break;
}
// Get tuner bandwidth.
if(MT_IS_ERROR(MT2266_GetParam(tuner_handle, MT2266_OUTPUT_BW, &TunerBandwidthHz)))
goto error_status_get_tuner_bandwidth;
// Set tuner bandwidth with normal setting according to demod bandwidth mode.
if(TunerBandwidthHz != TargetTunerBandwidthHz)
{
if(MT_IS_ERROR(MT2266_SetParam(tuner_handle, MT2266_OUTPUT_BW, TargetTunerBandwidthHz)))
goto error_status_set_tuner_bandwidth;
}
return MT_OK;
error_status_set_tuner_bandwidth:
error_status_get_tuner_bandwidth:
error_status_execute_function:
return MT_COMM_ERR;
}
示例11: dvbt_nim_default_GetSignalStrength
/**
@see DVBT_NIM_FP_GET_SIGNAL_STRENGTH
*/
s32 dvbt_nim_default_GetSignalStrength(DVBT_NIM_MODULE *pNim, u64 *pSignalStrength)
{
DVBT_DEMOD_MODULE *pDemod;
// Get demod module.
pDemod = pNim->pDemod;
// Get signal strength from demod.
if(pDemod->GetSignalStrength(pDemod, pSignalStrength) != FUNCTION_SUCCESS)
goto error_status_execute_function;
return FUNCTION_SUCCESS;
error_status_execute_function:
return FUNCTION_ERROR;
}
示例12: dvbt_nim_default_GetSnrDb
/**
* @see DVBT_NIM_FP_GET_SNR_DB
*/
s32 dvbt_nim_default_GetSnrDb(DVBT_NIM_MODULE *pNim, s64 *pSnrDbNum, s64 *pSnrDbDen)
{
DVBT_DEMOD_MODULE *pDemod;
// Get demod module.
pDemod = pNim->pDemod;
// Get SNR in dB from demod.
if(pDemod->GetSnrDb(pDemod, pSnrDbNum, pSnrDbDen) != FUNCTION_SUCCESS)
goto error_status_execute_function;
return FUNCTION_SUCCESS;
error_status_execute_function:
return FUNCTION_ERROR;
}
示例13: dvbt_nim_default_SetParameters
/**
@see DVBT_NIM_FP_SET_PARAMETERS
*/
s32
dvbt_nim_default_SetParameters(
DVBT_NIM_MODULE *pNim,
u64 RfFreqHz,
s32 BandwidthMode
)
{
TUNER_MODULE *pTuner;
DVBT_DEMOD_MODULE *pDemod;
// Get tuner module and demod module.
pTuner = pNim->pTuner;
pDemod = pNim->pDemod;
// Set tuner RF frequency in Hz.
if(pTuner->SetRfFreqHz(pTuner, RfFreqHz) != 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:
return FUNCTION_ERROR;
}
示例14: dvbt_nim_default_IsSignalLocked
/**
@see DVBT_NIM_FP_IS_SIGNAL_LOCKED
*/
s32
dvbt_nim_default_IsSignalLocked(
DVBT_NIM_MODULE *pNim,
s32 *pAnswer
)
{
BASE_INTERFACE_MODULE *pBaseInterface;
DVBT_DEMOD_MODULE *pDemod;
s32 i;
// Get base interface and demod module.
pBaseInterface = pNim->pBaseInterface;
pDemod = pNim->pDemod;
// Wait for signal lock check.
for(i = 0; i < DVBT_NIM_SINGAL_LOCK_CHECK_TIMES_MAX_DEFAULT; i++)
{
// Wait 20 ms.
pBaseInterface->WaitMs(pBaseInterface, 20);
// Check signal lock status on demod.
// Note: If signal is locked, stop signal lock check.
if(pDemod->IsSignalLocked(pDemod, pAnswer) != FUNCTION_SUCCESS)
goto error_status_execute_function;
if(*pAnswer == YES)
break;
}
return FUNCTION_SUCCESS;
error_status_execute_function:
return FUNCTION_ERROR;
}
示例15: dvbt_nim_default_UpdateFunction
/**
@see DVBT_NIM_FP_UPDATE_FUNCTION
*/
s32
dvbt_nim_default_UpdateFunction(
DVBT_NIM_MODULE *pNim
)
{
DVBT_DEMOD_MODULE *pDemod;
// Get demod module.
pDemod = pNim->pDemod;
// Update demod particular registers.
if(pDemod->UpdateFunction(pDemod) != FUNCTION_SUCCESS)
goto error_status_execute_function;
return FUNCTION_SUCCESS;
error_status_execute_function:
return FUNCTION_ERROR;
}