rf_mt6139reg.cpp
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:62k
- /*****************************************************************************
- * 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_mt6139reg.cpp
- *
- * Project:
- * --------
- * Maui META APP
- *
- * Description:
- * ------------
- * MT6139 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_MT6139REG_H_
- #include "rf_mt6139reg.h"
- #endif
- #ifndef _MAN_ACTIVE_H_
- #include "man_active.h"
- #endif
- //===========================================================================
- static CRFMT6139REG* rf_mt6139reg_ptr;
- static bool g_bIsRunning;
- // MT6139 All
- //----------------------------------------------------------------------------
- static void Get_MT6139AllFromReg( void )
- {
- rf_mt6139reg_ptr->Get_MT6139AllFromReg();
- }
- //----------------------------------------------------------------------------
- static void Set_MT6139AllToReg( void )
- { rf_mt6139reg_ptr->Set_MT6139AllToReg();
- }
- // MT6139 CW0
- //----------------------------------------------------------------------------
- static void Set_MT6139CW0ToReg( void )
- { rf_mt6139reg_ptr->Set_MT6139CW0ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6139CW0FromReg( void )
- { rf_mt6139reg_ptr->Get_MT6139CW0FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6139 CW1
- static void Set_MT6139CW1ToReg( void )
- { rf_mt6139reg_ptr->Set_MT6139CW1ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6139CW1FromReg( void )
- { rf_mt6139reg_ptr->Get_MT6139CW1FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6139 CW2
- static void Set_MT6139CW2ToReg( void )
- { rf_mt6139reg_ptr->Set_MT6139CW2ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6139CW2FromReg( void )
- { rf_mt6139reg_ptr->Get_MT6139CW2FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6139 CW3
- static void Set_MT6139CW3ToReg( void )
- { rf_mt6139reg_ptr->Set_MT6139CW3ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6139CW3FromReg( void )
- { rf_mt6139reg_ptr->Get_MT6139CW3FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6139 CW4
- static void Set_MT6139CW4ToReg( void )
- { rf_mt6139reg_ptr->Set_MT6139CW4ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6139CW4FromReg( void )
- { rf_mt6139reg_ptr->Get_MT6139CW4FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6139 CW5
- static void Set_MT6139CW5ToReg( void )
- { rf_mt6139reg_ptr->Set_MT6139CW5ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6139CW5FromReg( void )
- { rf_mt6139reg_ptr->Get_MT6139CW5FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6139 CW6
- static void Set_MT6139CW6ToReg( void )
- { rf_mt6139reg_ptr->Set_MT6139CW6ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6139CW6FromReg( void )
- { rf_mt6139reg_ptr->Get_MT6139CW6FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6139 CW7
- static void Set_MT6139CW7ToReg( void )
- { rf_mt6139reg_ptr->Set_MT6139CW7ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6139CW7FromReg( void )
- { rf_mt6139reg_ptr->Get_MT6139CW7FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6139 CW8
- static void Set_MT6139CW8ToReg( void )
- { rf_mt6139reg_ptr->Set_MT6139CW8ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6139CW8FromReg( void )
- { rf_mt6139reg_ptr->Get_MT6139CW8FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6139 CW9
- static void Set_MT6139CW9ToReg( void )
- { rf_mt6139reg_ptr->Set_MT6139CW9ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6139CW9FromReg( void )
- { rf_mt6139reg_ptr->Get_MT6139CW9FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6139 CW10
- static void Set_MT6139CW10ToReg( void )
- { rf_mt6139reg_ptr->Set_MT6139CW10ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6139CW10FromReg( void )
- { rf_mt6139reg_ptr->Get_MT6139CW10FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6139 CW11
- static void Set_MT6139CW11ToReg( void )
- { rf_mt6139reg_ptr->Set_MT6139CW11ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6139CW11FromReg( void )
- { rf_mt6139reg_ptr->Get_MT6139CW11FromReg();
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // MT6139 CW15
- static void Set_MT6139CW15ToReg( void )
- { rf_mt6139reg_ptr->Set_MT6139CW15ToReg();
- }
- //----------------------------------------------------------------------------
- static void Get_MT6139CW15FromReg( void )
- { rf_mt6139reg_ptr->Get_MT6139CW15FromReg();
- }
- //===========================================================================
- CRFMT6139REG::CRFMT6139REG( void )
- {
- g_bIsRunning = false;
- ConfirmCallback = 0;
- m_bIsMT6139All = false;
- }
- //---------------------------------------------------------------------------
- CRFMT6139REG::~CRFMT6139REG()
- {
- g_bIsRunning = false;
- ConfirmCallback = 0;
- }
- //---------------------------------------------------------------------------
- void CRFMT6139REG::REQ_Stop( void )
- {
- if(!g_bIsRunning) return;
- Confirm( METAAPP_STOP );
- }
- //---------------------------------------------------------------------------
- void CRFMT6139REG::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 CRFMT6139REG::Set_MT6139AllToReg_Start( unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = true;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6139AllToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139AllToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- ActiveMan->SetActiveFunction( ::Set_MT6139CW0ToReg );
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6139REG::Get_MT6139AllFromReg_Start( unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = true;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6139AllFromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Get_MT6139AllFromReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- ActiveMan->SetActiveFunction( ::Get_MT6139CW0FromReg );
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW0 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Compose_MT6139CW0( S_MT6139_CW0 &mt6139_cw0_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (mt6139_cw0_par.uc_por << 17) |
- (mt6139_cw0_par.uc_gpo << 16) |
- (mt6139_cw0_par.uc_vcosel << 15) |
- (mt6139_cw0_par.uc_afc << 9) |
- (mt6139_cw0_par.uc_flt << 8) |
- (mt6139_cw0_par.uc_dien << 7) |
- (mt6139_cw0_par.uc_synpw << 6) |
- (mt6139_cw0_par.uc_syncp << 4) |
- ADDR_MT6139_CW0;
- }
- //---------------------------------------------------------------------------
- void CRFMT6139REG::DeCompose_MT6139CW0( unsigned int reg_data, S_MT6139_CW0 &mt6139_cw0_par, unsigned int rf_id )
- {
- mt6139_cw0_par.uc_por = (reg_data >>13) & 0x01;
- mt6139_cw0_par.uc_gpo = (reg_data >>12) & 0x01;
- mt6139_cw0_par.uc_vcosel = (reg_data >>11) & 0x01;
- mt6139_cw0_par.uc_afc = (reg_data >> 5) & 0x3F;
- mt6139_cw0_par.uc_flt = (reg_data >> 4) & 0x01;
- mt6139_cw0_par.uc_dien = (reg_data >> 3) & 0x01;
- mt6139_cw0_par.uc_synpw = (reg_data >> 2) & 0x01;
- mt6139_cw0_par.uc_syncp = reg_data & 0x03;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6139REG::Set_MT6139CW0ToReg_Start( S_MT6139_CW0 &mt6139_cw0_par, unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_sMT6139CW0 = mt6139_cw0_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6139CW0ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW0ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6139CW0( m_sMT6139CW0, 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_bIsMT6139All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6139CW1ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6139REG::Get_MT6139CW0FromReg_Start( unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6139CW0FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Get_MT6139CW0FromReg( 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_MT6139_AUXOUT_CW0, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6139CW0( reg_data, m_sMT6139CW0, m_uiFinalRfid);
- if( ! m_bIsMT6139All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6139CW1FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW1 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Compose_MT6139CW1( S_MT6139_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_MT6139_CW1;
- }
- //---------------------------------------------------------------------------
- void CRFMT6139REG::DeCompose_MT6139CW1( unsigned int reg_data, S_MT6139_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 CRFMT6139REG::Set_MT6139CW1ToReg_Start( S_MT6139_CW1 &mt6140_cw1_par, unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_sMT6139CW1 = mt6140_cw1_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6139CW1ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW1ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6139CW1( m_sMT6139CW1, 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_bIsMT6139All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6139CW2ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6139REG::Get_MT6139CW1FromReg_Start( unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6139CW1FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Get_MT6139CW1FromReg( 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_MT6139_AUXOUT_CW1, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6139CW1( reg_data, m_sMT6139CW1, m_uiFinalRfid );
- if( ! m_bIsMT6139All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6139CW2FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW2 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Compose_MT6139CW2( S_MT6139_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_MT6139_CW2;
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::DeCompose_MT6139CW2( unsigned int reg_data, S_MT6139_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 CRFMT6139REG::Set_MT6139CW2ToReg_Start( S_MT6139_CW2 &mt6140_cw2_par, unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_sMT6139CW2 = mt6140_cw2_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6139CW2ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW2ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6139CW2( m_sMT6139CW2, 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_bIsMT6139All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6139CW3ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6139REG::Get_MT6139CW2FromReg_Start( unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6139CW2FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Get_MT6139CW2FromReg( 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_MT6139_AUXOUT_CW2, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6139CW2( reg_data, m_sMT6139CW2, m_uiFinalRfid );
- if( ! m_bIsMT6139All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6139CW3FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW3 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Compose_MT6139CW3( S_MT6139_CW3 &mt6139_cw3_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (mt6139_cw3_par.uc_txdivil << 13) |
- (mt6139_cw3_par.uc_rfmixpi << 12) |
- (mt6139_cw3_par.uc_rfmixpq << 11) |
- (mt6139_cw3_par.uc_rflnap << 10) |
- (mt6139_cw3_par.uc_syndivp << 9) |
- (mt6139_cw3_par.uc_synpfdp << 8) |
- (mt6139_cw3_par.uc_rxdivp << 7) |
- (mt6139_cw3_par.uc_ifpgap2 << 6) |
- (mt6139_cw3_par.uc_ifpgap1 << 5) |
- (mt6139_cw3_par.uc_ifpolp << 4) |
- ADDR_MT6139_CW3;
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::DeCompose_MT6139CW3( unsigned int reg_data, S_MT6139_CW3 &mt6139_cw3_par, unsigned int rf_id )
- {
- mt6139_cw3_par.uc_txdivil = (reg_data >> 9) & 0x01;
- mt6139_cw3_par.uc_rfmixpi = (reg_data >> 8) & 0x01;
- mt6139_cw3_par.uc_rfmixpq = (reg_data >> 7) & 0x01;
- mt6139_cw3_par.uc_rflnap = (reg_data >> 6) & 0x01;
- mt6139_cw3_par.uc_syndivp = (reg_data >> 5) & 0x01;
- mt6139_cw3_par.uc_synpfdp = (reg_data >> 4) & 0x01;
- mt6139_cw3_par.uc_rxdivp = (reg_data >> 3) & 0x01;
- mt6139_cw3_par.uc_ifpgap2 = (reg_data >> 2) & 0x01;
- mt6139_cw3_par.uc_ifpgap1 = (reg_data >> 1) & 0x01;
- mt6139_cw3_par.uc_ifpolp = reg_data & 0x01;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6139REG::Set_MT6139CW3ToReg_Start( S_MT6139_CW3 &mt6139_cw3_par, unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_sMT6139CW3 = mt6139_cw3_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6139CW3ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW3ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6139CW3( m_sMT6139CW3, 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_bIsMT6139All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6139CW4ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6139REG::Get_MT6139CW3FromReg_Start( unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6139CW3FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Get_MT6139CW3FromReg( 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_MT6139_AUXOUT_CW3, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6139CW3( reg_data, m_sMT6139CW3, m_uiFinalRfid);
- if( ! m_bIsMT6139All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6139CW4FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW4 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Compose_MT6139CW4( S_MT6139_CW4 &mt6139_cw4_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (mt6139_cw4_par.uc_otaen << 20) |
- (mt6139_cw4_par.uc_fldis << 19) |
- (mt6139_cw4_par.uc_cal_delay << 17) |
- (mt6139_cw4_par.uc_vco_vset << 15) |
- (mt6139_cw4_par.uc_dread << 14) |
- (mt6139_cw4_par.uc_calmode << 12) |
- (mt6139_cw4_par.uc_lgac << 11) |
- (mt6139_cw4_par.uc_modreg << 10) |
- (mt6139_cw4_par.uc_c_fra_in << 9) |
- (mt6139_cw4_par.uc_sxrstdiv << 8) |
- (mt6139_cw4_par.uc_syntyp << 7) |
- (mt6139_cw4_par.uc_synpfd << 5) |
- (mt6139_cw4_par.uc_sca_cr_fi << 4) |
- ADDR_MT6139_CW4;
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::DeCompose_MT6139CW4( unsigned int reg_data, S_MT6139_CW4 &mt6139_cw4_par, unsigned int rf_id )
- {
- mt6139_cw4_par.uc_otaen = (reg_data >>16) & 0x01;
- mt6139_cw4_par.uc_fldis = (reg_data >>15) & 0x01;
- mt6139_cw4_par.uc_cal_delay = (reg_data >>13) & 0x03;
- mt6139_cw4_par.uc_vco_vset = (reg_data >>11) & 0x03;
- mt6139_cw4_par.uc_dread = (reg_data >>10) & 0x01;
- mt6139_cw4_par.uc_calmode = (reg_data >> 8) & 0x03;
- mt6139_cw4_par.uc_lgac = (reg_data >> 7) & 0x01;
- mt6139_cw4_par.uc_modreg = (reg_data >> 6) & 0x01;
- mt6139_cw4_par.uc_c_fra_in = (reg_data >> 5) & 0x01;
- mt6139_cw4_par.uc_sxrstdiv = (reg_data >> 4) & 0x01;
- mt6139_cw4_par.uc_syntyp = (reg_data >> 3) & 0x01;
- mt6139_cw4_par.uc_synpfd = (reg_data >> 1) & 0x03;
- mt6139_cw4_par.uc_sca_cr_fi = reg_data & 0x01;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6139REG::Set_MT6139CW4ToReg_Start( S_MT6139_CW4 &mt6139_cw4_par, unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_sMT6139CW4 = mt6139_cw4_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6139CW4ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW4ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6139CW4( m_sMT6139CW4, 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_bIsMT6139All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6139CW5ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6139REG::Get_MT6139CW4FromReg_Start( unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6139CW4FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Get_MT6139CW4FromReg( 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_MT6139_AUXOUT_CW4, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6139CW4( reg_data, m_sMT6139CW4, m_uiFinalRfid);
- if( ! m_bIsMT6139All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6139CW5FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW5 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Compose_MT6139CW5( S_MT6139_CW5 &mt6139_cw5_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data =
- (mt6139_cw5_par.uc_resb << 9) |
- (mt6139_cw5_par.uc_res << 4) |
- ADDR_MT6139_CW5;
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::DeCompose_MT6139CW5( unsigned int reg_data, S_MT6139_CW5 &mt6139_cw5_par, unsigned int rf_id )
- {
-
- mt6139_cw5_par.uc_resb = (reg_data >> 5) & 0x1F;
- mt6139_cw5_par.uc_res = reg_data & 0x1F;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6139REG::Set_MT6139CW5ToReg_Start( S_MT6139_CW5 &mt6139_cw5_par, unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_sMT6139CW5 = mt6139_cw5_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6139CW5ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW5ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6139CW5( m_sMT6139CW5, 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_bIsMT6139All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6139CW6ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6139REG::Get_MT6139CW5FromReg_Start( unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6139CW5FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Get_MT6139CW5FromReg( 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_MT6139_AUXOUT_CW5, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6139CW5( reg_data, m_sMT6139CW5, m_uiFinalRfid );
- if( ! m_bIsMT6139All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6139CW6FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW6 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Compose_MT6139CW6( S_MT6139_CW6 &mt6139_cw6_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (mt6139_cw6_par.uc_t_clk << 16) |
- (mt6139_cw6_par.uc_t_latch << 15) |
- (mt6139_cw6_par.uc_vco_bufp << 14) |
- (mt6139_cw6_par.uc_monitor << 13) |
- (mt6139_cw6_par.uc_sio5 << 12) |
- (mt6139_cw6_par.uc_vco_sca << 5) |
- (mt6139_cw6_par.uc_vcoset << 4) |
- ADDR_MT6139_CW6;
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::DeCompose_MT6139CW6( unsigned int reg_data, S_MT6139_CW6 &mt6139_cw6_par, unsigned int rf_id )
- {
- mt6139_cw6_par.uc_t_clk = (reg_data >> 12) & 0x01;
- mt6139_cw6_par.uc_t_latch = (reg_data >> 11) & 0x01;
- mt6139_cw6_par.uc_vco_bufp = (reg_data >> 10) & 0x01;
- mt6139_cw6_par.uc_monitor = (reg_data >> 9) & 0x01;
- mt6139_cw6_par.uc_sio5 = (reg_data >> 8) & 0x01;
- mt6139_cw6_par.uc_vco_sca = (reg_data >> 1) & 0x7F;
- mt6139_cw6_par.uc_vcoset = reg_data & 0x01;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6139REG::Set_MT6139CW6ToReg_Start( S_MT6139_CW6 &mt6139_cw6_par, unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_sMT6139CW6 = mt6139_cw6_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6139CW6ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW6ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6139CW6( m_sMT6139CW6, 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_bIsMT6139All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6139CW7ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6139REG::Get_MT6139CW6FromReg_Start( unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6139CW6FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Get_MT6139CW6FromReg( 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_MT6139_AUXOUT_CW6, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6139CW6( reg_data, m_sMT6139CW6, m_uiFinalRfid );
- if( ! m_bIsMT6139All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6139CW7FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW7 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Compose_MT6139CW7( S_MT6139_CW7 &mt6139_cw7_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data =
- (mt6139_cw7_par.uc_lpf_corner << 14) |
- (mt6139_cw7_par.uc_man_cal << 13) |
- (mt6139_cw7_par.uc_auto_gain_select << 12) |
- (mt6139_cw7_par.uc_rx_gain << 4) |
- ADDR_MT6139_CW7;
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::DeCompose_MT6139CW7( unsigned int reg_data, S_MT6139_CW7 &mt6139_cw7_par, unsigned int rf_id )
- {
- mt6139_cw7_par.uc_lpf_corner = (reg_data>>10) & 0x01;
- mt6139_cw7_par.uc_man_cal = (reg_data>>9) & 0x01;
- mt6139_cw7_par.uc_auto_gain_select = (reg_data>>8) & 0x01;
- mt6139_cw7_par.uc_rx_gain = reg_data & 0xFF;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6139REG::Set_MT6139CW7ToReg_Start( S_MT6139_CW7 &mt6139_cw7_par, unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_sMT6139CW7 = mt6139_cw7_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6139CW7ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW7ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6139CW7( m_sMT6139CW7, 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_bIsMT6139All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6139CW8ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6139REG::Get_MT6139CW7FromReg_Start( unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6139CW7FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Get_MT6139CW7FromReg( 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_MT6139_AUXOUT_CW7, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6139CW7( reg_data, m_sMT6139CW7, m_uiFinalRfid );
- if( ! m_bIsMT6139All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6139CW8FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW8 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Compose_MT6139CW8( S_MT6139_CW8 &mt6139_cw8_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data =
- (mt6139_cw8_par.uc_rx_ctrl_sw << 19) |
- (mt6139_cw8_par.uc_rx_ctrl_swen << 18) |
- (mt6139_cw8_par.uc_dc_dac_bi << 11) |
- (mt6139_cw8_par.uc_dc_dac_ci << 4) |
- ADDR_MT6139_CW8;
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::DeCompose_MT6139CW8( unsigned int reg_data, S_MT6139_CW8 &mt6139_cw8_par, unsigned int rf_id )
- {
- mt6139_cw8_par.uc_rx_ctrl_sw = (reg_data>>15) & 0x1F;
- mt6139_cw8_par.uc_rx_ctrl_swen = (reg_data>>14) & 0x01;
- mt6139_cw8_par.uc_dc_dac_bi = (reg_data>>7 ) & 0x7F;
- mt6139_cw8_par.uc_dc_dac_ci = (reg_data ) & 0x7F;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6139REG::Set_MT6139CW8ToReg_Start( S_MT6139_CW8 &mt6139_cw8_par, unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_sMT6139CW8 = mt6139_cw8_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6139CW8ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW8ToReg( void )
- {
- unsigned int bsi_data;
- Compose_MT6139CW8( m_sMT6139CW8, 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_bIsMT6139All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6139CW9ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6139REG::Get_MT6139CW8FromReg_Start( unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6139CW8FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Get_MT6139CW8FromReg( 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_MT6139_AUXOUT_CW8, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6139CW8( reg_data, m_sMT6139CW8, m_uiFinalRfid );
- if( ! m_bIsMT6139All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6139CW9FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW9 /////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Compose_MT6139CW9( S_MT6139_CW9 &mt6139_cw9_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (mt6139_cw9_par.uc_pwr_dac_am << 21)|
- (mt6139_cw9_par.uc_pwr_dac_a << 20) |
- (mt6139_cw9_par.uc_pwr_dac_b << 19) |
- (mt6139_cw9_par.uc_pwr_dac_c << 18) |
- (mt6139_cw9_par.uc_dc_dac_bq << 11) |
- (mt6139_cw9_par.uc_dc_dac_cq << 4) |
- ADDR_MT6139_CW9;
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::DeCompose_MT6139CW9( unsigned int reg_data, S_MT6139_CW9 &mt6139_cw9_par, unsigned int rf_id )
- {
- mt6139_cw9_par.uc_pwr_dac_am = (reg_data>>17) & 0x01;
- mt6139_cw9_par.uc_pwr_dac_a = (reg_data>>16) & 0x01;
- mt6139_cw9_par.uc_pwr_dac_b = (reg_data>>15) & 0x01;
- mt6139_cw9_par.uc_pwr_dac_c = (reg_data>>14) & 0x01;
- mt6139_cw9_par.uc_dc_dac_bq = (reg_data>>7 ) & 0x7F;
- mt6139_cw9_par.uc_dc_dac_cq = (reg_data ) & 0x7F;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6139REG::Set_MT6139CW9ToReg_Start( S_MT6139_CW9 &mt6139_cw9_par, unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_sMT6139CW9 = mt6139_cw9_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6139CW9ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW9ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6139CW9( m_sMT6139CW9, 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_bIsMT6139All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6139CW10ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6139REG::Get_MT6139CW9FromReg_Start( unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6139CW9FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Get_MT6139CW9FromReg( 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_MT6139_AUXOUT_CW9, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6139CW9( reg_data, m_sMT6139CW9, m_uiFinalRfid );
- if( ! m_bIsMT6139All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6139CW10FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW10 ////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Compose_MT6139CW10( S_MT6139_CW10 &m_sMT6139CW10_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data = (m_sMT6139CW10_par.uc_am_daci << 11) |
- (m_sMT6139CW10_par.uc_am_dacq << 4) |
- ADDR_MT6139_CW10;
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::DeCompose_MT6139CW10( unsigned int reg_data, S_MT6139_CW10 &m_sMT6139CW10_par, unsigned int rf_id )
- {
- m_sMT6139CW10_par.uc_am_daci = (reg_data >> 7) & 0xFF;
- m_sMT6139CW10_par.uc_am_dacq = reg_data & 0xFF;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6139REG::Set_MT6139CW10ToReg_Start( S_MT6139_CW10 &mt6140_cw10_par, unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_sMT6139CW10 = mt6140_cw10_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6139CW10ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW10ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6139CW10( m_sMT6139CW10, 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_bIsMT6139All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6139CW11ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6139REG::Get_MT6139CW10FromReg_Start( unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6139CW10FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Get_MT6139CW10FromReg( 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_MT6139_AUXOUT_CW10, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6139CW10( reg_data, m_sMT6139CW10, m_uiFinalRfid );
- if( ! m_bIsMT6139All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6139CW11FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW11 ////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Compose_MT6139CW11( S_MT6139_CW11 &mt6140_cw11_par, unsigned int &bsi_data, unsigned int rf_id )
- {
- bsi_data =
- (mt6140_cw11_par.uc_txdiv_gc1<< 25) |
- (mt6140_cw11_par.uc_txdiv_gc0 << 24) |
- (mt6140_cw11_par.uc_txbiast << 22) |
- (mt6140_cw11_par.uc_tx_pw << 20) |
- (mt6140_cw11_par.uc_txvapc << 18) |
- (mt6140_cw11_par.uc_txflt << 14) |
- (mt6140_cw11_par.uc_txmodgain << 11) |
- (mt6140_cw11_par.uc_txdbuf << 10) |
- (mt6140_cw11_par.uc_txgbuf << 9) |
- (mt6140_cw11_par.uc_txdiv4 << 8) |
- (mt6140_cw11_par.uc_txdiv2 << 7) |
- (mt6140_cw11_par.uc_txdiqm << 6) |
- (mt6140_cw11_par.uc_txgiqm << 5) |
- (mt6140_cw11_par.uc_txctl << 4) |
- ADDR_MT6139_CW11;
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::DeCompose_MT6139CW11( unsigned int reg_data, S_MT6139_CW11 &mt6140_cw11_par, unsigned int rf_id )
- {
-
- mt6140_cw11_par.uc_txdiv_gc1 = (reg_data >> 21) & 0x01;
- mt6140_cw11_par.uc_txdiv_gc0 = (reg_data >> 20) & 0x01;
- mt6140_cw11_par.uc_txbiast = (reg_data >> 18) & 0x03;
- mt6140_cw11_par.uc_tx_pw = (reg_data >> 16) & 0x03;
- mt6140_cw11_par.uc_txvapc = (reg_data >> 14) & 0x03;
- mt6140_cw11_par.uc_txflt = (reg_data >> 10) & 0x0F;
- mt6140_cw11_par.uc_txmodgain = (reg_data >> 7) & 0x07;
- mt6140_cw11_par.uc_txdbuf = (reg_data >> 6) & 0x01;
- mt6140_cw11_par.uc_txgbuf = (reg_data >> 5) & 0x01;
- mt6140_cw11_par.uc_txdiv4 = (reg_data >> 4) & 0x01;
- mt6140_cw11_par.uc_txdiv2 = (reg_data >> 3) & 0x01;
- mt6140_cw11_par.uc_txdiqm = (reg_data >> 2) & 0x01;
- mt6140_cw11_par.uc_txgiqm = (reg_data >> 1) & 0x01;
- mt6140_cw11_par.uc_txctl = reg_data & 0x01;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6139REG::Set_MT6139CW11ToReg_Start( S_MT6139_CW11 &mt6140_cw11_par, unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_sMT6139CW11 = mt6140_cw11_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6139CW11ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW11ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6139CW11( m_sMT6139CW11, 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_bIsMT6139All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Set_MT6139CW15ToReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void CRFMT6139REG::Get_MT6139CW11FromReg_Start( unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6139CW11FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Get_MT6139CW11FromReg( 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_MT6139_AUXOUT_CW11, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6139CW11( reg_data, m_sMT6139CW11, m_uiFinalRfid );
- if( ! m_bIsMT6139All )
- {
- Confirm(METAAPP_SUCCESS);
- }
- else
- {
- ActiveMan->SetActiveFunction( ::Get_MT6139CW15FromReg );
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- //////////////////////////// CW15 ////////////////////////////////
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Compose_MT6139CW15( S_MT6139_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_MT6139_CW15;
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::DeCompose_MT6139CW15( unsigned int reg_data, S_MT6139_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 CRFMT6139REG::Set_MT6139CW15ToReg_Start( S_MT6139_CW15 &mt6140_cw15_par, unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_sMT6139CW15 = mt6140_cw15_par;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Set_MT6139CW15ToReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW15ToReg( void )
- {
- if( ! g_bIsRunning )
- { Confirm( METAAPP_FAIL ); return; }
- unsigned int bsi_data;
- Compose_MT6139CW15( m_sMT6139CW15, 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 CRFMT6139REG::Get_MT6139CW15FromReg_Start( unsigned int rf_id )
- {
- rf_mt6139reg_ptr = this;
- g_bIsRunning = true;
- m_bIsMT6139All = false;
- m_uiFinalRfid = rf_id;
- ActiveMan->SetActiveFunction( ::Get_MT6139CW15FromReg );
- }
- //----------------------------------------------------------------------------
- void CRFMT6139REG::Get_MT6139CW15FromReg( 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_MT6139_AUXOUT_CW15, ®_data);
- if(MetaResult!=META_SUCCESS)
- {
- if( MetaResult!=META_TIMEOUT )
- { Confirm( METAAPP_FAIL ); return; }
- else
- { Confirm( METAAPP_TIMEOUT ); return; }
- }
- DeCompose_MT6139CW15( reg_data, m_sMT6139CW15, m_uiFinalRfid );
- Confirm(METAAPP_SUCCESS);
- }
- //===========================================================================
- //////////////////////////// Global information ////////////////////////
- //===========================================================================
- //---------------------------------------------------------------------------
- E_METAAPP_RESULT_T CRFMT6139REG::Get_ConfirmState( void )
- {
- return m_eConfirmState;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6139_CW0 CRFMT6139REG::Get_MT6139CW0( void )
- { return m_sMT6139CW0;
- }
- //---------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW0( S_MT6139_CW0 &mt6140_cw0 )
- { m_sMT6139CW0 = mt6140_cw0;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6139_CW1 CRFMT6139REG::Get_MT6139CW1( void )
- { return m_sMT6139CW1;
- }
- //---------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW1( S_MT6139_CW1 &mt6140_cw1 )
- { m_sMT6139CW1 = mt6140_cw1;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6139_CW2 CRFMT6139REG::Get_MT6139CW2( void )
- { return m_sMT6139CW2;
- }
- //---------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW2( S_MT6139_CW2 &mt6140_cw2 )
- { m_sMT6139CW2 = mt6140_cw2;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6139_CW3 CRFMT6139REG::Get_MT6139CW3( void )
- { return m_sMT6139CW3;
- }
- //---------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW3( S_MT6139_CW3 &mt6140_cw3 )
- { m_sMT6139CW3 = mt6140_cw3;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6139_CW4 CRFMT6139REG::Get_MT6139CW4( void )
- { return m_sMT6139CW4;
- }
- //---------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW4( S_MT6139_CW4 &mt6140_cw4 )
- { m_sMT6139CW4 = mt6140_cw4;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6139_CW5 CRFMT6139REG::Get_MT6139CW5( void )
- { return m_sMT6139CW5;
- }
- //---------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW5( S_MT6139_CW5 &mt6140_cw5 )
- { m_sMT6139CW5 = mt6140_cw5;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6139_CW6 CRFMT6139REG::Get_MT6139CW6( void )
- { return m_sMT6139CW6;
- }
- //---------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW6( S_MT6139_CW6 &mt6140_cw6 )
- { m_sMT6139CW6 = mt6140_cw6;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6139_CW7 CRFMT6139REG::Get_MT6139CW7( void )
- { return m_sMT6139CW7;
- }
- //---------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW7( S_MT6139_CW7 &mt6140_cw7 )
- { m_sMT6139CW7 = mt6140_cw7;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6139_CW8 CRFMT6139REG::Get_MT6139CW8( void )
- { return m_sMT6139CW8;
- }
- //---------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW8( S_MT6139_CW8 &mt6140_cw8 )
- { m_sMT6139CW8 = mt6140_cw8;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6139_CW9 CRFMT6139REG::Get_MT6139CW9( void )
- { return m_sMT6139CW9;
- }
- //---------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW9( S_MT6139_CW9 &mt6140_cw9 )
- { m_sMT6139CW9 = mt6140_cw9;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6139_CW10 CRFMT6139REG::Get_MT6139CW10( void )
- { return m_sMT6139CW10;
- }
- //---------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW10( S_MT6139_CW10 &mt6140_cw10 )
- { m_sMT6139CW10 = mt6140_cw10;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6139_CW11 CRFMT6139REG::Get_MT6139CW11( void )
- { return m_sMT6139CW11;
- }
- //---------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW11( S_MT6139_CW11 &mt6140_cw11 )
- { m_sMT6139CW11 = mt6140_cw11;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- S_MT6139_CW15 CRFMT6139REG::Get_MT6139CW15( void )
- { return m_sMT6139CW15;
- }
- //---------------------------------------------------------------------------
- void CRFMT6139REG::Set_MT6139CW15( S_MT6139_CW15 &mt6140_cw15 )
- { m_sMT6139CW15 = mt6140_cw15;
- }