rf_mt6140creg.cpp
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:69k
- /*****************************************************************************
- * 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_mt6140creg.cpp
- *
- * Project:
- * --------
- * Maui META APP
- *
- * Description:
- * ------------
- * MT6140C register read/write 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_MT6140CREG_H_
- #include "rf_mt6140creg.h"
- #endif
- #ifndef _MAN_ACTIVE_H_
- #include "man_active.h"
- #endif
- //===========================================================================
- static CRFMT6140CREG* rf_mt6140reg_ptr;
- static bool g_bIsRunning;
- // MT6140 All
- //----------------------------------------------------------------------------
- static void Get_MT6140AllFromReg( void )
- {
- rf_mt6140reg_ptr->Get_MT6140AllFromReg();
- }
- //----------------------------------------------------------------------------
- static void Set_MT6140AllToReg( void )
- { rf_mt6140reg_ptr->Set_MT6140AllToReg();
- }
- // MT6140 CW0
- //----------------------------------------------------------------------------
- static void Set_MT6140CW0ToReg( void )
- { rf_mt6140reg_ptr->Set_MT6140CW0ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140CW0FromReg( void )
- { rf_mt6140reg_ptr->Get_MT6140CW0FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW1
- static void Set_MT6140CW1ToReg( void )
- { rf_mt6140reg_ptr->Set_MT6140CW1ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140CW1FromReg( void )
- { rf_mt6140reg_ptr->Get_MT6140CW1FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW2
- static void Set_MT6140CW2ToReg( void )
- { rf_mt6140reg_ptr->Set_MT6140CW2ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140CW2FromReg( void )
- { rf_mt6140reg_ptr->Get_MT6140CW2FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW3
- static void Set_MT6140CCW3ToReg( void )
- { rf_mt6140reg_ptr->Set_MT6140CCW3ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140CCW3FromReg( void )
- { rf_mt6140reg_ptr->Get_MT6140CCW3FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW4
- static void Set_MT6140CCW4ToReg( void )
- { rf_mt6140reg_ptr->Set_MT6140CCW4ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140CCW4FromReg( void )
- { rf_mt6140reg_ptr->Get_MT6140CCW4FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW5
- static void Set_MT6140CCW5ToReg( void )
- { rf_mt6140reg_ptr->Set_MT6140CCW5ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140CCW5FromReg( void )
- { rf_mt6140reg_ptr->Get_MT6140CCW5FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW6
- static void Set_MT6140CW6ToReg( void )
- { rf_mt6140reg_ptr->Set_MT6140CW6ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140CW6FromReg( void )
- { rf_mt6140reg_ptr->Get_MT6140CW6FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW7
- static void Set_MT6140CCW7ToReg( void )
- { rf_mt6140reg_ptr->Set_MT6140CCW7ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140CCW7FromReg( void )
- { rf_mt6140reg_ptr->Get_MT6140CCW7FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW8
- static void Set_MT6140CW8ToReg( void )
- { rf_mt6140reg_ptr->Set_MT6140CW8ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140CW8FromReg( void )
- { rf_mt6140reg_ptr->Get_MT6140CW8FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW9
- static void Set_MT6140CCW9ToReg( void )
- { rf_mt6140reg_ptr->Set_MT6140CCW9ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140CCW9FromReg( void )
- { rf_mt6140reg_ptr->Get_MT6140CCW9FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW10
- static void Set_MT6140CW10ToReg( void )
- { rf_mt6140reg_ptr->Set_MT6140CW10ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140CW10FromReg( void )
- { rf_mt6140reg_ptr->Get_MT6140CW10FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW11
- static void Set_MT6140CCW11ToReg( void )
- { rf_mt6140reg_ptr->Set_MT6140CCW11ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140CCW11FromReg( void )
- { rf_mt6140reg_ptr->Get_MT6140CCW11FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW12
- static void Set_MT6140CCW12ToReg( void )
- { rf_mt6140reg_ptr->Set_MT6140CCW12ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140CCW12FromReg( void )
- { rf_mt6140reg_ptr->Get_MT6140CCW12FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW15
- static void Set_MT6140CW15ToReg( void )
- { rf_mt6140reg_ptr->Set_MT6140CW15ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140CW15FromReg( void )
- { rf_mt6140reg_ptr->Get_MT6140CW15FromReg();
- }
- //===========================================================================
- CRFMT6140CREG::CRFMT6140CREG( void )
- {
- g_bIsRunning = false;
- ConfirmCallback = 0;
- m_bIsMT6140All = false;
- }
- //---------------------------------------------------------------------------
- CRFMT6140CREG::~CRFMT6140CREG()
- {
- g_bIsRunning = false;
- ConfirmCallback = 0;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140CREG::REQ_Stop(void)
- {
- if (!g_bIsRunning)
- {
- return;
- }
- Confirm(METAAPP_STOP);
- }
- //---------------------------------------------------------------------------
- void CRFMT6140CREG::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);
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// All /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140AllToReg_Start( unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = true;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140AllToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140AllToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- ActiveMan->SetActiveFunction( ::Set_MT6140CW0ToReg );
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Get_MT6140AllFromReg_Start( unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = true;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140AllFromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Get_MT6140AllFromReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- ActiveMan->SetActiveFunction( ::Get_MT6140CW0FromReg );
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW0 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Compose_MT6140CW0( S_MT6140_CW0 &mt6140_cw0_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (mt6140_cw0_par.uc_por << 18) |
- (mt6140_cw0_par.uc_gpo << 17) |
- (mt6140_cw0_par.uc_tx_mod_bpi << 16) |
- (mt6140_cw0_par.uc_vcosel << 15) |
- (mt6140_cw0_par.uc_afc << 9) |
- (mt6140_cw0_par.uc_flt << 8) |
- (mt6140_cw0_par.uc_dien << 7) |
- (mt6140_cw0_par.uc_synpw << 6) |
- (mt6140_cw0_par.uc_syncp << 4) |
- ADDR_MT6140_CW0;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140CREG::DeCompose_MT6140CW0( unsigned int reg_data, S_MT6140_CW0 &mt6140_cw0_par, unsigned int rf_id )
- {
- mt6140_cw0_par.uc_por = (reg_data >>14) & 0x01;
- mt6140_cw0_par.uc_gpo = (reg_data >>13) & 0x01;
- mt6140_cw0_par.uc_tx_mod_bpi = (reg_data >>12) & 0x01;
- mt6140_cw0_par.uc_vcosel = (reg_data >>11) & 0x01;
- mt6140_cw0_par.uc_afc = (reg_data >> 5) & 0x3F;
- mt6140_cw0_par.uc_flt = (reg_data >> 4) & 0x01;
- mt6140_cw0_par.uc_dien = (reg_data >> 3) & 0x01;
- mt6140_cw0_par.uc_synpw = (reg_data >> 2) & 0x01;
- mt6140_cw0_par.uc_syncp = reg_data & 0x03;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Set_MT6140CW0ToReg_Start( S_MT6140_CW0 &mt6140_cw0_par, unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140CW0 = mt6140_cw0_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140CW0ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CW0ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6140CW0( m_sMT6140CW0, bsi_data, m_uiFinalRfid );
- META_RESULT MetaResult = META_Rf_SetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, bsi_data);
- if (MetaResult!=META_SUCCESS)
- {
- if (MetaResult != META_TIMEOUT)
- {
- Confirm(METAAPP_FAIL);
- return;
- }
- else
- {
- Confirm(METAAPP_TIMEOUT);
- return;
- }
- }
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6140CW1ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Get_MT6140CW0FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140CW0FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Get_MT6140CW0FromReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int reg_data;
- META_RESULT MetaResult = META_Rf_GetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, ADDR_MT6140_AUXOUT_CW0, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6140CW0( reg_data, m_sMT6140CW0, m_uiFinalRfid);
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6140CW1FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW1 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Compose_MT6140CW1( S_MT6140_CW1 &mt6140_cw1_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (mt6140_cw1_par.uc_trx << 22) |
- (mt6140_cw1_par.uc_band << 20) |
- (mt6140_cw1_par.uc_bufmode << 19) |
- (mt6140_cw1_par.uc_n_integer << 12) |
- (mt6140_cw1_par.uc_n_fraction << 4) |
- ADDR_MT6140_CW1;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140CREG::DeCompose_MT6140CW1( unsigned int reg_data, S_MT6140_CW1 &mt6140_cw1_par, unsigned int rf_id )
- {
- mt6140_cw1_par.uc_trx = (reg_data >> 18) & 0X01;
- mt6140_cw1_par.uc_band = (reg_data >> 16) & 0X03;
- mt6140_cw1_par.uc_bufmode = (reg_data >> 15) & 0X01;
- mt6140_cw1_par.uc_n_integer = (reg_data >> 8) & 0X7F;
- mt6140_cw1_par.uc_n_fraction = reg_data & 0xFF;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Set_MT6140CW1ToReg_Start( S_MT6140_CW1 &mt6140_cw1_par, unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140CW1 = mt6140_cw1_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140CW1ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CW1ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6140CW1( m_sMT6140CW1, bsi_data, m_uiFinalRfid );
- META_RESULT MetaResult = META_Rf_SetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, bsi_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6140CW2ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Get_MT6140CW1FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140CW1FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Get_MT6140CW1FromReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int reg_data;
- META_RESULT MetaResult = META_Rf_GetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, ADDR_MT6140_AUXOUT_CW1, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6140CW1( reg_data, m_sMT6140CW1, m_uiFinalRfid );
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6140CW2FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW2 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Compose_MT6140CW2( S_MT6140_CW2 &mt6140_cw2_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (mt6140_cw2_par.uc_dc_dac_ai << 20) |
- (mt6140_cw2_par.uc_dc_dac_aq << 14) |
- (mt6140_cw2_par.uc_auto_cal << 13) |
- (mt6140_cw2_par.uc_mode << 10) |
- (mt6140_cw2_par.uc_gain_table << 4 ) |
- ADDR_MT6140_CW2;
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::DeCompose_MT6140CW2( unsigned int reg_data, S_MT6140_CW2 &mt6140_cw2_par, unsigned int rf_id )
- {
- mt6140_cw2_par.uc_dc_dac_ai = (reg_data >> 16) & 0x3F;
- mt6140_cw2_par.uc_dc_dac_aq = (reg_data >> 10) & 0x3F;
- mt6140_cw2_par.uc_auto_cal = (reg_data >> 9) & 0x01;
- mt6140_cw2_par.uc_mode = (reg_data >> 6) & 0x07;
- mt6140_cw2_par.uc_gain_table = (reg_data ) & 0x3F;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Set_MT6140CW2ToReg_Start( S_MT6140_CW2 &mt6140_cw2_par, unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140CW2 = mt6140_cw2_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140CW2ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CW2ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6140CW2( m_sMT6140CW2, bsi_data, m_uiFinalRfid);
- META_RESULT MetaResult = META_Rf_SetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, bsi_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6140CCW3ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Get_MT6140CW2FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140CW2FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Get_MT6140CW2FromReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int reg_data;
- META_RESULT MetaResult = META_Rf_GetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, ADDR_MT6140_AUXOUT_CW2, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6140CW2( reg_data, m_sMT6140CW2, m_uiFinalRfid );
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6140CCW3FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW3 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Compose_MT6140CCW3( S_MT6140C_CW3 &mt6140c_cw3_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (mt6140c_cw3_par.uc_txdbuf << 22) |
- (mt6140c_cw3_par.uc_txgbuf << 21) |
- (mt6140c_cw3_par.uc_txdiv4 << 20) |
- (mt6140c_cw3_par.uc_txdiv2 << 19) |
- (mt6140c_cw3_par.uc_txdiqm << 18) |
- (mt6140c_cw3_par.uc_txgiqm << 17) |
- (mt6140c_cw3_par.uc_txctl << 16) |
- (mt6140c_cw3_par.uc_rxbufp << 13) |
- (mt6140c_cw3_par.uc_syncompp << 12) |
- (mt6140c_cw3_par.uc_rfmixp << 11) |
- (mt6140c_cw3_par.uc_rflnap << 10) |
- (mt6140c_cw3_par.uc_syndivp << 9) |
- (mt6140c_cw3_par.uc_synpfdp << 8) |
- (mt6140c_cw3_par.uc_rxdivp << 7) |
- (mt6140c_cw3_par.uc_ifpgap2 << 6) |
- (mt6140c_cw3_par.uc_ifpgap1 << 5) |
- (mt6140c_cw3_par.uc_ifpolp << 4) |
- ADDR_MT6140_CW3;
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::DeCompose_MT6140CCW3( unsigned int reg_data, S_MT6140C_CW3 &mt6140c_cw3_par, unsigned int rf_id )
- {
- mt6140c_cw3_par.uc_rfmixp = (reg_data >> 7) & 0x01;
- mt6140c_cw3_par.uc_rflnap = (reg_data >> 6) & 0x01;
- mt6140c_cw3_par.uc_syndivp = (reg_data >> 5) & 0x01;
- mt6140c_cw3_par.uc_synpfdp = (reg_data >> 4) & 0x01;
- mt6140c_cw3_par.uc_rxdivp = (reg_data >> 3) & 0x01;
- mt6140c_cw3_par.uc_ifpgap2 = (reg_data >> 2) & 0x01;
- mt6140c_cw3_par.uc_ifpgap1 = (reg_data >> 1) & 0x01;
- mt6140c_cw3_par.uc_ifpolp = reg_data & 0x01;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Set_MT6140CCW3ToReg_Start( S_MT6140C_CW3 &mt6140c_cw3_par, unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140CCW3 = mt6140c_cw3_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140CCW3ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CCW3ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6140CCW3( m_sMT6140CCW3, bsi_data, m_uiFinalRfid );
- META_RESULT MetaResult = META_Rf_SetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, bsi_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6140CCW4ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Get_MT6140CCW3FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140CCW3FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Get_MT6140CCW3FromReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int reg_data;
- META_RESULT MetaResult = META_Rf_GetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, ADDR_MT6140_AUXOUT_CW3, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6140CCW3( reg_data, m_sMT6140CCW3, m_uiFinalRfid);
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6140CCW4FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW4 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Compose_MT6140CCW4( S_MT6140C_CW4 &mt6140c_cw4_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (mt6140c_cw4_par.uc_bgon_delay<< 21) |
- (mt6140c_cw4_par.uc_sxicp_sw << 20) |
- (mt6140c_cw4_par.uc_otaen << 19) |
- (mt6140c_cw4_par.uc_fldis << 18) |
- (mt6140c_cw4_par.uc_cal_delay << 16) |
- (mt6140c_cw4_par.uc_vco_vset << 14) |
- (mt6140c_cw4_par.uc_dread << 13) |
- (mt6140c_cw4_par.uc_calmode << 11) |
- (mt6140c_cw4_par.uc_lgac << 10) |
- (mt6140c_cw4_par.uc_c_fra_in << 9) |
- (mt6140c_cw4_par.uc_sxrstdiv << 8) |
- (mt6140c_cw4_par.uc_syntyp << 7) |
- (mt6140c_cw4_par.uc_synpfd << 5) |
- (mt6140c_cw4_par.uc_sca_cr_fi << 4) |
- ADDR_MT6140_CW4;
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::DeCompose_MT6140CCW4( unsigned int reg_data, S_MT6140C_CW4 &mt6140c_cw4_par, unsigned int rf_id )
- {
- mt6140c_cw4_par.uc_bgon_delay= (reg_data >>18) & 0x03;
- mt6140c_cw4_par.uc_sxicp_sw = (reg_data >>16) & 0x03;
- mt6140c_cw4_par.uc_otaen = (reg_data >>15) & 0x01;
- mt6140c_cw4_par.uc_fldis = (reg_data >>14) & 0x01;
- mt6140c_cw4_par.uc_cal_delay = (reg_data >>12) & 0x03;
- mt6140c_cw4_par.uc_vco_vset = (reg_data >>10) & 0x03;
- mt6140c_cw4_par.uc_dread = (reg_data >> 9) & 0x01;
- mt6140c_cw4_par.uc_calmode = (reg_data >> 7) & 0x03;
- mt6140c_cw4_par.uc_lgac = (reg_data >> 6) & 0x01;
- mt6140c_cw4_par.uc_c_fra_in = (reg_data >> 5) & 0x01;
- mt6140c_cw4_par.uc_sxrstdiv = (reg_data >> 4) & 0x01;
- mt6140c_cw4_par.uc_syntyp = (reg_data >> 3) & 0x01;
- mt6140c_cw4_par.uc_synpfd = (reg_data >> 1) & 0x03;
- mt6140c_cw4_par.uc_sca_cr_fi = reg_data & 0x01;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Set_MT6140CCW4ToReg_Start( S_MT6140C_CW4 &mt6140c_cw4_par, unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140CCW4 = mt6140c_cw4_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140CCW4ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CCW4ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6140CCW4( m_sMT6140CCW4, bsi_data, m_uiFinalRfid );
- META_RESULT MetaResult = META_Rf_SetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, bsi_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6140CCW5ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Get_MT6140CCW4FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140CCW4FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Get_MT6140CCW4FromReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int reg_data;
- META_RESULT MetaResult = META_Rf_GetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, ADDR_MT6140_AUXOUT_CW4, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6140CCW4( reg_data, m_sMT6140CCW4, m_uiFinalRfid);
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6140CCW5FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW5 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Compose_MT6140CCW5( S_MT6140C_CW5 &mt6140c_cw5_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (mt6140c_cw5_par.uc_rx_ft0 << 15) |
- (mt6140c_cw5_par.uc_rx_ft1 << 14) |
- (mt6140c_cw5_par.uc_resb << 9) |
- (mt6140c_cw5_par.uc_res << 4) |
- ADDR_MT6140_CW5;
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::DeCompose_MT6140CCW5( unsigned int reg_data, S_MT6140C_CW5 &mt6140c_cw5_par, unsigned int rf_id )
- {
- mt6140c_cw5_par.uc_rx_ft0 = (reg_data >> 11) & 0x01;
- mt6140c_cw5_par.uc_rx_ft1 = (reg_data >> 10) & 0x01;
- mt6140c_cw5_par.uc_resb = (reg_data >> 5) & 0x1F;
- mt6140c_cw5_par.uc_res = reg_data & 0x1F;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Set_MT6140CCW5ToReg_Start( S_MT6140C_CW5 &mt6140c_cw5_par, unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140CCW5 = mt6140c_cw5_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140CCW5ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CCW5ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6140CCW5( m_sMT6140CCW5, bsi_data, m_uiFinalRfid );
- META_RESULT MetaResult = META_Rf_SetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, bsi_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6140CW6ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Get_MT6140CCW5FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140CCW5FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Get_MT6140CCW5FromReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int reg_data;
- META_RESULT MetaResult = META_Rf_GetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, ADDR_MT6140_AUXOUT_CW5, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6140CCW5( reg_data, m_sMT6140CCW5, m_uiFinalRfid );
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6140CW6FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW6 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Compose_MT6140CW6( S_MT6140_CW6 &mt6140_cw6_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (mt6140_cw6_par.uc_t_clk << 16) |
- (mt6140_cw6_par.uc_t_latch << 15) |
- (mt6140_cw6_par.uc_vco_bufp << 14) |
- (mt6140_cw6_par.uc_monitor << 13) |
- (mt6140_cw6_par.uc_sio5 << 12) |
- (mt6140_cw6_par.uc_vco_sca << 5) |
- (mt6140_cw6_par.uc_vcoset << 4) |
- ADDR_MT6140_CW6;
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::DeCompose_MT6140CW6( unsigned int reg_data, S_MT6140_CW6 &mt6140_cw6_par, unsigned int rf_id )
- {
- mt6140_cw6_par.uc_t_clk = (reg_data >> 12) & 0x01;
- mt6140_cw6_par.uc_t_latch = (reg_data >> 11) & 0x01;
- mt6140_cw6_par.uc_vco_bufp = (reg_data >> 10) & 0x01;
- mt6140_cw6_par.uc_monitor = (reg_data >> 9) & 0x01;
- mt6140_cw6_par.uc_sio5 = (reg_data >> 8) & 0x01;
- mt6140_cw6_par.uc_vco_sca = (reg_data >> 1) & 0x7F;
- mt6140_cw6_par.uc_vcoset = reg_data & 0x01;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Set_MT6140CW6ToReg_Start( S_MT6140_CW6 &mt6140_cw6_par, unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140CW6 = mt6140_cw6_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140CW6ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CW6ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6140CW6( m_sMT6140CW6, bsi_data, m_uiFinalRfid );
- META_RESULT MetaResult = META_Rf_SetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, bsi_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6140CCW7ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Get_MT6140CW6FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140CW6FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Get_MT6140CW6FromReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int reg_data;
- META_RESULT MetaResult = META_Rf_GetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, ADDR_MT6140_AUXOUT_CW6, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6140CW6( reg_data, m_sMT6140CW6, m_uiFinalRfid );
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6140CCW7FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW7 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Compose_MT6140CCW7( S_MT6140C_CW7 &mt6140c_cw7_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (mt6140c_cw7_par.uc_man_code << 13) |
- (mt6140c_cw7_par.uc_auto_gain_select << 12) |
- (mt6140c_cw7_par.uc_rx_gain << 4) |
- ADDR_MT6140_CW7;
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::DeCompose_MT6140CCW7( unsigned int reg_data, S_MT6140C_CW7 &mt6140c_cw7_par, unsigned int rf_id )
- {
- mt6140c_cw7_par.uc_man_code = (reg_data>>9) & 0x01;
- mt6140c_cw7_par.uc_auto_gain_select = (reg_data>>8) & 0x01;
- mt6140c_cw7_par.uc_rx_gain = reg_data & 0xFF;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Set_MT6140CCW7ToReg_Start( S_MT6140C_CW7 &mt6140c_cw7_par, unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140CCW7 = mt6140c_cw7_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140CCW7ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CCW7ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6140CCW7( m_sMT6140CCW7, bsi_data, m_uiFinalRfid );
- META_RESULT MetaResult = META_Rf_SetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(),500, bsi_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6140CW8ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Get_MT6140CCW7FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140CCW7FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Get_MT6140CCW7FromReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int reg_data;
- META_RESULT MetaResult = META_Rf_GetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, ADDR_MT6140_AUXOUT_CW7, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6140CCW7( reg_data, m_sMT6140CCW7, m_uiFinalRfid );
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6140CW8FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW8 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Compose_MT6140CW8( S_MT6140_CW8 &mt6140_cw8_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (mt6140_cw8_par.uc_rx_ctrl_sw3 << 23) |
- (mt6140_cw8_par.uc_rx_ctrl_sw2 << 22) |
- (mt6140_cw8_par.uc_rx_ctrl_sw1 << 21) |
- (mt6140_cw8_par.uc_rx_ctrl_swb << 20) |
- (mt6140_cw8_par.uc_rx_ctrl_swa << 19) |
- (mt6140_cw8_par.uc_rx_ctrl_swen << 18) |
- (mt6140_cw8_par.uc_dc_dac_bi << 11) |
- (mt6140_cw8_par.uc_dc_dac_ci << 4) |
- ADDR_MT6140_CW8;
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::DeCompose_MT6140CW8( unsigned int reg_data, S_MT6140_CW8 &mt6140_cw8_par, unsigned int rf_id )
- {
- mt6140_cw8_par.uc_rx_ctrl_sw3 = (reg_data>>19) & 0x01;
- mt6140_cw8_par.uc_rx_ctrl_sw2 = (reg_data>>18) & 0x01;
- mt6140_cw8_par.uc_rx_ctrl_sw1 = (reg_data>>17) & 0x01;
- mt6140_cw8_par.uc_rx_ctrl_swb = (reg_data>>16) & 0x01;
- mt6140_cw8_par.uc_rx_ctrl_swa = (reg_data>>15) & 0x01;
- mt6140_cw8_par.uc_rx_ctrl_swen = (reg_data>>14) & 0x01;
- mt6140_cw8_par.uc_dc_dac_bi = (reg_data>>7 ) & 0x7F;
- mt6140_cw8_par.uc_dc_dac_ci = (reg_data ) & 0x7F;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Set_MT6140CW8ToReg_Start( S_MT6140_CW8 &mt6140_cw8_par, unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140CW8 = mt6140_cw8_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140CW8ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CW8ToReg( void )
- {
- unsigned int bsi_data;
- Compose_MT6140CW8( m_sMT6140CW8, bsi_data, m_uiFinalRfid );
- META_RESULT MetaResult = META_Rf_SetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, bsi_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6140CCW9ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Get_MT6140CW8FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140CW8FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Get_MT6140CW8FromReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int reg_data;
- META_RESULT MetaResult = META_Rf_GetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, ADDR_MT6140_AUXOUT_CW8, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6140CW8( reg_data, m_sMT6140CW8, m_uiFinalRfid );
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6140CCW9FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW9 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Compose_MT6140CCW9( S_MT6140C_CW9 &mt6140c_cw9_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (mt6140c_cw9_par.uc_enable_am << 21) |
- (mt6140c_cw9_par.uc_pwr_dac_a << 20) |
- (mt6140c_cw9_par.uc_pwr_dac_b << 19) |
- (mt6140c_cw9_par.uc_pwr_dac_c << 18) |
- (mt6140c_cw9_par.uc_dc_dac_bq << 11) |
- (mt6140c_cw9_par.uc_dc_dac_cq << 4) |
- ADDR_MT6140_CW9;
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::DeCompose_MT6140CCW9( unsigned int reg_data, S_MT6140C_CW9 &mt6140c_cw9_par, unsigned int rf_id )
- {
- mt6140c_cw9_par.uc_enable_am = (reg_data>>17) & 0x01;
- mt6140c_cw9_par.uc_pwr_dac_a = (reg_data>>16) & 0x01;
- mt6140c_cw9_par.uc_pwr_dac_b = (reg_data>>15) & 0x01;
- mt6140c_cw9_par.uc_pwr_dac_c = (reg_data>>14) & 0x01;
- mt6140c_cw9_par.uc_dc_dac_bq = (reg_data>>7 ) & 0x7F;
- mt6140c_cw9_par.uc_dc_dac_cq = (reg_data ) & 0x7F;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Set_MT6140CCW9ToReg_Start( S_MT6140C_CW9 &mt6140c_cw9_par, unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140CCW9 = mt6140c_cw9_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140CCW9ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CCW9ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6140CCW9( m_sMT6140CCW9, bsi_data, m_uiFinalRfid );
- META_RESULT MetaResult = META_Rf_SetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, bsi_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6140CW10ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Get_MT6140CCW9FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140CCW9FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Get_MT6140CCW9FromReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int reg_data;
- META_RESULT MetaResult = META_Rf_GetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, ADDR_MT6140_AUXOUT_CW9, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6140CCW9( reg_data, m_sMT6140CCW9, m_uiFinalRfid );
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6140CW10FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW10 ////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Compose_MT6140CW10( S_MT6140_CW10 &m_sMT6140CW10_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (m_sMT6140CW10_par.uc_am_daci << 11) |
- (m_sMT6140CW10_par.uc_am_dacq << 4) |
- ADDR_MT6140_CW10;
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::DeCompose_MT6140CW10( unsigned int reg_data, S_MT6140_CW10 &m_sMT6140CW10_par, unsigned int rf_id )
- {
- m_sMT6140CW10_par.uc_am_daci = (reg_data >> 7) & 0xFF;
- m_sMT6140CW10_par.uc_am_dacq = reg_data & 0xFF;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Set_MT6140CW10ToReg_Start( S_MT6140_CW10 &mt6140_cw10_par, unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140CW10 = mt6140_cw10_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140CW10ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CW10ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6140CW10( m_sMT6140CW10, bsi_data, m_uiFinalRfid );
- META_RESULT MetaResult = META_Rf_SetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, bsi_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6140CCW11ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Get_MT6140CW10FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140CW10FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Get_MT6140CW10FromReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int reg_data;
- META_RESULT MetaResult = META_Rf_GetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, ADDR_MT6140_AUXOUT_CW10, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6140CW10( reg_data, m_sMT6140CW10, m_uiFinalRfid );
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6140CCW11FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW11 ////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Compose_MT6140CCW11( S_MT6140C_CW11 &mt6140c_cw11_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (mt6140c_cw11_par.uc_divb_sel << 24) |
- (mt6140c_cw11_par.uc_txqos_vgaic << 21) |
- (mt6140c_cw11_par.uc_txios_tc << 18) |
- (mt6140c_cw11_par.uc_txdiv4_il_gl<< 17) |
- (mt6140c_cw11_par.uc_hbmod_gc1 << 16) |
- (mt6140c_cw11_par.uc_hbmod_gc0 << 15) |
- (mt6140c_cw11_par.uc_lbmod_gc0 << 14) |
- (mt6140c_cw11_par.uc_apc_sel << 13) |
- (mt6140c_cw11_par.uc_txdiv_gc1 << 12) |
- (mt6140c_cw11_par.uc_txdiv_gc0 << 11) |
- (mt6140c_cw11_par.uc_txvapc << 8) |
- (mt6140c_cw11_par.uc_tx_itc3 << 7) |
- (mt6140c_cw11_par.uc_tx_itc2 << 6) |
- (mt6140c_cw11_par.uc_tx_itc1 << 5) |
- (mt6140c_cw11_par.uc_tx_itc0 << 4) |
- ADDR_MT6140_CW11;
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::DeCompose_MT6140CCW11( unsigned int reg_data, S_MT6140C_CW11 &mt6140c_cw11_par, unsigned int rf_id )
- {
- mt6140c_cw11_par.uc_divb_sel = (reg_data >> 20) & 0x03;
- mt6140c_cw11_par.uc_txqos_vgaic = (reg_data >> 17) & 0x07;
- mt6140c_cw11_par.uc_txios_tc = (reg_data >> 14) & 0x07;
- mt6140c_cw11_par.uc_txdiv4_il_gl = (reg_data >> 13) & 0x01;
- mt6140c_cw11_par.uc_txdiv_gc1 = (reg_data >> 15) & 0x01;
- mt6140c_cw11_par.uc_txdiv4_il_gl = (reg_data >> 13) & 0x01;
- mt6140c_cw11_par.uc_hbmod_gc1 = (reg_data >> 12) & 0x01;
- mt6140c_cw11_par.uc_hbmod_gc0 = (reg_data >> 11) & 0x01;
- mt6140c_cw11_par.uc_lbmod_gc0 = (reg_data >> 10) & 0x01;
- mt6140c_cw11_par.uc_apc_sel = (reg_data >> 9) & 0x01;
- mt6140c_cw11_par.uc_txdiv_gc1 = (reg_data >> 8) & 0x01;
- mt6140c_cw11_par.uc_txdiv_gc0 = (reg_data >> 7) & 0x01;
- mt6140c_cw11_par.uc_txvapc = (reg_data >> 4) & 0x07;
- mt6140c_cw11_par.uc_tx_itc3 = (reg_data >> 3) & 0x01;
- mt6140c_cw11_par.uc_tx_itc2 = (reg_data >> 2) & 0x01;
- mt6140c_cw11_par.uc_tx_itc1 = (reg_data >> 1) & 0x01;
- mt6140c_cw11_par.uc_tx_itc0 = reg_data & 0x01;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Set_MT6140CCW11ToReg_Start( S_MT6140C_CW11 &mt6140c_cw11_par, unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140CCW11 = mt6140c_cw11_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140CCW11ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CCW11ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6140CCW11( m_sMT6140CCW11, bsi_data, m_uiFinalRfid );
- META_RESULT MetaResult = META_Rf_SetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, bsi_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6140CCW12ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Get_MT6140CCW11FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140CCW11FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Get_MT6140CCW11FromReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int reg_data;
- META_RESULT MetaResult = META_Rf_GetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, ADDR_MT6140_AUXOUT_CW11, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6140CCW11( reg_data, m_sMT6140CCW11, m_uiFinalRfid );
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6140CCW12FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW12 ////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Compose_MT6140CCW12( S_MT6140C_CW12 &mt6140c_cw12_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (mt6140c_cw12_par.uc_divb_sel << 24) |
- (mt6140c_cw12_par.uc_txqos_vgaic << 21) |
- (mt6140c_cw12_par.uc_txios_tc << 18) |
- (mt6140c_cw12_par.uc_txdiv4_il_gl<< 17) |
- (mt6140c_cw12_par.uc_hbmod_gc1 << 16) |
- (mt6140c_cw12_par.uc_hbmod_gc0 << 15) |
- (mt6140c_cw12_par.uc_lbmod_gc0 << 14) |
- (mt6140c_cw12_par.uc_apc_sel << 13) |
- (mt6140c_cw12_par.uc_txdiv_gc1 << 12) |
- (mt6140c_cw12_par.uc_txdiv_gc0 << 11) |
- (mt6140c_cw12_par.uc_txvapc << 8) |
- (mt6140c_cw12_par.uc_tx_itc3 << 7) |
- (mt6140c_cw12_par.uc_tx_itc2 << 6) |
- (mt6140c_cw12_par.uc_tx_itc1 << 5) |
- (mt6140c_cw12_par.uc_tx_itc0 << 4) |
- ADDR_MT6140_CW12;
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::DeCompose_MT6140CCW12( unsigned int reg_data, S_MT6140C_CW12 &mt6140c_cw12_par, unsigned int rf_id )
- {
- mt6140c_cw12_par.uc_divb_sel = (reg_data >> 20) & 0x03;
- mt6140c_cw12_par.uc_txqos_vgaic = (reg_data >> 17) & 0x07;
- mt6140c_cw12_par.uc_txios_tc = (reg_data >> 14) & 0x07;
- mt6140c_cw12_par.uc_txdiv4_il_gl = (reg_data >> 13) & 0x01;
- mt6140c_cw12_par.uc_txdiv_gc1 = (reg_data >> 15) & 0x01;
- mt6140c_cw12_par.uc_txdiv4_il_gl = (reg_data >> 13) & 0x01;
- mt6140c_cw12_par.uc_hbmod_gc1 = (reg_data >> 12) & 0x01;
- mt6140c_cw12_par.uc_hbmod_gc0 = (reg_data >> 11) & 0x01;
- mt6140c_cw12_par.uc_lbmod_gc0 = (reg_data >> 10) & 0x01;
- mt6140c_cw12_par.uc_apc_sel = (reg_data >> 9) & 0x01;
- mt6140c_cw12_par.uc_txdiv_gc1 = (reg_data >> 8) & 0x01;
- mt6140c_cw12_par.uc_txdiv_gc0 = (reg_data >> 7) & 0x01;
- mt6140c_cw12_par.uc_txvapc = (reg_data >> 4) & 0x07;
- mt6140c_cw12_par.uc_tx_itc3 = (reg_data >> 3) & 0x01;
- mt6140c_cw12_par.uc_tx_itc2 = (reg_data >> 2) & 0x01;
- mt6140c_cw12_par.uc_tx_itc1 = (reg_data >> 1) & 0x01;
- mt6140c_cw12_par.uc_tx_itc0 = reg_data & 0x01;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Set_MT6140CCW12ToReg_Start( S_MT6140C_CW12 &mt6140c_cw12_par, unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140CCW12 = mt6140c_cw12_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140CCW12ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CCW12ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6140CCW12( m_sMT6140CCW12, bsi_data, m_uiFinalRfid );
- META_RESULT MetaResult = META_Rf_SetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, bsi_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6140CW15ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Get_MT6140CCW12FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140CCW12FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Get_MT6140CCW12FromReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int reg_data;
- META_RESULT MetaResult = META_Rf_GetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, ADDR_MT6140_AUXOUT_CW11, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6140CCW11( reg_data, m_sMT6140CCW11, m_uiFinalRfid );
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6140CW15FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW15 ////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Compose_MT6140CW15( S_MT6140_CW15 &mt6140_cw15_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (mt6140_cw15_par.uc_auxout_selection << 8) |
- (mt6140_cw15_par.uc_address_data_out << 4) |
- ADDR_MT6140_CW15;
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::DeCompose_MT6140CW15( unsigned int reg_data, S_MT6140_CW15 &mt6140_cw15_par, unsigned int rf_id )
- {
- mt6140_cw15_par.uc_auxout_selection = (reg_data >> 4) & 0x7F;
- mt6140_cw15_par.uc_address_data_out = reg_data & 0x0F;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Set_MT6140CW15ToReg_Start( S_MT6140_CW15 &mt6140_cw15_par, unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140CW15 = mt6140_cw15_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140CW15ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CW15ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6140CW15( m_sMT6140CW15, bsi_data, m_uiFinalRfid );
- META_RESULT MetaResult = META_Rf_SetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, bsi_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- Confirm(METAAPP_SUCCESS);
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140CREG::Get_MT6140CW15FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140CW15FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140CREG::Get_MT6140CW15FromReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int reg_data;
- META_RESULT MetaResult = META_Rf_GetRFImmediateBSI_r(m_META_HANDLE_Obj.Get_MainHandle(), 500, ADDR_MT6140_AUXOUT_CW15, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6140CW15( reg_data, m_sMT6140CW15, m_uiFinalRfid );
- Confirm(METAAPP_SUCCESS);
- }
- //===========================================================================
- //////////////////////////// Global information ////////////////////////
- //===========================================================================
- //---------------------------------------------------------------------------
- E_METAAPP_RESULT_T CRFMT6140CREG::Get_ConfirmState( void )
- {
- return m_eConfirmState;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140_CW0 CRFMT6140CREG::Get_MT6140CW0( void )
- { return m_sMT6140CW0;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CW0( S_MT6140_CW0 &mt6140_cw0 )
- { m_sMT6140CW0 = mt6140_cw0;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140_CW1 CRFMT6140CREG::Get_MT6140CW1( void )
- { return m_sMT6140CW1;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CW1( S_MT6140_CW1 &mt6140_cw1 )
- { m_sMT6140CW1 = mt6140_cw1;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140_CW2 CRFMT6140CREG::Get_MT6140CW2( void )
- { return m_sMT6140CW2;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CW2( S_MT6140_CW2 &mt6140_cw2 )
- { m_sMT6140CW2 = mt6140_cw2;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140C_CW3 CRFMT6140CREG::Get_MT6140CCW3( void )
- { return m_sMT6140CCW3;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CCW3( S_MT6140C_CW3 &mt6140_cw3 )
- { m_sMT6140CCW3 = mt6140_cw3;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140C_CW4 CRFMT6140CREG::Get_MT6140CCW4( void )
- { return m_sMT6140CCW4;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CCW4( S_MT6140C_CW4 &mt6140_cw4 )
- { m_sMT6140CCW4 = mt6140_cw4;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140C_CW5 CRFMT6140CREG::Get_MT6140CCW5( void )
- { return m_sMT6140CCW5;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CCW5( S_MT6140C_CW5 &mt6140c_cw5 )
- { m_sMT6140CCW5 = mt6140c_cw5;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140_CW6 CRFMT6140CREG::Get_MT6140CW6( void )
- { return m_sMT6140CW6;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CW6( S_MT6140_CW6 &mt6140_cw6 )
- { m_sMT6140CW6 = mt6140_cw6;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140C_CW7 CRFMT6140CREG::Get_MT6140CCW7( void )
- { return m_sMT6140CCW7;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CCW7( S_MT6140C_CW7 &mt6140c_cw7 )
- { m_sMT6140CCW7 = mt6140c_cw7;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140_CW8 CRFMT6140CREG::Get_MT6140CW8( void )
- { return m_sMT6140CW8;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CW8( S_MT6140_CW8 &mt6140_cw8 )
- { m_sMT6140CW8 = mt6140_cw8;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140C_CW9 CRFMT6140CREG::Get_MT6140CCW9( void )
- { return m_sMT6140CCW9;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CCW9( S_MT6140C_CW9 &mt6140c_cw9 )
- { m_sMT6140CCW9 = mt6140c_cw9;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140_CW10 CRFMT6140CREG::Get_MT6140CW10( void )
- { return m_sMT6140CW10;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CW10( S_MT6140_CW10 &mt6140_cw10 )
- { m_sMT6140CW10 = mt6140_cw10;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140C_CW11 CRFMT6140CREG::Get_MT6140CCW11( void )
- { return m_sMT6140CCW11;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CCW11( S_MT6140C_CW11 &mt6140c_cw11 )
- { m_sMT6140CCW11 = mt6140c_cw11;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140_CW15 CRFMT6140CREG::Get_MT6140CW15( void )
- { return m_sMT6140CW15;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140CREG::Set_MT6140CW15( S_MT6140_CW15 &mt6140_cw15 )
- { m_sMT6140CW15 = mt6140_cw15;
- }