Cal_common.h
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:7k
- /*****************************************************************************
- * 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:
- * ---------
- * Cal_common.h
- *
- * Project:
- * --------
- * Maui META APP
- *
- * Description:
- * ------------
- * Calibration common header
- *
- * 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!!
- *============================================================================
- ****************************************************************************/
- //---------------------------------------------------------------------------
- #ifndef _CAL_COMMON_H_
- #define _CAL_COMMON_H_
- // RF
- #ifndef _RF_TXIQ_H_
- #include "rf_txiq.h"
- #endif
- // BT
- #ifndef _BT_INFO_MT6601_H_
- #include "bt_info_mt6601.h"
- #endif
- #ifndef _BT_INFO_MT6611_H_
- #include "bt_info_mt6611.h"
- #endif
- // WiFi
- #ifndef _WIFI_APC_H_
- #include "wifi_apc.h"
- #endif
- #ifndef _WIFI_ALC_H_
- #include "wifi_alc.h"
- #endif
- #ifndef _WIFI_TXDC_H_
- #include "wifi_txdc.h"
- #endif
- //------------------------------------------------------------------------------
- ///////////////////////// macro ////////////////////////////////////////////
- //------------------------------------------------------------------------------
- #define CHECK_TERMINATE_BY_USER if ( this->Terminated )
- {
- this->OnTerminate = neByUser;
- return false;
- }
-
- #define SUSPEND_CAL_THREAD is_suspend_cal = true;
- this->Suspend();
- is_suspend_cal = false;
- #define STOP_RF if (!MF_rf_stop.REQ_Start())
- {
- CalErrorHandler(WM_MF_RF_STOP_FAIL);
- log->Add(DateToStr(Date()) + " " + CurrentTimeStr() +
- " FAIL: Target < stop RF fail."
- );
- return false;
- }
- #define LogAdd(as_str) log->Add( DateToStr(Date()) + " " + CurrentTimeStr() + as_str )
- typedef struct
- {
- bool b_ip2_cal;
- bool b_afc_cal;
- bool b_rx_path_loss_cal;
- bool b_tx_iq_cal;
- bool b_tx_pcl_cal;
- bool b_trx_offset_cal;
- bool b_bt_cap_id_cal;
- bool b_adc_cal;
- bool b_cv_cal;
- bool b_wifi_tx_dc_offset_cal;
- bool b_wifi_tx_power_cal;
- }S_CAL_ITEM;
- typedef enum
- {
- TCVCXO=0,
- CRYSTAL
- }E_AFC_TYPE;
- typedef enum
- {
- RUN_TIME=0,
- WRITE_NVARM
- }E_CRYSTAL_CAP_ID_UPDATE;
- typedef struct
- {
- E_CRYSTAL_CAP_ID_UPDATE crystal_cap_id_update;
- // bool b_tx_afc_offset_cal;
- }S_CRYSTAL_AFC_OPTION;
- // TX IQ
- typedef enum
- {
- TX_IQ_GMSK=0,
- TX_IQ_EPSK
- }E_TX_IQ_TYPE;
- // APC
- typedef enum
- {
- TX_SLOT_SINGLE=0,
- TX_SLOT_MULTI
- }E_TX_SLOT;
- typedef enum
- {
- ONE_PCL=0,
- TWO_PCL,
- THREE_PCL,
- FOUR_PCL,
- SIX_DAC,
- FULL_PCL
- }E_APC_TYPE_T;
- typedef enum
- {
- APC_MOD_GMSK = 0x01,
- APC_MOD_EPSK = 0x02
- }E_APC_MOD;
- typedef enum
- {
- RFMD_3140 = 0,
- RFMD_3159,
- SKY_77328,
- SKY_77506,
- SKY_77316,
- SKY_77340,
- RENESAS_PF08155B,
- AXIOM_AX502,
- TRIQUINT_TQM6M5001,
- }E_PA_TYPE_T;
- typedef enum
- {
- PA_BIAS_FIXED = 0,
- PA_BIAS_DYN
- }E_PA_BIAS;
- typedef struct
- {
- CWIFIAPC* pc_WIFI_APC_Obj;
- CWIFIALC* pc_WIFI_ALC_Obj;
- CBTINFO6601* pc_BT_INFO6601_Obj;
- CBTINFO6611* pc_BT_INFO6611_Obj;
- CWIFITXDC* pc_WIFI_TXDC_Obj;
- }S_CAL_OBJ;
- typedef struct
- {
- int i_MainMETAHandle;
- bool b_TADOSupport;
- bool b_MultiSlotTxExSupport;
- bool b_WiFiAlcSupport;
- bool b_CalResultPath;
- bool b_ResetRfTester;
- AnsiString as_IniFile;
- AnsiString as_CalPath;
- AnsiString as_ResultBuf; // log
- BBCHIP_TYPE e_bb_chip;
- unsigned int ui_rf_id;
- RfMsCapabilityEx_S RfCapability;
- E_BBTXCFG_VER_T e_bbtxcfg_ver;
- WiFi_ChipCapability_S s_wifi_cap;
- BT_ModuleID_S s_bt_bb_id;
- S_CAL_ITEM s_CalItem;
- E_AFC_TYPE e_AFC_type;
- S_CRYSTAL_AFC_OPTION s_crystal_afc_option;
- E_TX_IQ_TYPE e_TX_IQ_type;
- E_APC_TYPE_T e_GMSK_APC_type;
- E_APC_TYPE_T e_EPSK_APC_type;
- int i_APC_mod;
- E_PA_TYPE_T e_PA_type;
- E_PA_BIAS e_PA_bias;
- E_TX_SLOT e_tx_slot;
- S_CAL_OBJ s_cal_obj;
- }S_CAL;
- #endif