rf_mt6140breg.cpp
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:64k
- /*****************************************************************************
- * 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_mt6140breg.cpp
- *
- * Project:
- * --------
- * Maui META APP
- *
- * Description:
- * ------------
- * MT6140B 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_MT6140BREG_H_
- #include "rf_mt6140breg.h"
- #endif
- #ifndef _MAN_ACTIVE_H_
- #include "man_active.h"
- #endif
- //===========================================================================
- static CRFMT6140BREG* rf_mt6140breg_ptr;
- static bool g_bIsRunning;
- // MT6140 All
- //----------------------------------------------------------------------------
- static void Get_MT6140AllFromReg( void )
- {
- rf_mt6140breg_ptr->Get_MT6140AllFromReg();
- }
- //----------------------------------------------------------------------------
- static void Set_MT6140AllToReg( void )
- { rf_mt6140breg_ptr->Set_MT6140AllToReg();
- }
- // MT6140 CW0
- //----------------------------------------------------------------------------
- static void Set_MT6140CW0ToReg( void )
- { rf_mt6140breg_ptr->Set_MT6140CW0ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140CW0FromReg( void )
- { rf_mt6140breg_ptr->Get_MT6140CW0FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW1
- static void Set_MT6140CW1ToReg( void )
- { rf_mt6140breg_ptr->Set_MT6140CW1ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140CW1FromReg( void )
- { rf_mt6140breg_ptr->Get_MT6140CW1FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW2
- static void Set_MT6140CW2ToReg( void )
- { rf_mt6140breg_ptr->Set_MT6140CW2ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140CW2FromReg( void )
- { rf_mt6140breg_ptr->Get_MT6140CW2FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW3
- static void Set_MT6140BCW3ToReg( void )
- { rf_mt6140breg_ptr->Set_MT6140BCW3ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140BCW3FromReg( void )
- { rf_mt6140breg_ptr->Get_MT6140BCW3FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW4
- static void Set_MT6140BCW4ToReg( void )
- { rf_mt6140breg_ptr->Set_MT6140BCW4ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140BCW4FromReg( void )
- { rf_mt6140breg_ptr->Get_MT6140BCW4FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW5
- static void Set_MT6140BCW5ToReg( void )
- { rf_mt6140breg_ptr->Set_MT6140BCW5ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140BCW5FromReg( void )
- { rf_mt6140breg_ptr->Get_MT6140BCW5FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW6
- static void Set_MT6140CW6ToReg( void )
- { rf_mt6140breg_ptr->Set_MT6140CW6ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140CW6FromReg( void )
- { rf_mt6140breg_ptr->Get_MT6140CW6FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW7
- static void Set_MT6140BCW7ToReg( void )
- { rf_mt6140breg_ptr->Set_MT6140BCW7ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140BCW7FromReg( void )
- { rf_mt6140breg_ptr->Get_MT6140BCW7FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW8
- static void Set_MT6140CW8ToReg( void )
- { rf_mt6140breg_ptr->Set_MT6140CW8ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140CW8FromReg( void )
- { rf_mt6140breg_ptr->Get_MT6140CW8FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW9
- static void Set_MT6140BCW9ToReg( void )
- { rf_mt6140breg_ptr->Set_MT6140BCW9ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140BCW9FromReg( void )
- { rf_mt6140breg_ptr->Get_MT6140BCW9FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW10
- static void Set_MT6140CW10ToReg( void )
- { rf_mt6140breg_ptr->Set_MT6140CW10ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140CW10FromReg( void )
- { rf_mt6140breg_ptr->Get_MT6140CW10FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW11
- static void Set_MT6140BCW11ToReg( void )
- { rf_mt6140breg_ptr->Set_MT6140BCW11ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140BCW11FromReg( void )
- { rf_mt6140breg_ptr->Get_MT6140BCW11FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6140 CW15
- static void Set_MT6140CW15ToReg( void )
- { rf_mt6140breg_ptr->Set_MT6140CW15ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6140CW15FromReg( void )
- { rf_mt6140breg_ptr->Get_MT6140CW15FromReg();
- }
- //===========================================================================
- CRFMT6140BREG::CRFMT6140BREG( void )
- {
- g_bIsRunning = false;
- ConfirmCallback = 0;
- m_bIsMT6140All = false;
- }
- //---------------------------------------------------------------------------
- CRFMT6140BREG::~CRFMT6140BREG()
- {
- g_bIsRunning = false;
- ConfirmCallback = 0;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140BREG::REQ_Stop(void)
- {
- if (!g_bIsRunning)
- {
- return;
- }
- Confirm(METAAPP_STOP);
- }
- //---------------------------------------------------------------------------
- void CRFMT6140BREG::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 CRFMT6140BREG::Set_MT6140AllToReg_Start( unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = true;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140AllToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::Set_MT6140AllToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- ActiveMan->SetActiveFunction( ::Set_MT6140CW0ToReg );
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140BREG::Get_MT6140AllFromReg_Start( unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = true;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140AllFromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::Get_MT6140AllFromReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- ActiveMan->SetActiveFunction( ::Get_MT6140CW0FromReg );
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW0 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::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 CRFMT6140BREG::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 CRFMT6140BREG::Set_MT6140CW0ToReg_Start( S_MT6140_CW0 &mt6140_cw0_par, unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140CW0 = mt6140_cw0_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140CW0ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::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 CRFMT6140BREG::Get_MT6140CW0FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140CW0FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::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 CRFMT6140BREG::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 CRFMT6140BREG::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 CRFMT6140BREG::Set_MT6140CW1ToReg_Start( S_MT6140_CW1 &mt6140_cw1_par, unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140CW1 = mt6140_cw1_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140CW1ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::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 CRFMT6140BREG::Get_MT6140CW1FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140CW1FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::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 CRFMT6140BREG::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 CRFMT6140BREG::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 CRFMT6140BREG::Set_MT6140CW2ToReg_Start( S_MT6140_CW2 &mt6140_cw2_par, unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140CW2 = mt6140_cw2_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140CW2ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::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_MT6140BCW3ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140BREG::Get_MT6140CW2FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140CW2FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::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_MT6140BCW3FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW3 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::Compose_MT6140BCW3( S_MT6140B_CW3 &mt6140b_cw3_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (mt6140b_cw3_par.uc_rfmixp << 11) |
- (mt6140b_cw3_par.uc_rflnap << 10) |
- (mt6140b_cw3_par.uc_syndivp << 9) |
- (mt6140b_cw3_par.uc_synpfdp << 8) |
- (mt6140b_cw3_par.uc_rxdivp << 7) |
- (mt6140b_cw3_par.uc_ifpgap2 << 6) |
- (mt6140b_cw3_par.uc_ifpgap1 << 5) |
- (mt6140b_cw3_par.uc_ifpolp << 4) |
- ADDR_MT6140_CW3;
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::DeCompose_MT6140BCW3( unsigned int reg_data, S_MT6140B_CW3 &mt6140b_cw3_par, unsigned int rf_id )
- {
- mt6140b_cw3_par.uc_rfmixp = (reg_data >> 7) & 0x01;
- mt6140b_cw3_par.uc_rflnap = (reg_data >> 6) & 0x01;
- mt6140b_cw3_par.uc_syndivp = (reg_data >> 5) & 0x01;
- mt6140b_cw3_par.uc_synpfdp = (reg_data >> 4) & 0x01;
- mt6140b_cw3_par.uc_rxdivp = (reg_data >> 3) & 0x01;
- mt6140b_cw3_par.uc_ifpgap2 = (reg_data >> 2) & 0x01;
- mt6140b_cw3_par.uc_ifpgap1 = (reg_data >> 1) & 0x01;
- mt6140b_cw3_par.uc_ifpolp = reg_data & 0x01;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140BREG::Set_MT6140BCW3ToReg_Start( S_MT6140B_CW3 &mt6140b_cw3_par, unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140BCW3 = mt6140b_cw3_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140BCW3ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::Set_MT6140BCW3ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6140BCW3( m_sMT6140BCW3, 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_MT6140BCW4ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140BREG::Get_MT6140BCW3FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140BCW3FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::Get_MT6140BCW3FromReg( 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_MT6140BCW3( reg_data, m_sMT6140BCW3, m_uiFinalRfid);
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6140BCW4FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW4 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::Compose_MT6140BCW4( S_MT6140B_CW4 &mt6140b_cw4_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (mt6140b_cw4_par.uc_otaen << 19) |
- (mt6140b_cw4_par.uc_fldis << 18) |
- (mt6140b_cw4_par.uc_cal_delay << 16) |
- (mt6140b_cw4_par.uc_vco_vset << 14) |
- (mt6140b_cw4_par.uc_dread << 13) |
- (mt6140b_cw4_par.uc_calmode << 11) |
- (mt6140b_cw4_par.uc_lgac << 10) |
- (mt6140b_cw4_par.uc_c_fra_in << 9) |
- (mt6140b_cw4_par.uc_sxrstdiv << 8) |
- (mt6140b_cw4_par.uc_syntyp << 7) |
- (mt6140b_cw4_par.uc_synpfd << 5) |
- (mt6140b_cw4_par.uc_sca_cr_fi << 4) |
- ADDR_MT6140_CW4;
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::DeCompose_MT6140BCW4( unsigned int reg_data, S_MT6140B_CW4 &mt6140b_cw4_par, unsigned int rf_id )
- {
- mt6140b_cw4_par.uc_otaen = (reg_data >>15) & 0x01;
- mt6140b_cw4_par.uc_fldis = (reg_data >>14) & 0x01;
- mt6140b_cw4_par.uc_cal_delay = (reg_data >>12) & 0x03;
- mt6140b_cw4_par.uc_vco_vset = (reg_data >>10) & 0x03;
- mt6140b_cw4_par.uc_dread = (reg_data >> 9) & 0x01;
- mt6140b_cw4_par.uc_calmode = (reg_data >> 7) & 0x03;
- mt6140b_cw4_par.uc_lgac = (reg_data >> 6) & 0x01;
- mt6140b_cw4_par.uc_c_fra_in = (reg_data >> 5) & 0x01;
- mt6140b_cw4_par.uc_sxrstdiv = (reg_data >> 4) & 0x01;
- mt6140b_cw4_par.uc_syntyp = (reg_data >> 3) & 0x01;
- mt6140b_cw4_par.uc_synpfd = (reg_data >> 1) & 0x03;
- mt6140b_cw4_par.uc_sca_cr_fi = reg_data & 0x01;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140BREG::Set_MT6140BCW4ToReg_Start( S_MT6140B_CW4 &mt6140b_cw4_par, unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140BCW4 = mt6140b_cw4_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140BCW4ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::Set_MT6140BCW4ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6140BCW4( m_sMT6140BCW4, 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_MT6140BCW5ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140BREG::Get_MT6140BCW4FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140BCW4FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::Get_MT6140BCW4FromReg( 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_MT6140BCW4( reg_data, m_sMT6140BCW4, m_uiFinalRfid);
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6140BCW5FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW5 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::Compose_MT6140BCW5( S_MT6140B_CW5 &mt6140b_cw5_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (mt6140b_cw5_par.uc_rx_lna_mid << 19) |
- (mt6140b_cw5_par.uc_rx_ft0 << 18) |
- (mt6140b_cw5_par.uc_rx_ft1 << 17) |
- (mt6140b_cw5_par.uc_rx_qt0 << 16) |
- (mt6140b_cw5_par.uc_rx_qt1 << 15) |
- (mt6140b_cw5_par.uc_rx_resb << 14) |
- (mt6140b_cw5_par.uc_resb << 9) |
- (mt6140b_cw5_par.uc_res << 4) |
- ADDR_MT6140_CW5;
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::DeCompose_MT6140BCW5( unsigned int reg_data, S_MT6140B_CW5 &mt6140b_cw5_par, unsigned int rf_id )
- {
- mt6140b_cw5_par.uc_rx_lna_mid = (reg_data >> 15) & 0x01;
- mt6140b_cw5_par.uc_rx_ft0 = (reg_data >> 14) & 0x01;
- mt6140b_cw5_par.uc_rx_ft1 = (reg_data >> 13) & 0x01;
- mt6140b_cw5_par.uc_rx_qt0 = (reg_data >> 12) & 0x01;
- mt6140b_cw5_par.uc_rx_qt1 = (reg_data >> 11) & 0x01;
- mt6140b_cw5_par.uc_rx_resb = (reg_data >> 10) & 0x01;
- mt6140b_cw5_par.uc_resb = (reg_data >> 5) & 0x1F;
- mt6140b_cw5_par.uc_res = reg_data & 0x1F;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140BREG::Set_MT6140BCW5ToReg_Start( S_MT6140B_CW5 &mt6140b_cw5_par, unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140BCW5 = mt6140b_cw5_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140BCW5ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::Set_MT6140BCW5ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6140BCW5( m_sMT6140BCW5, 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 CRFMT6140BREG::Get_MT6140BCW5FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140BCW5FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::Get_MT6140BCW5FromReg( 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_MT6140BCW5( reg_data, m_sMT6140BCW5, m_uiFinalRfid );
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6140CW6FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW6 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::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 CRFMT6140BREG::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 CRFMT6140BREG::Set_MT6140CW6ToReg_Start( S_MT6140_CW6 &mt6140_cw6_par, unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140CW6 = mt6140_cw6_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140CW6ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::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_MT6140BCW7ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140BREG::Get_MT6140CW6FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140CW6FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::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_MT6140BCW7FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW7 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::Compose_MT6140BCW7( S_MT6140B_CW7 &mt6140_cw7_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (mt6140_cw7_par.uc_lo_vsw_g << 17) |
- (mt6140_cw7_par.uc_lo_vsw_d << 14) |
- (mt6140_cw7_par.uc_man_cal << 13) |
- (mt6140_cw7_par.uc_auto_gain_select << 12) |
- (mt6140_cw7_par.uc_rx_gain << 4) |
- ADDR_MT6140_CW7;
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::DeCompose_MT6140BCW7( unsigned int reg_data, S_MT6140B_CW7 &mt6140_cw7_par, unsigned int rf_id )
- {
- mt6140_cw7_par.uc_lo_vsw_g = (reg_data>>13) & 0x07;
- mt6140_cw7_par.uc_lo_vsw_d = (reg_data>>10) & 0x07;
- mt6140_cw7_par.uc_man_cal = (reg_data>>9) & 0x01;
- mt6140_cw7_par.uc_auto_gain_select = (reg_data>>8) & 0x01;
- mt6140_cw7_par.uc_rx_gain = reg_data & 0xFF;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140BREG::Set_MT6140BCW7ToReg_Start( S_MT6140B_CW7 &mt6140_cw7_par, unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140BCW7 = mt6140_cw7_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140BCW7ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::Set_MT6140BCW7ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6140BCW7( m_sMT6140BCW7, 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 CRFMT6140BREG::Get_MT6140BCW7FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140BCW7FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::Get_MT6140BCW7FromReg( 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_MT6140BCW7( reg_data, m_sMT6140BCW7, m_uiFinalRfid );
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6140CW8FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW8 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::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 CRFMT6140BREG::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 CRFMT6140BREG::Set_MT6140CW8ToReg_Start( S_MT6140_CW8 &mt6140_cw8_par, unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140CW8 = mt6140_cw8_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140CW8ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::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_MT6140BCW9ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140BREG::Get_MT6140CW8FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140CW8FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::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_MT6140BCW9FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW9 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::Compose_MT6140BCW9( S_MT6140B_CW9 &mt6140b_cw9_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (mt6140b_cw9_par.uc_pwr_dac_a << 20) |
- (mt6140b_cw9_par.uc_pwr_dac_b << 19) |
- (mt6140b_cw9_par.uc_pwr_dac_c << 18) |
- (mt6140b_cw9_par.uc_dc_dac_bq << 11) |
- (mt6140b_cw9_par.uc_dc_dac_cq << 4) |
- ADDR_MT6140_CW9;
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::DeCompose_MT6140BCW9( unsigned int reg_data, S_MT6140B_CW9 &mt6140b_cw9_par, unsigned int rf_id )
- {
- mt6140b_cw9_par.uc_pwr_dac_a = (reg_data>>16) & 0x01;
- mt6140b_cw9_par.uc_pwr_dac_b = (reg_data>>15) & 0x01;
- mt6140b_cw9_par.uc_pwr_dac_c = (reg_data>>14) & 0x01;
- mt6140b_cw9_par.uc_dc_dac_bq = (reg_data>>7 ) & 0x7F;
- mt6140b_cw9_par.uc_dc_dac_cq = (reg_data ) & 0x7F;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140BREG::Set_MT6140BCW9ToReg_Start( S_MT6140B_CW9 &mt6140b_cw9_par, unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140BCW9 = mt6140b_cw9_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140BCW9ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::Set_MT6140BCW9ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6140BCW9( m_sMT6140BCW9, 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 CRFMT6140BREG::Get_MT6140BCW9FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140BCW9FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::Get_MT6140BCW9FromReg( 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_MT6140BCW9( reg_data, m_sMT6140BCW9, m_uiFinalRfid );
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6140CW10FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW10 ////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::Compose_MT6140CW10( S_MT6140_CW10 &m_sMT6140CW10_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (m_sMT6140CW10_par.uc_am_daci << 12) |
- (m_sMT6140CW10_par.uc_am_dacq << 4) |
- ADDR_MT6140_CW10;
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::DeCompose_MT6140CW10( unsigned int reg_data, S_MT6140_CW10 &m_sMT6140CW10_par, unsigned int rf_id )
- {
- m_sMT6140CW10_par.uc_am_daci = (reg_data >> 8) & 0xFF;
- m_sMT6140CW10_par.uc_am_dacq = reg_data & 0xFF;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140BREG::Set_MT6140CW10ToReg_Start( S_MT6140_CW10 &mt6140_cw10_par, unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140CW10 = mt6140_cw10_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140CW10ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::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_MT6140BCW11ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140BREG::Get_MT6140CW10FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140CW10FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::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_MT6140BCW11FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW11 ////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::Compose_MT6140BCW11( S_MT6140B_CW11 &mt6140b_cw11_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (mt6140b_cw11_par.uc_lbcapon_en << 25) |
- (mt6140b_cw11_par.uc_lbcapon <<24) |
- (mt6140b_cw11_par.uc_tx_ci_1 <<23) |
- (mt6140b_cw11_par.uc_tx_ci_0 <<22) |
- (mt6140b_cw11_par.uc_tx_icsc_ptat<<21) |
- (mt6140b_cw11_par.uc_tx_vga_ptat<< 20) |
- (mt6140b_cw11_par.uc_txdiv_gc1 << 19) |
- (mt6140b_cw11_par.uc_txdiv_gc0 << 18) |
- (mt6140b_cw11_par.uc_txvapc << 16) |
- (mt6140b_cw11_par.uc_tx_itc << 13) |
- (mt6140b_cw11_par.uc_txmodgc_en << 12) |
- (mt6140b_cw11_par.uc_txmodgc << 11) |
- (mt6140b_cw11_par.uc_txdbuf << 10) |
- (mt6140b_cw11_par.uc_txgbuf << 9) |
- (mt6140b_cw11_par.uc_txdiv4 << 8) |
- (mt6140b_cw11_par.uc_txdiv2 << 7) |
- (mt6140b_cw11_par.uc_txdiqm << 6) |
- (mt6140b_cw11_par.uc_txgiqm << 5) |
- (mt6140b_cw11_par.uc_txctl << 4) |
- ADDR_MT6140_CW11;
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::DeCompose_MT6140BCW11( unsigned int reg_data, S_MT6140B_CW11 &mt6140b_cw11_par, unsigned int rf_id )
- {
- mt6140b_cw11_par.uc_lbcapon_en = (reg_data >> 21) & 0x01;
- mt6140b_cw11_par.uc_lbcapon = (reg_data >> 20) & 0x01;
- mt6140b_cw11_par.uc_tx_ci_1 = (reg_data >> 19) & 0x01;
- mt6140b_cw11_par.uc_tx_ci_0 = (reg_data >> 18) & 0x01;
- mt6140b_cw11_par.uc_tx_icsc_ptat= (reg_data >> 17) & 0x01;
- mt6140b_cw11_par.uc_tx_vga_ptat = (reg_data >> 16) & 0x01;
- mt6140b_cw11_par.uc_txdiv_gc1 = (reg_data >> 15) & 0x01;
- mt6140b_cw11_par.uc_txdiv_gc0 = (reg_data >> 14) & 0x01;
- mt6140b_cw11_par.uc_txvapc = (reg_data >> 12) & 0x03;
- mt6140b_cw11_par.uc_tx_itc = (reg_data >> 9) & 0x07;
- mt6140b_cw11_par.uc_txmodgc_en = (reg_data >> 8) & 0x01;
- mt6140b_cw11_par.uc_txmodgc = (reg_data >> 7) & 0x01;
- mt6140b_cw11_par.uc_txdbuf = (reg_data >> 6) & 0x01;
- mt6140b_cw11_par.uc_txgbuf = (reg_data >> 5) & 0x01;
- mt6140b_cw11_par.uc_txdiv4 = (reg_data >> 4) & 0x01;
- mt6140b_cw11_par.uc_txdiv2 = (reg_data >> 3) & 0x01;
- mt6140b_cw11_par.uc_txdiqm = (reg_data >> 2) & 0x01;
- mt6140b_cw11_par.uc_txgiqm = (reg_data >> 1) & 0x01;
- mt6140b_cw11_par.uc_txctl = reg_data & 0x01;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6140BREG::Set_MT6140BCW11ToReg_Start( S_MT6140B_CW11 &mt6140b_cw11_par, unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140BCW11 = mt6140b_cw11_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140BCW11ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::Set_MT6140BCW11ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6140BCW11( m_sMT6140BCW11, 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 CRFMT6140BREG::Get_MT6140BCW11FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140BCW11FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::Get_MT6140BCW11FromReg( 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_MT6140BCW11( reg_data, m_sMT6140BCW11, m_uiFinalRfid );
- if( ! m_bIsMT6140All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6140CW15FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW15 ////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::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 CRFMT6140BREG::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 CRFMT6140BREG::Set_MT6140CW15ToReg_Start( S_MT6140_CW15 &mt6140_cw15_par, unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_sMT6140CW15 = mt6140_cw15_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6140CW15ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::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 CRFMT6140BREG::Get_MT6140CW15FromReg_Start( unsigned int rf_id )
- {
- rf_mt6140breg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6140All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6140CW15FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6140BREG::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 CRFMT6140BREG::Get_ConfirmState(void)
- {
- return m_eConfirmState;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140_CW0 CRFMT6140BREG::Get_MT6140CW0( void )
- { return m_sMT6140CW0;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140BREG::Set_MT6140CW0( S_MT6140_CW0 &mt6140_cw0 )
- { m_sMT6140CW0 = mt6140_cw0;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140_CW1 CRFMT6140BREG::Get_MT6140CW1( void )
- { return m_sMT6140CW1;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140BREG::Set_MT6140CW1( S_MT6140_CW1 &mt6140_cw1 )
- { m_sMT6140CW1 = mt6140_cw1;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140_CW2 CRFMT6140BREG::Get_MT6140CW2( void )
- { return m_sMT6140CW2;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140BREG::Set_MT6140CW2( S_MT6140_CW2 &mt6140_cw2 )
- { m_sMT6140CW2 = mt6140_cw2;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140B_CW3 CRFMT6140BREG::Get_MT6140BCW3( void )
- { return m_sMT6140BCW3;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140BREG::Set_MT6140BCW3( S_MT6140B_CW3 &mt6140b_cw3 )
- { m_sMT6140BCW3 = mt6140b_cw3;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140B_CW4 CRFMT6140BREG::Get_MT6140BCW4( void )
- { return m_sMT6140BCW4;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140BREG::Set_MT6140BCW4( S_MT6140B_CW4 &mt6140b_cw4 )
- { m_sMT6140BCW4 = mt6140b_cw4;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140B_CW5 CRFMT6140BREG::Get_MT6140BCW5( void )
- { return m_sMT6140BCW5;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140BREG::Set_MT6140BCW5( S_MT6140B_CW5 &mt6140b_cw5 )
- { m_sMT6140BCW5 = mt6140b_cw5;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140_CW6 CRFMT6140BREG::Get_MT6140CW6( void )
- { return m_sMT6140CW6;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140BREG::Set_MT6140CW6( S_MT6140_CW6 &mt6140_cw6 )
- { m_sMT6140CW6 = mt6140_cw6;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140B_CW7 CRFMT6140BREG::Get_MT6140BCW7( void )
- { return m_sMT6140BCW7;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140BREG::Set_MT6140BCW7( S_MT6140B_CW7 &mt6140b_cw7 )
- { m_sMT6140BCW7 = mt6140b_cw7;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140_CW8 CRFMT6140BREG::Get_MT6140CW8( void )
- { return m_sMT6140CW8;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140BREG::Set_MT6140CW8( S_MT6140_CW8 &mt6140_cw8 )
- { m_sMT6140CW8 = mt6140_cw8;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140B_CW9 CRFMT6140BREG::Get_MT6140BCW9( void )
- { return m_sMT6140BCW9;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140BREG::Set_MT6140BCW9( S_MT6140B_CW9 &mt6140b_cw9 )
- { m_sMT6140BCW9 = mt6140b_cw9;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140_CW10 CRFMT6140BREG::Get_MT6140CW10( void )
- { return m_sMT6140CW10;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140BREG::Set_MT6140CW10( S_MT6140_CW10 &mt6140_cw10 )
- { m_sMT6140CW10 = mt6140_cw10;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140B_CW11 CRFMT6140BREG::Get_MT6140BCW11( void )
- { return m_sMT6140BCW11;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140BREG::Set_MT6140BCW11( S_MT6140B_CW11 &mt6140b_cw11 )
- { m_sMT6140BCW11 = mt6140b_cw11;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6140_CW15 CRFMT6140BREG::Get_MT6140CW15( void )
- { return m_sMT6140CW15;
- }
- //---------------------------------------------------------------------------
- void CRFMT6140BREG::Set_MT6140CW15( S_MT6140_CW15 &mt6140_cw15 )
- { m_sMT6140CW15 = mt6140_cw15;
- }