misc.h
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:12k
- /*****************************************************************************
- * 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:
- * ---------
- * misc.h
- *
- * Project:
- * --------
- * Maui META APP
- *
- * Description:
- * ------------
- * Misc. function 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!!
- *============================================================================
- ****************************************************************************/
- #ifndef _MISC_H_
- #define _MISC_H_
- /*---------------------------------------------------------------------------*/
- #ifndef _RF_COMMON_H_
- #include "rf_common.h"
- #endif
- #ifndef _RF_APC_H_
- #include "rf_apc.h"
- #endif
- #ifndef _RF_AGC_H_
- #include "rf_agc.h"
- #endif
- //#include "visatype.h"
- /*---------------------------------------------------------------------------*/
- // GPIB
- extern bool getGPIBAddrNumFromStr(AnsiString as_str, int &i_gpib_addr_num);
- /*---------------------------------------------------------------------------*/
- // check
- // convert
- extern bool IsValidDelay(AnsiString ansi_str, int &delay);
- // RF tool
- extern bool IsValidARFCN(AnsiString ansi_str, E_BANDSEL band, short &arfcn);
- extern bool IsValidARFCN2(AnsiString ansi_str, E_BANDSEL band, short &arfcn);
- extern bool IsValidARFCNStep(AnsiString ansi_str, short &arfcn_step);
- extern bool IsValidApcLowestPower(AnsiString ansi_str, int band, int &apc_lowest_power);
- extern bool IsValidPMCount(AnsiString ansi_str, unsigned int &pmcount);
- extern bool IsValidAFCCount(AnsiString ansi_str, short &count);
- extern bool IsValidGain(AnsiString ansi_str, int &gain);
- extern bool IsValidPathLoss(AnsiString ansi_str, float &path_loss);
- extern bool IsValidPCL(AnsiString ansi_str, int band, int &pcl);
- extern bool IsValidCFGPCL(AnsiString ansi_str, int band, int &pcl);
- extern bool IsValidCFGMAX_P(AnsiString ansi_str, double &d_max_p);
- extern bool IsValidCFGWANTED_P(AnsiString ansi_str, double &d_wanted_p);
- extern bool IsValidCFGMIN_P(AnsiString ansi_str, double &d_min_p);
- extern bool IsValidCFGC(AnsiString ansi_str, double &d_c);
- extern bool IsValidCFGCORRECTION(AnsiString ansi_str, double &d_correction);
- extern bool IsValidCFGRecursiveTimes(AnsiString ansi_str, int &i_RecursiveTimes);
- extern bool IsValidCFGAPCDelta(AnsiString ansi_str, double &d_APCDelta);
- extern bool IsValidCFGTSC(AnsiString ansi_str, char &c_TSC);
- extern bool IsValidPCLDac(AnsiString ansi_str, unsigned short &pcl_dac);
- extern bool IsValidVbias(unsigned int ui_rf_id, AnsiString ansi_str, unsigned char &vbias);
- extern bool IsValidAFC(AnsiString ansi_str, short &afc);
- extern bool IsValidFreqErr(AnsiString ansi_str, double &freq_err );
- extern bool IsValidBand(AnsiString &band);
- extern bool IsValidCAPID63(AnsiString ansi_str, int &cap_id);
- extern bool IsValidCAPID127(AnsiString ansi_str, int &cap_id);
- extern bool IsValidCAPID511(AnsiString ansi_str, int &cap_id);
- extern bool IsValidAFCSlope(AnsiString ansi_str, int &slope);
- extern bool IsValid2GAFCSlope(AnsiString ansi_str, double &slope);
- extern bool IsValidCFGAFCSlope(AnsiString ansi_str, double &slope);
- extern bool IsValidTA(AnsiString ansi_str, int &ta);
- extern bool IsValidRegBit(AnsiString ansi_str, unsigned char &bit);
- extern bool IsValidMeasurementCount(AnsiString ansi_str, unsigned int &measuremnt_count);
- extern bool IsValidPeriod(AnsiString ansi_str, unsigned int &period);
- extern bool IsValidRefDetSlopeSkew(AnsiString ansi_str, unsigned char &skew);
- extern bool IsValidAmFbDac(AnsiString ansi_str, unsigned char &dac);
- // IP2
- extern bool IsValidSky74045Icorrection(AnsiString ansi_str, signed char &i_corr);
- extern bool IsValidSky74045Qcorrection(AnsiString ansi_str, signed char &q_corr);
- extern bool IsValidSky74117Icorrection(AnsiString ansi_str, signed char &i_corr);
- extern bool IsValidSky74117Qcorrection(AnsiString ansi_str, signed char &q_corr);
- extern bool IsValidAcode(AnsiString ansi_str, unsigned char &acode);
- extern bool IsValidAmcode(AnsiString ansi_str, unsigned char &amcode);
- extern bool IsValidAmcode127(AnsiString ansi_str, unsigned char &amcode);
- extern bool IsValidBcode(AnsiString ansi_str, unsigned char &bcode);
- extern bool IsValidCcode(AnsiString ansi_str, unsigned char &ccode);
- // Multi slot TX
- extern bool IsValidMultiSlotTxPattern(AnsiString ansi_str, unsigned short &pattern);
- // CT
- extern bool IsValidCTPattern(AnsiString ansi_str, unsigned short &pattern);
- // Renesas C3 register
- extern bool IsValidC3TA(AnsiString ansi_str, unsigned char &ta);
- extern bool IsValidC3TB(AnsiString ansi_str, unsigned char &tb);
- extern bool IsValidC3TC(AnsiString ansi_str, unsigned char &tc);
- extern bool IsValidC3TN(AnsiString ansi_str, unsigned char &tn);
- extern bool IsValidC3TO(AnsiString ansi_str, unsigned char &to);
- extern bool IsValidC3PM(AnsiString ansi_str, unsigned char &pm);
- // ramp profile
- extern bool IsValidRamp(AnsiString ansi_str, unsigned char &ramp);
- extern bool IsValidWeight(AnsiString ansi_str, unsigned int rf_id, unsigned short &weight);
- // BB TX parameters
- extern bool IsValidTrimIQ(AnsiString ansi_str, signed char &trim_iq);
- extern bool IsValidTrimIQStep(AnsiString ansi_str, char &trim_iq_step);
- extern bool IsValidOffsetIQ(E_BBTXCFG_VER_T eBbTxCfgVer, AnsiString ansi_str, signed char &offiq);
- extern bool IsValidBBTXCalibratedFlag(AnsiString ansi_str, unsigned char &cal_flag);
- extern bool IsValidOffsetIQStep(AnsiString ansi_str, char &off_iq_step);
- extern bool IsValidTxCalbias(E_BBTXCFG_VER_T eBbTxCfgVer, AnsiString ansi_str, signed char &calbias);
- extern bool IsValidTxIQSwap(AnsiString ansi_str, char &iq_swap);
- extern bool IsValidBBTXCommonModeVoltage(AnsiString ansi_str, signed char &voltage);
- extern bool IsValidBBTXGain(AnsiString ansi_str, signed char &gain);
- extern bool IsValidBBTXCalrcsel(AnsiString ansi_str, signed char &Calrcsel);
- extern bool IsValidBBTXPhasesel(E_BBTXCFG_VER_T eBbTxCfgVer, AnsiString ansi_str, signed char &Phasesel);
- extern bool IsValidBBTXPhaseselStep(AnsiString ansi_str, char &Phasesel_step);
- extern bool IsValidAPCBatLowVoltage(AnsiString ansi_str, double &voltage);
- extern bool IsValidAPCBatHighVoltage(AnsiString ansi_str, double &voltage);
- extern bool IsValidAPCBatLowTemperature(AnsiString ansi_str, double &temperature);
- extern bool IsValidAPCBatHighTemperature(AnsiString ansi_str, double &temperature);
- // ADC
- extern bool IsValidADCSlope(AnsiString ansi_str, int &slope);
- extern bool IsValidADCOffset(AnsiString ansi_str, int &offset);
- extern bool IsValidADCInput(AnsiString ansi_str, int &adc_input);
- extern bool IsValidADCVoltage(AnsiString ansi_str, int &adc_voltag);
- extern bool IsValidCurrentLimit(AnsiString ansi_str, int ¤t_limit);
- extern bool IsValidADCChannel(AnsiString ansi_str, int &adc_channel);
- extern bool IsValidADCResistance(AnsiString ansi_str, double &adc_resistance);
- extern bool IsValidADCMaxVoltageDifference(AnsiString ansi_str, double &adc_max_voltage_difference);
- extern bool IsValidADCMaxCurrentDifference(AnsiString ansi_str, double &adc_max_current_difference);
- extern bool IsValidADCMeasurementCount(AnsiString ansi_str, int &adc_measurement_count);
- // common CFG
- extern bool IsValidGPIBAddr(AnsiString ansi_str, int &GPIB_addr);
- extern bool IsValidTimeout(AnsiString ansi_str, int &timeout);
- extern bool IsValidCableLoss(AnsiString ansi_str, double &cable_loss);
- extern bool IsValidPower(AnsiString ansi_str, double &power);
- // AFC CFG
- extern bool IsValidCFGFrequencyErrorPPM(AnsiString ansi_str, double &ppm);
- extern bool IsValidCFGFrequencyError(AnsiString ansi_str, double &freq_err);
- // RX path loss CFG
- extern bool IsValidCFGPMCount(AnsiString ansi_str, char m_pm, short &n_pm);
- // phase error CFG
- extern bool IsValidPhaseError(AnsiString ansi_str, double &d_ph_err);
- // Battery compensate
- extern bool IsValidBatteryCompensate(AnsiString ansi_str, unsigned short &battery_compensate);
- // BV
- extern bool IsValidBVAP(AnsiString ansi_str, int &i_ap);
- extern bool IsValidBVAS(AnsiString ansi_str, int &i_as);
- extern bool IsValidBVAO(AnsiString ansi_str, int &i_ao);
- extern bool IsValidBVBD(AnsiString ansi_str, int &i_bd);
- extern bool IsValidBVKAG(AnsiString ansi_str, int &i_kag);
- extern bool IsValidBVKSG(AnsiString ansi_str, int &i_ksg);
- extern bool IsValidBVKAD(AnsiString ansi_str, int &i_kad);
- extern bool IsValidBVKSD(AnsiString ansi_str, int &i_ksd);
- extern bool IsValidBVVRE(AnsiString ansi_str, int &i_vre);
- extern bool IsValidBVVOF(AnsiString ansi_str, int &i_vof);
- extern bool IsValidBVARE(AnsiString ansi_str, int &i_are);
- extern bool IsValidBVAOF(AnsiString ansi_str, int &i_aof);
- // crystal
- extern bool IsValidTxAfcOffset(AnsiString ansi_str, short &tx_afc_offset);
- extern bool IsValidCTSTemperature(AnsiString ansi_str, float &temperature);
- extern bool IsValidCTSTemperatureStep(AnsiString ansi_str, float &temperature_step);
- // inter slot
- extern bool IsValidInterslotLowestDAC(AnsiString ansi_str, unsigned char &dac);
- // register
- extern bool IsValidHexBsiAddr(AnsiString ansi_str, unsigned int &bsi_addr);
- extern bool IsValidDecBsiAddr(AnsiString ansi_str, unsigned int &bsi_addr);
- extern bool IsValidHexBsiData(AnsiString ansi_str, unsigned int &bsi_data);
- extern bool IsValidDecBsiData(AnsiString ansi_str, unsigned int &bsi_data);
- /*---------------------------------------------------------------------------*/
- #endif