rf_txiq.cpp
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:73k
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*****************************************************************************
- *
- * Filename:
- * ---------
- * rf_txiq.cpp
- *
- * Project:
- * --------
- * Maui META APP
- *
- * Description:
- * ------------
- * RF TX IQ source
- *
- * Author:
- * -------
- * Andy Ueng (mtk00490)
- *
- *============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * $Revision$
- * $Modtime$
- * $Log$
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- #include <IniFiles.hpp>
- #pragma hdrstop
- #ifndef _RF_COMMON_H_
- #include "rf_common.h"
- #endif
- #ifndef _RF_TXIQ_H_
- #include "rf_txiq.h"
- #endif
- #ifndef _MAN_ACTIVE_H_
- #include "man_active.h"
- #endif
- #ifndef _MAN_FDM_H_
- #include "man_fdm.h"
- #endif
- // NVRAM
- #ifndef _NVRAM_VER_H_
- #include "nvram_ver.h"
- #endif
- // misc
- #ifndef _FT_UTILS_H_
- #include "ft_utils.h"
- #endif
- //===========================================================================
- static CRFTXIQ* g_rf_txiq_ptr;
- static bool g_bIsRunning = false;
- //===========================================================================
- static void CNF_ReadFromNVRAM(void)
- {
- g_rf_txiq_ptr->CNF_ReadFromNVRAM();
- }
- //------------------------------------------------------------------------------
- static void CNF_WriteToNVRAM(void)
- {
- g_rf_txiq_ptr->CNF_WriteToNVRAM();
- }
- //===========================================================================
- CRFTXIQ::CRFTXIQ(void)
- {
- g_bIsRunning = false;
- ConfirmCallback = NULL;
- m_uiTXIQBufSize = 0;
- m_cTXIQBuf = NULL;
- }
- //---------------------------------------------------------------------------
- CRFTXIQ::~CRFTXIQ()
- {
- g_bIsRunning = false;
- ConfirmCallback = NULL;
- ReleaseResource();
- }
- //---------------------------------------------------------------------------
- void CRFTXIQ::ReleaseResource(void)
- {
- if (m_cTXIQBuf)
- {
- delete [] m_cTXIQBuf;
- m_cTXIQBuf = NULL;
- }
- }
- //---------------------------------------------------------------------------
- void CRFTXIQ::Init(void)
- {
- ReleaseResource();
- }
- //---------------------------------------------------------------------------
- void CRFTXIQ::Confirm(E_METAAPP_RESULT_T confirm_state)
- {
- if (!g_bIsRunning)
- {
- return;
- }
- g_bIsRunning = false;
- if (NULL == ConfirmCallback)
- {
- return;
- }
- m_eConfirmState = confirm_state;
- ActiveMan->SetActiveFunction( ConfirmCallback );
- }
- //===========================================================================
- void CRFTXIQ::ResetBbTxParaChangeFlag(void)
- {
- m_BbTxParaChangeFlag.b_bbtx_common_mode_voltage = false;
- m_BbTxParaChangeFlag.b_bbtx_gain = false;
- m_BbTxParaChangeFlag.b_bbtx_calrcsel = false;
- m_BbTxParaChangeFlag.b_bbtx_trimI = false;
- m_BbTxParaChangeFlag.b_bbtx_trimQ = false;
- m_BbTxParaChangeFlag.b_bbtx_offsetI = false;
- m_BbTxParaChangeFlag.b_bbtx_offsetQ = false;
- m_BbTxParaChangeFlag.b_bbtx_isCalibrated = false;
- m_BbTxParaChangeFlag.b_apc_bat_low_voltage = false;
- m_BbTxParaChangeFlag.b_apc_bat_high_voltage = false;
- m_BbTxParaChangeFlag.b_apc_bat_low_temperature = false;
- m_BbTxParaChangeFlag.b_apc_bat_high_temperature = false;
- m_BbTxParaChangeFlag.b_bbtx_common_mode_voltage_h = false;
- m_BbTxParaChangeFlag.b_bbtx_gain_h = false;
- m_BbTxParaChangeFlag.b_bbtx_calrcsel_h = false;
- m_BbTxParaChangeFlag.b_bbtx_trimI_h = false;
- m_BbTxParaChangeFlag.b_bbtx_trimQ_h = false;
- m_BbTxParaChangeFlag.b_bbtx_offsetI_h = false;
- m_BbTxParaChangeFlag.b_bbtx_offsetQ_h = false;
- m_BbTxParaChangeFlag.b_bbtx_phsel = false;
- m_BbTxParaChangeFlag.b_bbtx_phsel_h = false;
- }
- //---------------------------------------------------------------------------
- void CRFTXIQ::SetBbTxParaChangeFlag(void)
- {
- ResetBbTxParaChangeFlag();
- m_BbTxParaChangeFlag.b_bbtx_trimI = true;
- m_BbTxParaChangeFlag.b_bbtx_trimQ = true;
- m_BbTxParaChangeFlag.b_bbtx_offsetI = true;
- m_BbTxParaChangeFlag.b_bbtx_offsetQ = true;
- if (m_eBbTxCfgVer >= BBTXCFG_VER2)
- {
- m_BbTxParaChangeFlag.b_bbtx_common_mode_voltage = true;
- m_BbTxParaChangeFlag.b_bbtx_gain = true;
- m_BbTxParaChangeFlag.b_bbtx_calrcsel = true;
- m_BbTxParaChangeFlag.b_bbtx_isCalibrated = true;
- m_BbTxParaChangeFlag.b_apc_bat_low_voltage = true;
- m_BbTxParaChangeFlag.b_apc_bat_high_voltage = true;
- m_BbTxParaChangeFlag.b_apc_bat_low_temperature = true;
- m_BbTxParaChangeFlag.b_apc_bat_high_temperature = true;
- }
- if (m_eBbTxCfgVer >= BBTXCFG_VER3)
- {
- m_BbTxParaChangeFlag.b_bbtx_phsel = true;
- if ((RF_ID_A60111A == m_uiFinalRfId) ||
- (RF_ID_AERO2E == m_uiFinalRfId) ||
- (RF_ID_MT6140A == m_uiFinalRfId) ||
- (RF_ID_MT6140B == m_uiFinalRfId) ||
- (RF_ID_MT6140C == m_uiFinalRfId) ||
- (RF_ID_MT6140D == m_uiFinalRfId)
- )
- {
- m_BbTxParaChangeFlag.b_bbtx_common_mode_voltage_h = true;
- m_BbTxParaChangeFlag.b_bbtx_gain_h = true;
- m_BbTxParaChangeFlag.b_bbtx_calrcsel_h = true;
- m_BbTxParaChangeFlag.b_bbtx_trimI_h = true;
- m_BbTxParaChangeFlag.b_bbtx_trimQ_h = true;
- m_BbTxParaChangeFlag.b_bbtx_offsetI_h = true;
- m_BbTxParaChangeFlag.b_bbtx_offsetQ_h = true;
- m_BbTxParaChangeFlag.b_bbtx_phsel_h = true;
- }
- }
- }
- //---------------------------------------------------------------------------
- void CRFTXIQ::Set_BBTxParametersFromAutoK(RfBBTXCfg2* p_rf_bbtx_cfg)
- {
- // low band
- m_sL1CalTxIq.bbtx_trimI = p_rf_bbtx_cfg->TxTrimI;
- m_sL1CalTxIq.bbtx_trimQ = p_rf_bbtx_cfg->TxTrimQ;
- m_sL1CalTxIq.bbtx_offsetI = p_rf_bbtx_cfg->TxOffsetI;
- m_sL1CalTxIq.bbtx_offsetQ = p_rf_bbtx_cfg->TxOffsetQ;
- m_sL1CalTxIq.bbtx_gain = p_rf_bbtx_cfg->TxGain;
- m_sL1CalTxIq.bbtx_calrcsel = p_rf_bbtx_cfg->TxCalrcsel;
- m_sL1CalTxIq.bbtx_common_mode_voltage = p_rf_bbtx_cfg->TxCMV;
- // high band
- m_sL1CalTxIq.bbtx_trimI_h = p_rf_bbtx_cfg->TxTrimI;
- m_sL1CalTxIq.bbtx_trimQ_h = p_rf_bbtx_cfg->TxTrimQ;
- m_sL1CalTxIq.bbtx_offsetI_h = p_rf_bbtx_cfg->TxOffsetI;
- m_sL1CalTxIq.bbtx_offsetQ_h = p_rf_bbtx_cfg->TxOffsetQ;
- m_sL1CalTxIq.bbtx_gain_h = p_rf_bbtx_cfg->TxGain;
- m_sL1CalTxIq.bbtx_calrcsel_h = p_rf_bbtx_cfg->TxCalrcsel; // new
- m_sL1CalTxIq.bbtx_common_mode_voltage_h = p_rf_bbtx_cfg->TxCMV; // new
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- signed char CRFTXIQ::Get_BBTx_OffsetI(void)
- {
- return m_sL1CalTxIq.bbtx_offsetI;
- }
- //---------------------------------------------------------------------------
- void CRFTXIQ::Set_BBTx_OffsetI(char offset_i)
- {
- m_sL1CalTxIq.bbtx_offsetI = offset_i;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- signed char CRFTXIQ::Get_BBTx_OffsetQ(void)
- {
- return m_sL1CalTxIq.bbtx_offsetQ;
- }
- //---------------------------------------------------------------------------
- void CRFTXIQ::Set_BBTx_OffsetQ(char offset_q)
- {
- m_sL1CalTxIq.bbtx_offsetQ = offset_q;
- }
- //---------------------------------------------------------------------------
- void CRFTXIQ::Set_BBTx_isCalibrated(unsigned char isCalibrated)
- {
- m_sL1CalTxIq.bbtx_isCalibrated = isCalibrated;
- }
- //===========================================================================
- void CRFTXIQ::Compose_BBTXParameters(void)
- {
- if (m_BbTxParaChangeFlag.b_bbtx_common_mode_voltage)
- {
- m_sL1CalTxIq.bbtx_common_mode_voltage = m_sUiL1CalTxIq.BBTXParameters.bbtx_common_mode_voltage & 0x07;
- }
- if (m_BbTxParaChangeFlag.b_bbtx_gain)
- {
- m_sL1CalTxIq.bbtx_gain = m_sUiL1CalTxIq.BBTXParameters.bbtx_gain & 0x07;
- }
- if (m_BbTxParaChangeFlag.b_bbtx_calrcsel)
- {
- m_sL1CalTxIq.bbtx_calrcsel = m_sUiL1CalTxIq.BBTXParameters.bbtx_calrcsel & 0x07;
- }
- if (m_BbTxParaChangeFlag.b_apc_bat_low_voltage)
- {
- m_sL1CalTxIq.apc_bat_low_voltage = m_sUiL1CalTxIq.BBTXParameters.apc_bat_low_voltage*BBTX_BATTERY_VOLTAGE_SCALE;
- }
- if (m_BbTxParaChangeFlag.b_apc_bat_high_voltage)
- {
- m_sL1CalTxIq.apc_bat_high_voltage = m_sUiL1CalTxIq.BBTXParameters.apc_bat_high_voltage*BBTX_BATTERY_VOLTAGE_SCALE;
- }
- if (m_BbTxParaChangeFlag.b_apc_bat_low_temperature)
- {
- m_sL1CalTxIq.apc_bat_low_temperature = m_sUiL1CalTxIq.BBTXParameters.apc_bat_low_temperature*BBTX_BATTERY_TEMP_SCALE;
- }
- if (m_BbTxParaChangeFlag.b_apc_bat_high_temperature)
- {
- m_sL1CalTxIq.apc_bat_high_temperature = m_sUiL1CalTxIq.BBTXParameters.apc_bat_high_temperature*BBTX_BATTERY_TEMP_SCALE;
- }
- if (m_BbTxParaChangeFlag.b_bbtx_trimI)
- {
- m_sL1CalTxIq.bbtx_trimI = m_sUiL1CalTxIq.BBTXParameters.bbtx_trimI;
- }
- if (m_BbTxParaChangeFlag.b_bbtx_trimQ)
- {
- m_sL1CalTxIq.bbtx_trimQ = m_sUiL1CalTxIq.BBTXParameters.bbtx_trimQ;
- }
- if (m_BbTxParaChangeFlag.b_bbtx_offsetI)
- {
- m_sL1CalTxIq.bbtx_offsetI = m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetI;
- }
- if (m_BbTxParaChangeFlag.b_bbtx_offsetQ)
- {
- m_sL1CalTxIq.bbtx_offsetQ = m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetQ;
- }
- if (m_BbTxParaChangeFlag.b_bbtx_isCalibrated)
- {
- m_sL1CalTxIq.bbtx_isCalibrated = m_sUiL1CalTxIq.BBTXParameters.bbtx_isCalibrated*BBTX_CALIBRATED_SCALE;
- }
- if (m_BbTxParaChangeFlag.b_bbtx_phsel)
- {
- m_sL1CalTxIq.bbtx_phsel = m_sUiL1CalTxIq.BBTXParameters.bbtx_phsel;
- }
- if (m_eBbTxCfgVer >= BBTXCFG_VER4)
- {
- if (m_BbTxParaChangeFlag.b_bbtx_offsetI)
- {
- if (m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetI > MAX_OFFSET_IQ_OLD)
- {
- m_sL1CalTxIq.bbtx_offsetI = m_sL1CalTxIq.bbtx_offsetI - (MAX_OFFSET_IQ_OLD + 1);
- m_sL1CalTxIq.bbtx_dccoarseI = 1;
- }
- else if (m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetI < MIN_OFFSET_IQ_OLD)
- {
- m_sL1CalTxIq.bbtx_offsetI = m_sL1CalTxIq.bbtx_offsetI + (MAX_OFFSET_IQ_OLD + 1);
- m_sL1CalTxIq.bbtx_dccoarseI = -1;
- }
- else
- {
- m_sL1CalTxIq.bbtx_dccoarseI = 0;
- }
- }
- if (m_BbTxParaChangeFlag.b_bbtx_offsetQ)
- {
- if (m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetQ > MAX_OFFSET_IQ_OLD)
- {
- m_sL1CalTxIq.bbtx_offsetQ = m_sL1CalTxIq.bbtx_offsetQ - (MAX_OFFSET_IQ_OLD + 1);
- m_sL1CalTxIq.bbtx_dccoarseQ = 1;
- }
- else if (m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetQ < MIN_OFFSET_IQ_OLD)
- {
- m_sL1CalTxIq.bbtx_offsetQ = m_sL1CalTxIq.bbtx_offsetQ + (MAX_OFFSET_IQ_OLD + 1);
- m_sL1CalTxIq.bbtx_dccoarseQ = -1;
- }
- else
- {
- m_sL1CalTxIq.bbtx_dccoarseQ = 0;
- }
- }
- }
- else
- {
- m_sL1CalTxIq.bbtx_dccoarseI = 0;
- m_sL1CalTxIq.bbtx_dccoarseQ = 0;
- }
- // high band parameter
- if ((RF_ID_A60111A == m_uiFinalRfId) ||
- (RF_ID_AERO2E == m_uiFinalRfId) ||
- (RF_ID_MT6140A == m_uiFinalRfId) ||
- (RF_ID_MT6140B == m_uiFinalRfId) ||
- (RF_ID_MT6140C == m_uiFinalRfId) ||
- (RF_ID_MT6140D == m_uiFinalRfId)
- )
- {
- if (m_BbTxParaChangeFlag.b_bbtx_common_mode_voltage_h)
- {
- m_sL1CalTxIq.bbtx_common_mode_voltage_h = m_sUiL1CalTxIq.BBTXParameters.bbtx_common_mode_voltage_h & 0x07;
- }
- if (m_BbTxParaChangeFlag.b_bbtx_gain_h)
- {
- m_sL1CalTxIq.bbtx_gain_h = m_sUiL1CalTxIq.BBTXParameters.bbtx_gain_h & 0x07;
- }
- if (m_BbTxParaChangeFlag.b_bbtx_calrcsel_h)
- {
- m_sL1CalTxIq.bbtx_calrcsel_h = m_sUiL1CalTxIq.BBTXParameters.bbtx_calrcsel_h & 0x07;
- }
- if (m_BbTxParaChangeFlag.b_bbtx_trimI_h)
- {
- m_sL1CalTxIq.bbtx_trimI_h = m_sUiL1CalTxIq.BBTXParameters.bbtx_trimI_h;
- }
- if (m_BbTxParaChangeFlag.b_bbtx_trimQ_h)
- {
- m_sL1CalTxIq.bbtx_trimQ_h = m_sUiL1CalTxIq.BBTXParameters.bbtx_trimQ_h;
- }
- if (m_BbTxParaChangeFlag.b_bbtx_offsetI_h)
- {
- m_sL1CalTxIq.bbtx_offsetI_h = m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetI_h;
- }
- if (m_BbTxParaChangeFlag.b_bbtx_offsetQ_h)
- {
- m_sL1CalTxIq.bbtx_offsetQ_h = m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetQ_h;
- }
- if (m_BbTxParaChangeFlag.b_bbtx_phsel_h)
- {
- m_sL1CalTxIq.bbtx_phsel_h = m_sUiL1CalTxIq.BBTXParameters.bbtx_phsel_h;
- }
- if (m_eBbTxCfgVer >= BBTXCFG_VER4)
- {
- if (m_BbTxParaChangeFlag.b_bbtx_offsetI_h)
- {
- if (m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetI_h > MAX_OFFSET_IQ_OLD)
- {
- m_sL1CalTxIq.bbtx_offsetI_h = m_sL1CalTxIq.bbtx_offsetI_h - (MAX_OFFSET_IQ_OLD + 1);
- m_sL1CalTxIq.bbtx_dccoarseI_h = 1;
- }
- else if (m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetI_h < MIN_OFFSET_IQ_OLD)
- {
- m_sL1CalTxIq.bbtx_offsetI_h = m_sL1CalTxIq.bbtx_offsetI_h + (MAX_OFFSET_IQ_OLD + 1);
- m_sL1CalTxIq.bbtx_dccoarseI_h = -1;
- }
- else
- {
- m_sL1CalTxIq.bbtx_dccoarseI_h = 0;
- }
- }
- if (m_BbTxParaChangeFlag.b_bbtx_offsetQ_h)
- {
- if (m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetQ_h > MAX_OFFSET_IQ_OLD)
- {
- m_sL1CalTxIq.bbtx_offsetQ_h = m_sL1CalTxIq.bbtx_offsetQ_h - (MAX_OFFSET_IQ_OLD + 1);
- m_sL1CalTxIq.bbtx_dccoarseQ_h = 1;
- }
- else if (m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetQ_h < MIN_OFFSET_IQ_OLD)
- {
- m_sL1CalTxIq.bbtx_offsetQ_h = m_sL1CalTxIq.bbtx_offsetQ_h + (MAX_OFFSET_IQ_OLD + 1);
- m_sL1CalTxIq.bbtx_dccoarseQ_h = -1;
- }
- else
- {
- m_sL1CalTxIq.bbtx_dccoarseQ_h = 0;
- }
- }
- }
- else
- {
- m_sL1CalTxIq.bbtx_dccoarseI_h = 0;
- m_sL1CalTxIq.bbtx_dccoarseQ_h = 0;
- }
- }
- }
- //---------------------------------------------------------------------------
- void CRFTXIQ::DeCompose_BBTXParameters(void)
- {
- signed char NVRAM2BBTX[] =
- {
- 0, 1, 2, 3, -4, -3, -2, -1
- };
- m_sUiL1CalTxIq.BBTXParameters.bbtx_common_mode_voltage = NVRAM2BBTX[m_sL1CalTxIq.bbtx_common_mode_voltage& 0x07];
- m_sUiL1CalTxIq.BBTXParameters.bbtx_gain = NVRAM2BBTX[m_sL1CalTxIq.bbtx_gain & 0x07];
- m_sUiL1CalTxIq.BBTXParameters.bbtx_calrcsel = NVRAM2BBTX[m_sL1CalTxIq.bbtx_calrcsel & 0x07];
- m_sUiL1CalTxIq.BBTXParameters.apc_bat_low_voltage = m_sL1CalTxIq.apc_bat_low_voltage / BBTX_BATTERY_VOLTAGE_SCALE;
- m_sUiL1CalTxIq.BBTXParameters.apc_bat_high_voltage = m_sL1CalTxIq.apc_bat_high_voltage / BBTX_BATTERY_VOLTAGE_SCALE;
- m_sUiL1CalTxIq.BBTXParameters.apc_bat_low_temperature = m_sL1CalTxIq.apc_bat_low_temperature / BBTX_BATTERY_TEMP_SCALE;
- m_sUiL1CalTxIq.BBTXParameters.apc_bat_high_temperature = m_sL1CalTxIq.apc_bat_high_temperature / BBTX_BATTERY_TEMP_SCALE;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_trimI = m_sL1CalTxIq.bbtx_trimI;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_trimQ = m_sL1CalTxIq.bbtx_trimQ;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetI = m_sL1CalTxIq.bbtx_offsetI;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetQ = m_sL1CalTxIq.bbtx_offsetQ;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_isCalibrated = m_sL1CalTxIq.bbtx_isCalibrated / BBTX_CALIBRATED_SCALE;
- if (m_eBbTxCfgVer >= BBTXCFG_VER4)
- {
- if (1 == m_sL1CalTxIq.bbtx_dccoarseI)
- {
- m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetI += (MAX_OFFSET_IQ_OLD + 1);
- }
- else if (0xFF == m_sL1CalTxIq.bbtx_dccoarseI)
- {
- m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetI -= (MAX_OFFSET_IQ_OLD + 1);
- }
- if (1 == m_sL1CalTxIq.bbtx_dccoarseQ)
- {
- m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetQ += (MAX_OFFSET_IQ_OLD + 1);
- }
- else if (0xFF == m_sL1CalTxIq.bbtx_dccoarseQ)
- {
- m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetQ -= (MAX_OFFSET_IQ_OLD + 1);
- }
- }
- // high band parameter
- //if ((RF_ID_MT6140A == rfmod_id) ||
- // (RF_ID_MT6140B == rfmod_id) ||
- // (RF_ID_MT6140C == rfmod_id) ||
- // (RF_ID_MT6140D == rfmod_id)
- // )
- {
- m_sUiL1CalTxIq.BBTXParameters.bbtx_phsel = m_sL1CalTxIq.bbtx_phsel;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_common_mode_voltage_h = NVRAM2BBTX[m_sL1CalTxIq.bbtx_common_mode_voltage_h & 0x07];
- m_sUiL1CalTxIq.BBTXParameters.bbtx_gain_h = NVRAM2BBTX[m_sL1CalTxIq.bbtx_gain_h & 0x07];
- m_sUiL1CalTxIq.BBTXParameters.bbtx_calrcsel_h = NVRAM2BBTX[m_sL1CalTxIq.bbtx_calrcsel_h & 0x07];
- m_sUiL1CalTxIq.BBTXParameters.bbtx_trimI_h = m_sL1CalTxIq.bbtx_trimI_h;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_trimQ_h = m_sL1CalTxIq.bbtx_trimQ_h;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetI_h = m_sL1CalTxIq.bbtx_offsetI_h;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetQ_h = m_sL1CalTxIq.bbtx_offsetQ_h;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_phsel_h = m_sL1CalTxIq.bbtx_phsel_h;
- if (m_eBbTxCfgVer >= BBTXCFG_VER4)
- {
- if (1 == m_sL1CalTxIq.bbtx_dccoarseI_h)
- {
- m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetI_h += (MAX_OFFSET_IQ_OLD + 1);
- }
- else if (0xFF == m_sL1CalTxIq.bbtx_dccoarseI_h)
- {
- m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetI_h -= (MAX_OFFSET_IQ_OLD + 1);
- }
- if (1 == m_sL1CalTxIq.bbtx_dccoarseQ_h)
- {
- m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetQ_h += (MAX_OFFSET_IQ_OLD + 1);
- }
- else if (0xFF == m_sL1CalTxIq.bbtx_dccoarseQ_h)
- {
- m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetQ_h -= (MAX_OFFSET_IQ_OLD + 1);
- }
- }
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFTXIQ::REQ_Read_From_NVRAM_Start(unsigned int rfmod_id, E_BBTXCFG_VER_T bbtxcfg_ver)
- {
- g_rf_txiq_ptr = this;
- g_bIsRunning = true;
- m_uiFinalRfId = rfmod_id;
- m_eBbTxCfgVer = bbtxcfg_ver;
- m_bDownloadTrigger = false;
- REQ_Read_From_NVRAM();
- }
- //---------------------------------------------------------------------------
- void CRFTXIQ::REQ_Read_From_NVRAM(void)
- {
- if (!g_bIsRunning)
- {
- return;
- }
- if (NULL == m_cTXIQBuf)
- {
- META_RESULT MetaResult = META_NVRAM_GetRecLen("NVRAM_EF_L1_TXIQ_LID", (int *) &m_uiTXIQBufSize );
- if (MetaResult != META_SUCCESS)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- m_cTXIQBuf = new char[m_uiTXIQBufSize];
- }
- NVRAMMan->ConfirmCallback = ::CNF_ReadFromNVRAM;
- NVRAMMan->REQ_ReadNVRAM_Start("NVRAM_EF_L1_TXIQ_LID",
- 1,
- m_uiTXIQBufSize,
- m_cTXIQBuf);
- }
- //-------------------------------------
- void CRFTXIQ::CNF_ReadFromNVRAM(void)
- {
- if (!g_bIsRunning)
- {
- return;
- }
- E_METAAPP_RESULT_T state = NVRAMMan->Get_ConfirmState();
- switch (state)
- {
- case METAAPP_SUCCESS:
- {
- if (m_bDownloadTrigger)
- {
- REQ_Write_To_NVRAM();
- }
- else
- {
- META_RESULT MetaResult;
- m_eNvBbTxCfgVer = NVRAMMan->Get_NvBbTxCfgVer();
- if (m_eNvBbTxCfgVer <= NVRAM_BBTXCFG_VER3)
- {
- MetaResult = META_NVRAM_GetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_common_mode_voltage",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_common_mode_voltage,
- sizeof(m_sL1CalTxIq.bbtx_common_mode_voltage) );
- if (MetaResult != META_SUCCESS)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- MetaResult = META_NVRAM_GetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_gain",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_gain,
- sizeof(m_sL1CalTxIq.bbtx_gain) );
- if (MetaResult != META_SUCCESS)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- MetaResult = META_NVRAM_GetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_calrcsel",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_calrcsel,
- sizeof(m_sL1CalTxIq.bbtx_calrcsel) );
- if (MetaResult != META_SUCCESS)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- MetaResult = META_NVRAM_GetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.apc_bat_low_voltage",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.apc_bat_low_voltage,
- sizeof(m_sL1CalTxIq.apc_bat_low_voltage) );
- if (MetaResult != META_SUCCESS)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- MetaResult = META_NVRAM_GetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.apc_bat_high_voltage",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.apc_bat_high_voltage,
- sizeof(m_sL1CalTxIq.apc_bat_high_voltage) );
- if (MetaResult != META_SUCCESS)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- MetaResult = META_NVRAM_GetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.apc_bat_low_temperature",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.apc_bat_low_temperature,
- sizeof(m_sL1CalTxIq.apc_bat_low_temperature) );
- if (MetaResult != META_SUCCESS)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- MetaResult = META_NVRAM_GetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.apc_bat_high_temperature",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.apc_bat_high_temperature,
- sizeof(m_sL1CalTxIq.apc_bat_high_temperature) );
- if (MetaResult!=META_SUCCESS)
- {
- Confirm( METAAPP_FAIL );
- return;
- }
- MetaResult = META_NVRAM_GetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_trimI",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_trimI ,
- sizeof(m_sL1CalTxIq.bbtx_trimI ) );
- if (MetaResult!=META_SUCCESS)
- {
- Confirm( METAAPP_FAIL );
- return;
- }
- MetaResult = META_NVRAM_GetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_trimQ",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_trimQ,
- sizeof(m_sL1CalTxIq.bbtx_trimQ) );
- if (MetaResult!=META_SUCCESS)
- {
- Confirm( METAAPP_FAIL );
- return;
- }
- MetaResult = META_NVRAM_GetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_offsetI",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_offsetI,
- sizeof(m_sL1CalTxIq.bbtx_offsetI) );
- if (MetaResult!=META_SUCCESS)
- {
- Confirm( METAAPP_FAIL );
- return;
- }
- MetaResult = META_NVRAM_GetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_offsetQ",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_offsetQ,
- sizeof(m_sL1CalTxIq.bbtx_offsetQ) );
- if (MetaResult!=META_SUCCESS)
- {
- Confirm( METAAPP_FAIL );
- return;
- }
- MetaResult = META_NVRAM_GetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_isCalibrated",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_isCalibrated,
- sizeof(m_sL1CalTxIq.bbtx_isCalibrated) );
- if (MetaResult!=META_SUCCESS)
- {
- Confirm( METAAPP_FAIL );
- return;
- }
- if (m_eBbTxCfgVer >= BBTXCFG_VER3)
- {
- MetaResult = META_NVRAM_GetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_phsel",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_phsel,
- sizeof(m_sL1CalTxIq.bbtx_phsel));
- if (META_SUCCESS != MetaResult)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- // high band parameter
- if ((RF_ID_A60111A == m_uiFinalRfId) ||
- (RF_ID_AERO2E == m_uiFinalRfId) ||
- (RF_ID_MT6140A == m_uiFinalRfId) ||
- (RF_ID_MT6140B == m_uiFinalRfId) ||
- (RF_ID_MT6140C == m_uiFinalRfId) ||
- (RF_ID_MT6140D == m_uiFinalRfId)
- )
- {
- MetaResult = META_NVRAM_GetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_common_mode_voltage_h",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_common_mode_voltage_h,
- sizeof(m_sL1CalTxIq.bbtx_common_mode_voltage_h));
- if (META_SUCCESS != MetaResult)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- MetaResult = META_NVRAM_GetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_gain_h",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_gain_h,
- sizeof(m_sL1CalTxIq.bbtx_gain_h));
- if (META_SUCCESS != MetaResult)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- MetaResult = META_NVRAM_GetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_calrcsel_h",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_calrcsel_h,
- sizeof(m_sL1CalTxIq.bbtx_calrcsel_h));
- if (META_SUCCESS != MetaResult)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- MetaResult = META_NVRAM_GetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_trimI_h",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_trimI_h,
- sizeof(m_sL1CalTxIq.bbtx_trimI_h));
- if (META_SUCCESS != MetaResult)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- MetaResult = META_NVRAM_GetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_trimQ_h",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_trimQ_h,
- sizeof(m_sL1CalTxIq.bbtx_trimQ_h));
- if (META_SUCCESS != MetaResult)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- MetaResult = META_NVRAM_GetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_offsetI_h",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_offsetI_h,
- sizeof(m_sL1CalTxIq.bbtx_offsetI_h));
- if (META_SUCCESS != MetaResult)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- MetaResult = META_NVRAM_GetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_offsetQ_h",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_offsetQ_h,
- sizeof(m_sL1CalTxIq.bbtx_offsetQ_h));
- if (META_SUCCESS != MetaResult)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- MetaResult = META_NVRAM_GetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_phsel_h",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_phsel_h,
- sizeof(m_sL1CalTxIq.bbtx_phsel_h));
- if (META_SUCCESS != MetaResult)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- }
- else
- {
- MetaResult = META_NVRAM_Decompose_BBTXParameters(&m_sL1CalTxIq, m_cTXIQBuf, m_uiTXIQBufSize);
- if (META_SUCCESS != MetaResult)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- DeCompose_BBTXParameters();
- Confirm(METAAPP_SUCCESS);
- }
- }
- break;
- default:
- { Confirm(state);
- }
- break;
- }
- }
- //===========================================================================
- void CRFTXIQ::REQ_Write_To_NVRAM_Start(unsigned int rfmod_id, E_BBTXCFG_VER_T bbtxcfg_ver)
- {
- g_rf_txiq_ptr = this;
- g_bIsRunning = true;
- m_bDownloadTrigger = true;
- m_uiFinalRfId = rfmod_id;
- m_eBbTxCfgVer = bbtxcfg_ver;
- REQ_Read_From_NVRAM();
- }
- //----------------------------------------------------------------------------
- void CRFTXIQ::REQ_Write_To_NVRAM(void)
- {
- if (!g_bIsRunning)
- {
- return;
- }
- META_RESULT MetaResult;
- unsigned short lid_ver;
- //MetaResult = META_NVRAM_GetLIDVersion("NVRAM_EF_L1_TXIQ_LID", &lid_ver);
- //if (lid_ver > NVRAM_EF_L1_TXIQ_LID_VERNO)
- //{
- // Confirm(METAAPP_NVRAM_LID_VER_NOT_SUPPORT);
- // return;
- //}
- if (NULL == m_cTXIQBuf)
- {
- MetaResult = META_NVRAM_GetRecLen("NVRAM_EF_L1_TXIQ_LID", (int *)&m_uiTXIQBufSize );
- if (MetaResult != META_SUCCESS)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- m_cTXIQBuf = new char[m_uiTXIQBufSize];
- }
- // compse
- m_eNvBbTxCfgVer = NVRAMMan->Get_NvBbTxCfgVer();
- if (m_eNvBbTxCfgVer <= NVRAM_BBTXCFG_VER3)
- {
- // if (m_BbTxParaChangeFlag.b_bbtx_common_mode_voltage)
- {
- MetaResult = META_NVRAM_SetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_common_mode_voltage",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_common_mode_voltage,
- sizeof(m_sL1CalTxIq.bbtx_common_mode_voltage));
- if (MetaResult != META_SUCCESS)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- // if (m_BbTxParaChangeFlag.b_bbtx_gain)
- {
- MetaResult = META_NVRAM_SetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_gain",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_gain,
- sizeof(m_sL1CalTxIq.bbtx_gain)
- );
- if (MetaResult != META_SUCCESS)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- // if (m_BbTxParaChangeFlag.b_bbtx_calrcsel)
- {
- MetaResult = META_NVRAM_SetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_calrcsel",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_calrcsel,
- sizeof(m_sL1CalTxIq.bbtx_calrcsel)
- );
- if (MetaResult != META_SUCCESS)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- //if (m_BbTxParaChangeFlag.b_apc_bat_low_voltage)
- {
- MetaResult = META_NVRAM_SetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.apc_bat_low_voltage",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.apc_bat_low_voltage,
- sizeof(m_sL1CalTxIq.apc_bat_low_voltage)
- );
- if (MetaResult != META_SUCCESS)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- //if (m_BbTxParaChangeFlag.b_apc_bat_high_voltage)
- {
- MetaResult = META_NVRAM_SetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.apc_bat_high_voltage",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.apc_bat_high_voltage,
- sizeof(m_sL1CalTxIq.apc_bat_high_voltage)
- );
- if (MetaResult != META_SUCCESS)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- //if (m_BbTxParaChangeFlag.b_apc_bat_low_temperature)
- {
- MetaResult = META_NVRAM_SetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.apc_bat_low_temperature",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.apc_bat_low_temperature,
- sizeof(m_sL1CalTxIq.apc_bat_low_temperature)
- );
- if (MetaResult != META_SUCCESS)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- //if (m_BbTxParaChangeFlag.b_apc_bat_high_temperature)
- {
- MetaResult = META_NVRAM_SetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.apc_bat_high_temperature",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.apc_bat_high_temperature,
- sizeof(m_sL1CalTxIq.apc_bat_high_temperature)
- );
- if (MetaResult != META_SUCCESS)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- //if (m_BbTxParaChangeFlag.b_bbtx_trimI)
- {
- MetaResult = META_NVRAM_SetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_trimI",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_trimI,
- sizeof(m_sL1CalTxIq.bbtx_trimI)
- );
- if (MetaResult != META_SUCCESS)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- //if (m_BbTxParaChangeFlag.b_bbtx_trimQ)
- {
- MetaResult = META_NVRAM_SetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_trimQ",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_trimQ,
- sizeof(m_sL1CalTxIq.bbtx_trimQ)
- );
- if (MetaResult != META_SUCCESS)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- //if (m_BbTxParaChangeFlag.b_bbtx_offsetI)
- {
- MetaResult = META_NVRAM_SetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_offsetI",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_offsetI,
- sizeof(m_sL1CalTxIq.bbtx_offsetI)
- );
- if (MetaResult != META_SUCCESS)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- //if (m_BbTxParaChangeFlag.b_bbtx_offsetQ)
- {
- MetaResult = META_NVRAM_SetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_offsetQ",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_offsetQ,
- sizeof(m_sL1CalTxIq.bbtx_offsetQ)
- );
- if (MetaResult != META_SUCCESS)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- //if (m_BbTxParaChangeFlag.b_bbtx_isCalibrated)
- {
- MetaResult = META_NVRAM_SetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_isCalibrated",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_isCalibrated,
- sizeof(m_sL1CalTxIq.bbtx_isCalibrated)
- );
- if (MetaResult != META_SUCCESS)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- if (m_eBbTxCfgVer >= BBTXCFG_VER3)
- {
- //if (m_BbTxParaChangeFlag.b_bbtx_phsel)
- {
- MetaResult = META_NVRAM_SetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_phsel",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_phsel,
- sizeof(m_sL1CalTxIq.bbtx_phsel)
- );
- if (META_SUCCESS != MetaResult)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- }
- if ((RF_ID_A60111A == m_uiFinalRfId) ||
- (RF_ID_AERO2E == m_uiFinalRfId) ||
- (RF_ID_MT6140A == m_uiFinalRfId) ||
- (RF_ID_MT6140B == m_uiFinalRfId) ||
- (RF_ID_MT6140C == m_uiFinalRfId) ||
- (RF_ID_MT6140D == m_uiFinalRfId)
- )
- {
- //if (m_BbTxParaChangeFlag.b_bbtx_common_mode_voltage_h)
- {
- MetaResult = META_NVRAM_SetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_common_mode_voltage_h",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_common_mode_voltage_h,
- sizeof(m_sL1CalTxIq.bbtx_common_mode_voltage_h)
- );
- if (META_SUCCESS != MetaResult)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- //if (m_BbTxParaChangeFlag.b_bbtx_gain_h)
- {
- MetaResult = META_NVRAM_SetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_gain_h",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_gain_h,
- sizeof(m_sL1CalTxIq.bbtx_gain_h)
- );
- if (META_SUCCESS != MetaResult)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- //if (m_BbTxParaChangeFlag.b_bbtx_calrcsel_h)
- {
- MetaResult = META_NVRAM_SetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_calrcsel_h",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_calrcsel_h,
- sizeof(m_sL1CalTxIq.bbtx_calrcsel_h)
- );
- if (META_SUCCESS != MetaResult)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- //if (m_BbTxParaChangeFlag.b_bbtx_trimI_h)
- {
- MetaResult = META_NVRAM_SetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_trimI_h",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_trimI_h,
- sizeof(m_sL1CalTxIq.bbtx_trimI_h)
- );
- if (META_SUCCESS != MetaResult)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- //if (m_BbTxParaChangeFlag.b_bbtx_trimQ_h)
- {
- MetaResult = META_NVRAM_SetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_trimQ_h",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_trimQ_h,
- sizeof(m_sL1CalTxIq.bbtx_trimQ_h)
- );
- if (META_SUCCESS != MetaResult)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- //if (m_BbTxParaChangeFlag.b_bbtx_offsetI_h)
- {
- MetaResult = META_NVRAM_SetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_offsetI_h",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_offsetI_h,
- sizeof(m_sL1CalTxIq.bbtx_offsetI_h)
- );
- if (META_SUCCESS != MetaResult)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- //if (m_BbTxParaChangeFlag.b_bbtx_offsetQ_h)
- {
- MetaResult = META_NVRAM_SetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_offsetQ_h",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_offsetQ_h,
- sizeof(m_sL1CalTxIq.bbtx_offsetQ_h)
- );
- if (META_SUCCESS != MetaResult)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- //if (m_BbTxParaChangeFlag.b_bbtx_phsel_h)
- {
- MetaResult = META_NVRAM_SetRecFieldValue("NVRAM_EF_L1_TXIQ_LID",
- "BBTXParameters.bbtx_phsel_h",
- m_cTXIQBuf,
- m_uiTXIQBufSize,
- &m_sL1CalTxIq.bbtx_phsel_h,
- sizeof(m_sL1CalTxIq.bbtx_phsel_h)
- );
- if (META_SUCCESS != MetaResult)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- }
- }
- else
- {
- MetaResult = META_NVRAM_Compose_BBTXParameters(&m_sL1CalTxIq, m_cTXIQBuf, m_uiTXIQBufSize);
- if (META_SUCCESS != MetaResult)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- }
- NVRAMMan->ConfirmCallback = ::CNF_WriteToNVRAM;
- NVRAMMan->REQ_WriteNVRAM_Start("NVRAM_EF_L1_TXIQ_LID",
- 1,
- m_uiTXIQBufSize,
- m_cTXIQBuf);
- }
- //-------------------------------------
- void CRFTXIQ::CNF_WriteToNVRAM(void)
- {
- if (!g_bIsRunning)
- {
- return;
- }
- E_METAAPP_RESULT_T state = NVRAMMan->Get_ConfirmState();
- Confirm(state);
- }
- //===========================================================================
- static const AnsiString as_SECTION_NAME = "BB TX Parameters";
- //---------------------------------------------------------------------------
- bool CRFTXIQ::TxIqSectionExist( char *filename )
- {
- TIniFile *ini_file;
- ini_file = new TIniFile( filename );
- if( ini_file == NULL ) return false;
- if( ini_file->SectionExists( as_SECTION_NAME ) )
- {
- return true;
- }
- return false;
- }
- //---------------------------------------------------------------------------
- bool CRFTXIQ::REQ_Read_From_File(char *filename, unsigned int rfmod_id, E_BBTXCFG_VER_T bbtxcfg_ver)
- {
- TIniFile *ini_file;
- ini_file = new TIniFile(filename);
- if (NULL == ini_file)
- {
- return false;
- }
- m_uiFinalRfId = rfmod_id;
- m_eBbTxCfgVer = bbtxcfg_ver;
- ResetBbTxParaChangeFlag();
- AnsiString as;
- // if (ini_file->ValueExists(as_SECTION_NAME, "BB TX common mode voltage"))
- {
- m_BbTxParaChangeFlag.b_bbtx_common_mode_voltage = true;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_common_mode_voltage = ini_file->ReadInteger(as_SECTION_NAME,
- "BB TX common mode voltage",
- 0);
- }
- //if (ini_file->ValueExists(as_SECTION_NAME, "BB TX gain"))
- {
- m_BbTxParaChangeFlag.b_bbtx_gain = true;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_gain = ini_file->ReadInteger(as_SECTION_NAME,
- "BB TX gain",
- 0);
- }
- //if (ini_file->ValueExists(as_SECTION_NAME, "BB TX calrcsel"))
- {
- m_BbTxParaChangeFlag.b_bbtx_calrcsel = true;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_calrcsel = ini_file->ReadInteger(as_SECTION_NAME,
- "BB TX calrcsel",
- 0);
- }
- //if (ini_file->ValueExists(as_SECTION_NAME, "APC bat low voltage"))
- {
- m_BbTxParaChangeFlag.b_apc_bat_low_voltage = true;
- as = ini_file->ReadString(as_SECTION_NAME,
- "APC bat low voltage",
- "0");
- m_sUiL1CalTxIq.BBTXParameters.apc_bat_low_voltage = atof(as.c_str());
- }
- //if (ini_file->ValueExists(as_SECTION_NAME, "APC bat high voltage"))
- {
- m_BbTxParaChangeFlag.b_apc_bat_high_voltage = true;
- as = ini_file->ReadString(as_SECTION_NAME,
- "APC bat high voltage",
- "0");
- m_sUiL1CalTxIq.BBTXParameters.apc_bat_high_voltage = atof(as.c_str());
- }
- //if (ini_file->ValueExists(as_SECTION_NAME, "APC bat low temperature"))
- {
- m_BbTxParaChangeFlag.b_apc_bat_low_temperature = true;
- as = ini_file->ReadString(as_SECTION_NAME,
- "APC bat low temperature",
- "0");
- m_sUiL1CalTxIq.BBTXParameters.apc_bat_low_temperature = atof(as.c_str());
- }
- //if (ini_file->ValueExists(as_SECTION_NAME, "APC bat high temperature"))
- {
- m_BbTxParaChangeFlag.b_apc_bat_high_temperature = true;
- as = ini_file->ReadString(as_SECTION_NAME,
- "APC bat high temperature",
- 0);
- m_sUiL1CalTxIq.BBTXParameters.apc_bat_high_temperature = atof(as.c_str());
- }
- //if (ini_file->ValueExists(as_SECTION_NAME, "Trim I"))
- {
- m_BbTxParaChangeFlag.b_bbtx_trimI = true;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_trimI = ini_file->ReadInteger(as_SECTION_NAME,
- "Trim I",
- 0);
- }
- //if (ini_file->ValueExists(as_SECTION_NAME, "Trim Q"))
- {
- m_BbTxParaChangeFlag.b_bbtx_trimQ = true;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_trimQ = ini_file->ReadInteger(as_SECTION_NAME,
- "Trim Q",
- 0);
- }
- //if (ini_file->ValueExists(as_SECTION_NAME, "Offset I"))
- {
- m_BbTxParaChangeFlag.b_bbtx_offsetI = true;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetI = ini_file->ReadInteger(as_SECTION_NAME,
- "Offset I",
- 0);
- }
- //if (ini_file->ValueExists(as_SECTION_NAME, "Offset Q"))
- {
- m_BbTxParaChangeFlag.b_bbtx_offsetQ = true;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetQ = ini_file->ReadInteger(as_SECTION_NAME,
- "Offset Q",
- 0);
- }
- //if (ini_file->ValueExists(as_SECTION_NAME, "Calibrated flag"))
- {
- m_BbTxParaChangeFlag.b_bbtx_isCalibrated = true;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_isCalibrated = ini_file->ReadInteger(as_SECTION_NAME,
- "Calibrated flag",
- 0);
- }
- if (bbtxcfg_ver >= BBTXCFG_VER3)
- {
- // if (ini_file->ValueExists(as_SECTION_NAME, "BB TX phasesel"))
- {
- m_BbTxParaChangeFlag.b_bbtx_phsel = true;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_phsel = ini_file->ReadInteger(as_SECTION_NAME,
- "BB TX phasesel",
- 0);
- }
- // high band paramter
- if ((RF_ID_A60111A == rfmod_id) ||
- (RF_ID_AERO2E == rfmod_id) ||
- (RF_ID_MT6140A == rfmod_id) ||
- (RF_ID_MT6140B == rfmod_id) ||
- (RF_ID_MT6140C == rfmod_id) ||
- (RF_ID_MT6140D == rfmod_id)
- )
- {
- //if (ini_file->ValueExists(as_SECTION_NAME, "High band BB TX common mode voltage"))
- {
- m_BbTxParaChangeFlag.b_bbtx_common_mode_voltage_h = true;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_common_mode_voltage_h = ini_file->ReadInteger(as_SECTION_NAME,
- "High band BB TX common mode voltage",
- 0);
- }
- //if (ini_file->ValueExists(as_SECTION_NAME, "High band BB TX gain"))
- {
- m_BbTxParaChangeFlag.b_bbtx_gain_h = true;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_gain_h = ini_file->ReadInteger(as_SECTION_NAME,
- "High band BB TX gain",
- 0);
- }
- //if (ini_file->ValueExists(as_SECTION_NAME, "High band BB TX calrcsel"))
- {
- m_BbTxParaChangeFlag.b_bbtx_calrcsel_h = true;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_calrcsel_h = ini_file->ReadInteger(as_SECTION_NAME,
- "High band BB TX calrcsel",
- 0);
- }
- //if (ini_file->ValueExists(as_SECTION_NAME, "High band Trim I"))
- {
- m_BbTxParaChangeFlag.b_bbtx_trimI_h = true;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_trimI_h = ini_file->ReadInteger(as_SECTION_NAME,
- "High band Trim I",
- 0);
- }
- // if (ini_file->ValueExists(as_SECTION_NAME, "High band Trim Q"))
- {
- m_BbTxParaChangeFlag.b_bbtx_trimQ_h = true;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_trimQ_h = ini_file->ReadInteger(as_SECTION_NAME,
- "High band Trim Q",
- 0);
- }
- //if (ini_file->ValueExists(as_SECTION_NAME, "High band Offset I"))
- {
- m_BbTxParaChangeFlag.b_bbtx_offsetI_h = true;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetI_h = ini_file->ReadInteger(as_SECTION_NAME,
- "High band Offset I",
- 0);
- }
- //if (ini_file->ValueExists(as_SECTION_NAME, "High band Offset Q"))
- {
- m_BbTxParaChangeFlag.b_bbtx_offsetQ_h = true;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetQ_h = ini_file->ReadInteger(as_SECTION_NAME,
- "High band Offset Q",
- 0);
- }
- // if (ini_file->ValueExists(as_SECTION_NAME, "High band BB TX phasesel"))
- {
- m_BbTxParaChangeFlag.b_bbtx_phsel_h = true;
- m_sUiL1CalTxIq.BBTXParameters.bbtx_phsel_h = ini_file->ReadInteger(as_SECTION_NAME,
- "High band BB TX phasesel",
- 0);
- }
- } // MT6140
- } // ver3
- Compose_BBTXParameters();
- delete ini_file;
- return true;
- }
- //===========================================================================
- bool CRFTXIQ::REQ_Write_To_File(char *filename, unsigned int rfmod_id, E_BBTXCFG_VER_T bbtxcfg_ver)
- {
- TIniFile *ini_file;
- ini_file = new TIniFile(filename);
- if (NULL == ini_file)
- {
- return false;
- }
- m_uiFinalRfId = rfmod_id;
- m_eBbTxCfgVer = bbtxcfg_ver;
- ini_file->WriteString(as_SECTION_NAME,
- "BB TX common mode voltage",
- IntToStr(m_sUiL1CalTxIq.BBTXParameters.bbtx_common_mode_voltage));
- ini_file->WriteString(as_SECTION_NAME,
- "BB TX gain",
- IntToStr(m_sUiL1CalTxIq.BBTXParameters.bbtx_gain));
- ini_file->WriteString(as_SECTION_NAME,
- "BB TX calrcsel",
- IntToStr(m_sUiL1CalTxIq.BBTXParameters.bbtx_calrcsel));
- ini_file->WriteString(as_SECTION_NAME,
- "APC bat low voltage",
- Double_To_AnsiString(m_sUiL1CalTxIq.BBTXParameters.apc_bat_low_voltage) );
- ini_file->WriteString(as_SECTION_NAME,
- "APC bat high voltage",
- Double_To_AnsiString(m_sUiL1CalTxIq.BBTXParameters.apc_bat_high_voltage) );
- ini_file->WriteString(as_SECTION_NAME,
- "APC bat low temperature",
- Double_To_AnsiString(m_sUiL1CalTxIq.BBTXParameters.apc_bat_low_temperature) );
- ini_file->WriteString(as_SECTION_NAME,
- "APC bat high temperature",
- Double_To_AnsiString(m_sUiL1CalTxIq.BBTXParameters.apc_bat_high_temperature) );
- ini_file->WriteString(as_SECTION_NAME,
- "Trim I",
- IntToStr(m_sUiL1CalTxIq.BBTXParameters.bbtx_trimI));
- ini_file->WriteString(as_SECTION_NAME,
- "Trim Q",
- IntToStr(m_sUiL1CalTxIq.BBTXParameters.bbtx_trimQ));
- ini_file->WriteString(as_SECTION_NAME,
- "Offset I",
- IntToStr(m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetI));
- ini_file->WriteString(as_SECTION_NAME,
- "Offset Q",
- IntToStr(m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetQ));
- ini_file->WriteString(as_SECTION_NAME,
- "Calibrated flag",
- IntToStr(m_sUiL1CalTxIq.BBTXParameters.bbtx_isCalibrated));
- if (m_eBbTxCfgVer >= BBTXCFG_VER3)
- {
- ini_file->WriteString(as_SECTION_NAME,
- "BB TX phasesel",
- IntToStr(m_sUiL1CalTxIq.BBTXParameters.bbtx_phsel));
- }
- // high band paramter
- if ((RF_ID_A60111A == rfmod_id) ||
- (RF_ID_AERO2E == rfmod_id) ||
- (RF_ID_MT6140A == rfmod_id) ||
- (RF_ID_MT6140B == rfmod_id) ||
- (RF_ID_MT6140C == rfmod_id) ||
- (RF_ID_MT6140D == rfmod_id)
- )
- {
- ini_file->WriteString(as_SECTION_NAME,
- "High band BB TX common mode voltage",
- IntToStr(m_sUiL1CalTxIq.BBTXParameters.bbtx_common_mode_voltage_h));
- ini_file->WriteString(as_SECTION_NAME,
- "High band BB TX gain",
- IntToStr(m_sUiL1CalTxIq.BBTXParameters.bbtx_gain_h) );
- ini_file->WriteString( as_SECTION_NAME,
- "High band BB TX calrcsel",
- IntToStr(m_sUiL1CalTxIq.BBTXParameters.bbtx_calrcsel_h) );
- ini_file->WriteString( as_SECTION_NAME,
- "High band Trim I",
- IntToStr(m_sUiL1CalTxIq.BBTXParameters.bbtx_trimI_h) );
- ini_file->WriteString( as_SECTION_NAME,
- "High band Trim Q",
- IntToStr(m_sUiL1CalTxIq.BBTXParameters.bbtx_trimQ_h) );
- ini_file->WriteString( as_SECTION_NAME,
- "High band Offset I",
- IntToStr(m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetI_h) );
- ini_file->WriteString( as_SECTION_NAME,
- "High band Offset Q",
- IntToStr(m_sUiL1CalTxIq.BBTXParameters.bbtx_offsetQ_h) );
- ini_file->WriteString( as_SECTION_NAME,
- "High band BB TX phasesel",
- IntToStr( m_sUiL1CalTxIq.BBTXParameters.bbtx_phsel_h ) );
- }
-
-
- delete ini_file;
- return true;
- }
- //===========================================================================
- /////////////////////// Run time setting ///////////////////////////////
- //===========================================================================
- //===========================================================================
- //////////////////////////// Global information ///////////////////////////
- //===========================================================================
- E_METAAPP_RESULT_T CRFTXIQ::Get_ConfirmState(void)
- {
- return m_eConfirmState;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- BBTXParameters_T* CRFTXIQ::Get_BBTXParameters(void)
- {
- return &m_sL1CalTxIq;
- }
- //---------------------------------------------------------------------------
- void CRFTXIQ::Set_BBTXParameters(BBTXParameters_T l1cal_txiq_par)
- {
- m_sL1CalTxIq = l1cal_txiq_par;
- DeCompose_BBTXParameters();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_UI_L1CAL_TXIQ* CRFTXIQ::Get_UiBBTXParameters(void)
- {
- return &m_sUiL1CalTxIq;
- }
- //---------------------------------------------------------------------------
- void CRFTXIQ::Set_UiBBTXParameters(E_BBTXCFG_VER_T eBbTxCfgVer, unsigned int rf_id, S_UI_L1CAL_TXIQ l1cal_txiq_par)
- {
- m_eBbTxCfgVer = eBbTxCfgVer;
- m_uiFinalRfId = rf_id;
- m_sUiL1CalTxIq = l1cal_txiq_par;
- SetBbTxParaChangeFlag();
- Compose_BBTXParameters();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFTXIQ::Set_BBTXChangeFlag(S_BBTXPARA_CHANGE_FLAG_T flag)
- {
- m_BbTxParaChangeFlag = flag;
- }