meta.h
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:167k
- /*****************************************************************************
- * 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) 2001
- *
- *****************************************************************************/
- /*******************************************************************************
- * Filename:
- * ---------
- * meta.h
- *
- * Project:
- * --------
- * META
- *
- * Description:
- * ------------
- * This module contains the definitions for using META_DLL.dll.
- *
- * Author:
- * -------
- * CH Liang (mtk00419)
- *
- *==============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * $Revision: 1.36 $
- * $Modtime: Jan 16 2006 17:47:32 $
- * $Log: //mtkvs01/vmdata/meta_dll/archives/maui/META_DLL/meta.h-arc $
- *
- * Feb 22 2008 mtk01569
- * [STP100001642] [Meta] Release MetaDLL_v5.0808.00
- *
- *
- * Dec 27 2007 mtk01569
- * [STP100001595] [Meta] Release MetaDLL_v5.0752.00
- *
- *
- * Nov 30 2007 mtk01569
- * [STP100001531] [Meta] Release MetaDLL_v5.7.00
- *
- *
- * Sep 7 2007 mtk01569
- * [STP100001502] [Meta] Release MetaDLL_v5.6.00
- *
- *
- * Jul 13 2007 mtk01569
- * [STP100001469] [Meta] Release MetaDLL_v5.5.00
- *
- *
- * Jun 14 2007 mtk01569
- * [STP100001435] [Meta] Release MetaDLL_v5.3.09
- *
- *
- * May 17 2007 MTK01569
- * [STP100001394] [Meta] Release MetaDLL_v5.3.08
- *
- *
- * Apr 20 2007 mtk01370
- * [STP100001370] [META]Release Meta DLL 5.3.07
- *
- *
- * Feb 6 2007 mtk01370
- * [STP100001303] [META_DLL]V5.3.06
- *
- *
- * Feb 2 2007 mtk01370
- * [STP100001303] [META_DLL]V5.3.06
- *
- *
- * Jan 9 2007 mtk01370
- * [STP100001286] [META_DLL]V.5.3.05
- *
- *
- * Nov 22 2006 mtk01370
- * [STP100001229] [Meta]Release 5.3.04
- *
- *
- * Nov 2 2006 mtk01370
- * [STP100001193] [META_DLL]V.5.3.03
- *
- *
- * Oct 11 2006 mtk01370
- * [STP100001168] [META_DLL]V.5.3.02
- *
- *
- * Sep 27 2006 mtk01370
- * [STP100001158] [Meta] Add NVRAM_r meta handle for parameter
- *
- *
- * Sep 27 2006 mtk00539
- * [STP100001144] META_DLL v5.3.01
- * 1. [UTIL] Add META_QueryIfTargetIsLowCostSingleBankFlash to query if target is Single-Bank-Flash solution.
- * 2. [UTIL] Add META_GetDLLVer and META_GetDLLInfo to get DLL's build information.
- * 3. [RF] Add META_Rf_GetAfcDacValueAtRTXOffsetCal to get AFC dac value in RTX offset calibration.
- * 4. [FAT] Add META_FAT_RemoveDir to remove directory on FAT.
- *
- *
- * Sep 11 2006 mtk01370
- * [STP100001140] [MetaDLL]Add BT cancel command and Check maui and DB comparison
- *
- *
- * Aug 23 2006 mtk01370
- * [STP100001094] [MetaDll] Compose IMEI 14 digit without CheckSum
- *
- *
- * Aug 18 2006 mtk00539
- * [STP100001063] META_DLL v5.3.00
- * Fix META_EnableWatchDogTimer() always timeout bug.
- *
- * Aug 16 2006 mtk00539
- * [STP100001063] META_DLL v5.3.00
- * Add new function META_GetDLLInfo().
- *
- * Aug 14 2006 mtk00539
- * [STP100001063] META_DLL v5.3.00
- *
- *
- * Jul 23 2006 mtk00539
- * [STP100001013] META_DLL v5.0.0007
- *
- *
- * Jul 19 2006 mtk01370
- * [STP100001013] META_DLL v5.0.0007
- *
- *
- * Jun 8 2006 mtk00539
- * [STP100000916] META_DLL_v5.0.0006
- *
- *
- * May 29 2006 mtk01370
- * [STP100000885] MetaDll BT and WatchDog
- *
- *
- * Apr 3 2006 mtk00539
- * [STP100000731] META_DLL v5.0.0004
- * 1. [BT] Add META_BT_QueryModuleID() to query BT module id.
- * 2. [CCT] Add OQC tool related calibration functions
- * META_CCT_DefectTable_OnOff()
- * META_CCT_DefectTableBypassAndBackupSetting()
- * META_CCT_DefectTableRestoreSetting()
- * META_CCT_AF_OnOff()
- * META_CCT_AF_LensOffsetCalibration()
- *
- *
- * Mar 13 2006 mtk00539
- * [STP100000683] [META_DLL][WiFi] Revise MCR, BB and EEPROM read/write functions
- *
- *
- * Mar 7 2006 mtk00539
- * [STP100000551] [META][CCT] Add defect-pixel calibration functions.
- *
- *
- * Feb 21 2006 mtk00539
- * [STP100000613] [META][NVRAM] Add META_NVRAM_LockDown() function to lock down NVRAM.
- *
- *
- * Jan 23 2006 mtk00539
- * [STP100000549] [META][WiFi] Add new functions to query target side WiFi interface.
- *
- *
- * Rev 1.36 Jan 18 2006 18:11:40 mtk00539
- * New features:
- * 1. [CCT] Export META_CCT_ReadReg() and META_CCT_WriteReg() functions.
- * 2. [RF] Merge EDGE calibration functions.
- * 3. [WiFi] Merge WiFi calibration functions.
- * 4. [MONZA] Merge MONZA project calibration functions.
- * Resolution for 160: [META_DLL v5.0.0000]
- *
- * Rev 1.35 Dec 29 2005 21:39:56 mtk00539
- * 1. [CCT] Fast capture via USB.
- * Resolution for 157: [META_DLL v3.7.0010][New][CCT] Fast capture via USB.
- *
- * Rev 1.34 Nov 18 2005 10:21:54 mtk00539
- * 1. [L1AUD][Enhance] New software architecture for DSP's Speech Enhancement functions.
- * 2. [CCT][New] Add ISP shading and auto-defect compensation.
- * Resolution for 148: [META_DLL v3.7.0008][L1AUD][Enhance] New software architecture for DSP's Speech Enhancement functions.
- *
- * Rev 1.33 Nov 01 2005 10:20:54 mtk00539
- * 1. [CCT][New] Add sensor engineer mode parameter read/write functions.
- * Resolution for 146: [META_DLL v3.7.0007][CCT][New] Add sensor engineer mode parameter read/write functions.
- *
- * Rev 1.32 Oct 18 2005 16:35:06 mtk00539
- * 1. [RF][New] Add Skyworks 74117 RF module support.
- * Resolution for 139: [META_DLL v3.7.0006][RF][New] Add Skyworks 74117 RF module support.
- *
- * Rev 1.31 Aug 10 2005 13:31:24 mtk00539
- * 1. [CCT][New] Add META_QueryIfTargetSupportISP() function.
- * 2. [CCT][New] Add new CCT_VAR_TO_K tag.
- * 3. [CCT][New] Add META_CCT_GetGammaTable(), META_CCT_SetGammaTable() functions.
- * Resolution for 126: [META_DLL v3.7.0003][New] Support MT6229 and MT6227 ISP.
- *
- * Rev 1.30 Jun 17 2005 17:09:54 mtk00539
- * 1. [CCT][New] Add META_CCT_MainLCDBackLight_TurnOn() and META_CCT_MainLCDBackLight_TurnOff().
- * 2. [CCT][New] Add META_CCT_GetBandingFactor().
- * 3. [CCT][New] Add META_CCT_GetSensorPregain() and META_CCT_SetSensorPregain().
- * 4. [RF][IP2] Add META_Rf_GetRFID(), META_Rf_SetRFImmediateBSI() and META_Rf_GetRFImmediateBSI().
- * 5. [RF][IP2] Add META_Rf_SKY74045_SetSpecialCoef(), META_Rf_MT6139B_SetSpecialCoef() and META_Rf_BRIGHT5P_SetSpecialCoef().
- * 6. Increase META_MAX_CONCURRENT_THREADS to 32.
- * Resolution for 120: [META_DLL v3.7.0001][CCT][New] Add CCT for SOP new functions.
- *
- * Rev 1.29 May 24 2005 22:36:26 mtk00539
- * 1. [NVRAM][New] Add META_NVRAM_ResetToFactoryDefault() to reset NVRAM to factory default setting.
- * 2. [RF][New] Add META_Rf_QueryIfTwoApcDCOffsetSupport() to query if two APC DC offset supported in target.
- * 3. [New] Add callback function in META_ConnectWithTarget() to do extra process after BootROM start command passed.
- * Resolution for 114: [META_DLL v3.7.0000][NVRAM][New] Add META_NVRAM_ResetToFactoryDefault() to reset NVRAM to factory default setting.
- *
- * Rev 1.28 Apr 18 2005 09:44:08 mtk00539
- * 1. [New] Add META_CancelAllBlockingCall(): CCT and all the reset of APIs share the same cancel event.
- * 2. [New] Add META_QueryIfFunctionSupportedByTarget() to query whether if the function is supported in target side.
- * 3. [New] Add META_BaudrateEnumToName() to translate META baudrate enum to string.
- * 4. [New] Add META_ConnectInMetaMode() and META_DisconnectInMetaMode() to skip BootROM and connect with target which is already in META mode.
- * 5. [Enhance] Reduce max threads from 16 to 4 to increase META_DLL initialization speed.
- * 6. [Enhance] Modify DecodeST module to report error from callback function.
- * 7. [RF][New] Add META_Rf_QueryMSCapability() to query target's RF bands and GSM/GPRS/EDGE capability.
- * 8. [RF][New] Add META_Rf_SetAfcSinWaveDetection() to allow sin wave input while doing AFC calibration.
- * 9. [RF][New] Add META_Rf_SetRampTable() to modify ramp table without updating NVRAM.
- * 10. [CCT][New] Add new capture APIs, META_CCT_SingleShotCaptureEx() and META_CCT_MultiShotCaptureEx().
- * 11. [CCT][Enhance] Change CCT_VAR_ATTR to only three category RW, RO and WO.
- * 12. [CCT][Enhance] Add bNoConfirm flag to ignore confirm in META_CCT_ResumeAeAwbPreviewFromUnfinishedCapture().
- * 13. [CCT][BUG FIX] Fix META_CCT_CaptureEx() memory heap access violation problem.
- * Resolution for 111: [META_DLL v3.6.0000] New RF APIs and CCT bug fixs.
- *
- * Rev 1.27 Dec 15 2004 17:45:40 mtk00539
- * modify baudrate enum META_BAUD56000 to META_BAUD57600
- * Resolution for 101: [META_DLL v3.5.0602][Enhance] Reset p_imeisv->imei to zero in META_NVRAM_Decompose_IMEISV().
- *
- * Rev 1.26 Dec 15 2004 14:49:42 mtk00539
- * [Enhance] Enhance Compose/Decompose IMEI string.
- * Resolution for 101: [META_DLL v3.5.0602][Enhance] Reset p_imeisv->imei to zero in META_NVRAM_Decompose_IMEISV().
- *
- * Rev 1.25 Dec 13 2004 12:00:40 mtk00539
- * 1. [Enhance] Reset p_imeisv->imei to zero in META_NVRAM_Decompose_IMEISV() to prevent incorrect stored value.
- * 2. [New] Add FAT Quota-Management return value.
- * Resolution for 101: [META_DLL v3.5.0602][Enhance] Reset p_imeisv->imei to zero in META_NVRAM_Decompose_IMEISV().
- *
- * Rev 1.24 Nov 01 2004 09:35:20 mtk00539
- * 1. [RF][New] Calibration of TXOffsetI/Q, TrimI/Q and TXgain on META mdoe.
- * 2. [New] Adapt BROM_DLL v2.4.1006 for base band chip auto-detection.
- * Resolution for 95: [META_DLL v3.5.0600][New] Calibration of TXOffsetI/Q, TrimI/Q and TXgain on META mdoe.
- *
- * Rev 1.23 Aug 17 2004 14:52:52 mtk00539
- * 1. [CCT][New] Add set/get manual shutter functions.
- * 2. [CCT][New] Add META_CCT_GenCameraParaTable to dynamically generate camera_para struct default values.
- * 3. [RF][New] Add META_Rf_SetCrystalCapId API to setup crystal cap_id directly without update NVRAM.
- * Resolution for 85: [META_DLL v3.5.0500][New] Add CCT & RF new functions.
- *
- * Rev 1.22 Aug 04 2004 12:03:40 mtk00539
- * 1. [BUG FIX] Use PulseEvent to signal cancel event instead of SetEvent, so that the cancel state won't keep signal and cause next CCT command skip.
- * 2. [BUG FIX] Not only disable unreferenced registers but also disable unreferenced variables in CCT_RegDB::EnableDevice().
- * 3. [BUG FIX] Only return the enabled device id in META_CCT_GetDeviceIds().
- * 4. [BUG FIX] Only count the enabled variables in META_CCT_GetNumOfVar().
- * Resolution for 80: [META_DLL v3.5.0401][BUG FIX] Fix CCT cancel event problem.
- *
- * Rev 1.21 Jun 23 2004 10:55:46 mtk00539
- * [Enhance] Add BootROM timeout argument in META_ConnectWithTarget function.
- *
- * Rev 1.20 Jun 21 2004 09:42:00 mtk00539
- * 1. [New] add new BBTXCFG command.
- * 2. [New] additional 8k speech output FIR in normal mode.
- * 3. [Enhance] add callback lock to prevent callback and cancel race-condition.
- * Resolution for 79: [META_DLL v3.5.04][New] add new BBTXCFG command and additional 8k speech output FIR in normal mode.
- *
- * Rev 1.19 May 28 2004 21:19:38 mtk00539
- * 1. [New] Add AE initial shutter command.
- * 2. [New] Send twice cancel primitive to target, because in FT task, canceling capture detection is no longer by checking if msg queue is empty, instead of checking if msg queue is increasing.
- * 3. [BUG FIX] Fix race-condition when capture was canceled, uninstall capture callback before leaving m_CCT_Confirm_Lock.
- * 4. [Enhance] Change enum type to unsigned type.
- * 5. [Enhance] Modify white-balance interface for more meaningful.
- * Resolution for 66: [META_DLL v3.5.03][New] add camera calibration.
- *
- * Rev 1.18 Apr 28 2004 11:47:22 mtk00539
- * 1. [New] add camera calibration function.
- * 2. [New] add META_ConnectWithTarget and META_DisconnectWithTarget for easier usage of target boot up.
- * Resolution for 66: [META_DLL v3.5.03][New] add camera calibration.
- *
- * Rev 1.17 Mar 29 2004 21:36:02 mtk00539
- * Check data type in GetMemberValue
- * Resolution for 63: [META_DLL v3.5.02][New] add FIR for WB-AMR and 64 tone polyphony.
- *
- * Rev 1.16 Mar 29 2004 09:59:10 mtk00539
- * 1. [New] add FIR for WB-AMR and 64 tone polyphony.
- * 2. [New] Add FAT get disk info command so that users can retrieve total size and free space from any drive you specify.
- * Resolution for 63: [META_DLL v3.5.02][New] add FIR for WB-AMR and 64 tone polyphony.
- *
- * Rev 1.15 Mar 19 2004 18:54:54 mtk00539
- * 1. [Enhance] Extend all FAT APIs timeout to 120 seconds.
- * 2. [BUG FIX] change func() to func(void) to fix header file compatibility for LabView.
- * 3. [BUG FIX] set default value to zero in GetMemberValue().
- * Resolution for 62: [META_DLL v3.5.01][Enhance] Extend all FAT APIs timeout to 120 seconds.
- *
- * Rev 1.14 Mar 12 2004 19:52:28 mtk00539
- * [META_DLL v3.5.00][New]
- * 1. [BUG FIX] Fix FAT unicode filename issue.
- * 2. [Enhance] Extend FAT delete/read/write timeout to 120 seconds.
- * 3. [Enhance] Extend max concurrent handle to 16.
- * 4. [New] Add APC temperature compensation.
- * 5. [New] Add Power off command.
- * 6. [New] Add META_DLL version sync command.
- * 7. [New] Move out the calibration structure definition from InternalDB, they will be imported by NVRAM database.
- * 8. [New] Change MP3 play interface to MEDIA play interface.
- * Resolution for 60: [META_DLL v3.5.00][New] Add APC temperature compensation and so on.
- *
- * Rev 1.13 Feb 07 2004 01:04:00 mtk00539
- * [META_DLL][New] Add new api for custom acoustic volume compose/decompose function
- * Resolution for 48: [META_DLL v3.4.1003][New] Add new api for custom acoustic volume compose/decompose function
- *
- * Rev 1.12 Jan 18 2004 17:22:22 mtk00539
- * 1. [New] Agilent requests for a multithread safe META_DLL that use concurrently open different comp ports.
- * 2. [New] merge new CatcherTran.
- * 3. [RF][New] add set afc dac value api.
- * Resolution for 44: [META_DLL v3.4.1002][New] Modify for multithread safe.
- *
- * Rev 1.11 Dec 03 2003 16:52:44 mtk00539
- * Add META_NVRAM_SWC_Enable_ForceUpgrade and META_NVRAM_SWC_Disable_ForceUpgrade
- * Resolution for 38: [META_DLL v3.4.1001][New] NVRAM S/W change support.
- *
- * Rev 1.10 Nov 28 2003 23:09:18 mtk00539
- * [New] NVRAM S/W change mechanism.
- * Resolution for 38: [META_DLL v3.4.1001][New] NVRAM S/W change support.
- *
- * Rev 1.9 Nov 18 2003 13:45:08 mtk00539
- * [BUG FIX] Sync NVRAM_EF_AUDIO_PARAM_LID struct after 0339
- * Resolution for 32: [META_DLL v3.3.1001][New] See the details below.
- *
- * Rev 1.8 Oct 23 2003 23:01:30 mtk00539
- * add new return value in case of FAT find not found.
- * Resolution for 32: [META_DLL v3.3.1001][New] See the details below.
- *
- * Rev 1.7 Oct 21 2003 18:56:26 mtk00539
- * 1. add META_WaitForTargetReady api.
- * 2. add META_SetSysTraceCallback api for gather assert info.
- * 3. add ok flag in pm and afc result.
- * Resolution for 32: [META_DLL v3.3.1001][New] See the details below.
- *
- * Rev 1.6 Sep 26 2003 17:03:30 mtk00539
- * 1. [NVRAM] Add META_NVRAM_Calculate_IMEI_Spare function.
- * 2. [NVRAM] Modify META_NVRAM_Compose_IMEISV function to automatically calculate spare digit.
- * Resolution for 30: [META_DLL v3.2.1002][Add Feature] Add META_NVRAM_Calculate_IMEI_Spare function.
- *
- * Rev 1.5 Sep 18 2003 10:45:32 mtk00539
- * extend com port number
- * Resolution for 27: [META_DLL v3.2.1001][New] Adapt new CatcherTran database format
- *
- * Rev 1.4 Sep 02 2003 14:52:04 mtk00539
- * 1. [AUDIO] Switch audio testing to L4AUD instead of L1Audio.
- * 2. [FAT] Add MOVE, DELETE and FIND function for FAT operation.
- * 3. [RF] Add new api META_Rf_SetRampApcLevel().
- * 4. [NVRAM] Add IMEISV and L1audio parameter compose/decompose functions.
- * 5. Enlarge VerInfo_Cnf member.
- * Resolution for 26: [META_DLL v3.1.1001][Add Feature] See the reasons below.
- *
- * Rev 1.3 Aug 03 2003 13:34:14 mtk00539
- * 1. UART S/W flow control support.
- * 2. FAT operation.
- * 3. GPRS MultiSlot TX and InterRamp calibration data.
- * 4. Crystal calibration data.
- * 5. Target S/W, H/W and Melody version retrieval.
- * 6. Runtime debug log turn on/off in both release and debug version of DLL.
- * 7. [BUG FIX] Fix META_GetVersion() memory leak.
- * 8. [Enhance] Fixed ordinal number of each APIs META_DLL.dll exported.
- * Resolution for 23: [META_DLL v3.0.1001][AddFeature] S/W flow control support, FAT Read/Write, GPRS MultiSlot TX and Crystal Calibration Data, and bug fixed.
- *
- * Rev 1.2 May 20 2003 15:21:44 mtk00539
- * modify for new interface for VB
- * Resolution for 5: [META_DLL v2.2][AddFeature] Modify META_DLL for both C/C++ and VB support.
- *
- * Rev 1.1 Apr 01 2003 09:42:36 mtk00539
- * 1. add description for error code
- * 2. BUG: change RfTestResultAfc.fcb_ok to RfTestResultAfc.fcb_ok_number
- * 3. add NVRAM Editor relative APIs.
- * 4. add L1SP audio coefficient compose/decompose APIs
- * 5. change baseband status from kal_bool to kal_uint8
- * 6. change enum META_ERR_CODE to META_CNF_ERR_CODE.
- * 7. use unsigned char instead of BOOL.
- * 8. BUG: fix type inconsistent with primitive.sel
- * 9. export CatcherTran pointer instead of InternalDB for META_NVRAM_Init()
- * 10. add META_NVRAM_SetRecFieldBitValue() and META_NVRAM_GetRecFieldBitValue().
- * Resolution for 3: [META_DLL v2.0][AddFeature] Add new features for META_DLL v2.0
- *
- * Rev 1.0 Feb 25 2003 13:24:20 admin
- * Initial revision.
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *==============================================================================
- *******************************************************************************/
- #ifndef META_DLL_H
- #define META_DLL_H
- #include "brom.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- //--------------------------------------------------------------------------//
- // META General //
- //--------------------------------------------------------------------------//
- //-----------------------------------------------------//
- // META General: data structure definition //
- //-----------------------------------------------------//
- typedef enum
- {
- // META_DLL received a corrupted frame
- META_CNF_FRAME_ERROR = 0,
- // META_DLL received a confirm or indication from target,
- // but there is not corresponding call back function
- // installed for this confirm or indication.
- META_CNF_NO_CALLBACK = 1,
- // META_DLL received a corrupted primitive.
- META_CNF_PRIMITIVE_ERROR = 2,
- // META_DLL received a confirm or indication from
- // target, but there is no sufficient memory to process.
- META_CNF_NO_MEMORY = 3,
- // META_DLL retrieved a callback function, however,
- // the user input arguments are invalid.
- META_CNF_CALLBACK_PARAMETER_ERROR = 4,
- // META_DLL received a confirm with peer msg, however,
- // the peer msg is corrupted.
- META_CNF_PEER_MSG_ERROR = 5,
- // META_DLL received a confirm and successfully executed
- // the callback function.
- META_CNF_OK = 6
- } META_CNF_ERR_CODE;
- // The magic value to stop usb enumerate process
- #define ENUM_USB_STOP 9876
- typedef enum
- {
- META_SUCCESS = 0
- ,META_FAILED
- ,META_COMM_FAIL
- ,META_NORESPONSE
- ,META_BUFFER_LEN
- ,META_FILE_BAD
- ,META_LID_INVALID
- ,META_INTERNAL_DB_ERR
- ,META_NO_MEMORY
- ,META_INVALID_ARGUMENTS
- ,META_TIMEOUT
- ,META_BUSY
- ,META_INVALID_HANDLE
- ,META_FAT_ERROR
- ,META_FAT_DISK_FULL
- ,META_FAT_ROOT_DIR_FULL
- ,META_FAT_INVALID_FILENAME
- ,META_FAT_INVALID_FILE_HANDLE
- ,META_FAT_FILE_NOT_FOUND
- ,META_FAT_DRIVE_NOT_FOUND
- ,META_FAT_PATH_NOT_FOUND
- ,META_FAT_ACCESS_DENIED
- ,META_FAT_TOO_MANY_FILES
- ,META_INCORRECT_TARGET_VER
- ,META_COM_ERROR
- ,META_BROM_CMD_ERROR
- ,META_INCORRECT_BBCHIP_TYPE
- ,META_BROM_ERROR
- ,META_STOP_BOOTUP_PROCEDURE
- ,META_CANCEL
- ,META_CCT_NOT_IMPORT_PROFILE
- ,META_CCT_INVALID_SENSOR_ID
- ,META_CCT_TGT_NO_MEM_FOR_SINGLE_SHOT
- ,META_CCT_TGT_NO_MEM_FOR_MULTI_SHOT
- ,META_FUNC_NOT_IMPLEMENT_YET
- ,META_CCT_NOT_IMPLEMENT_YET = META_FUNC_NOT_IMPLEMENT_YET
- ,META_CCT_PREVIEW_ALREADY_STARTED
- ,META_CCT_PREVIEW_ALREADY_STOPPED
- ,META_CCT_READ_REG_NO_CNF
- ,META_CCT_WRITE_REG_NO_CNF
- ,META_CCT_TGT_ABORT_IMAGE_SENDING
- ,META_CCT_READ_ONLY_REGISTER
- ,META_CCT_LOAD_FROM_NVRAM_FAIL
- ,META_CCT_SAVE_TO_NVRAM_FAIL
- ,META_CCT_AE_INVALID_EC_LEVEL
- ,META_CCT_AE_INVALID_EC_STEP
- ,META_CCT_AE_ALREADY_ENABLED
- ,META_CCT_AE_ALREADY_DISABLED
- ,META_CCT_WB_INVALID_INDEX
- ,META_CCT_NO_TGT_SENSOR_MATCH_IN_PROFILE
- ,META_CCT_IMAGE_SENDING_FAME_NUM_ERROR
- ,META_CCT_AE_IS_NOT_DISABLED
- ,META_FAT_APP_QUOTA_FULL
- ,META_IMEI_CD_ERROR
- ,META_RFID_MISMATCH
- ,META_NVRAM_DB_IS_NOT_LOADED_YET
- ,META_CCT_ERR_CAPTURE_WIDTH_HEIGHT_TOO_SMALL
- ,META_WAIT_FOR_TARGET_READY_TIMEOUT
- ,META_CCT_ERR_SENSOR_ENG_SET_INVALID_VALUE
- ,META_CCT_ERR_SENSOR_ENG_GROUP_NOT_EXIST
- ,META_CCT_NO_TGT_ISP_MATCH_IN_PROFILE
- ,META_CCT_TGT_ISP_SUPPORT_NOT_DEFINED
- ,META_CCT_ERR_SENSOR_ENG_ITEM_NOT_EXIST
- ,META_CCT_ERR_INVALID_COMPENSATION_MODE
- ,META_CCT_ERR_USB_COM_NOT_READY
- ,META_CCT_DEFECTPIXEL_CAL_UNDER_PROCESSING
- ,META_CCT_ERR_DEFECTPIXEL_CAL_NO_MEM
- ,META_CCT_ERR_TOO_MANY_DEFECT_PIXEL
- ,META_CCT_ERR_CAPTURE_JPEG_FAIL
- ,META_CCT_ERR_CAPTURE_JPEG_TIMEOUT
- ,META_CCT_ERR_AF_FAIL
- ,META_CCT_ERR_AF_TIMEOUT
- ,META_CCT_ERR_AF_LENS_OFFSET_CAL_FAIL
- ,META_CCT_ERR_PREVIEW_MUST_ENABLE
- ,META_CCT_ERR_UNSUPPORT_CAPTURE_FORMAT
- ,META_CCT_ERR_EXCEED_MAX_DEFECT_PIXEL
- ,META_ERR_EXCEED_MAX_PEER_BUF_SIZE
- ,META_CCT_ERR_INVALID_WIDTH_FACTOR
- ,META_BROM_SECURITY_CHECK_FAIL
- ,META_CCT_ERR_PREVIEW_MUST_DISABLE
- ,META_MAUI_DB_INCONSISTENT
- ,META_FAT_FILEPATH_TOO_LONG
- ,META_FAT_RESTRICTED_FILEPATH
- ,META_FAT_DIR_NOT_EXIST
- ,META_FAT_DISK_SPACE_IS_NOT_ENOUGH
- ,META_TDMB_ERR_BAND_NOT_EXIST
- ,META_TDMB_ERR_FREQ_NOT_EXIST
- ,META_TDMB_ERR_ENSM_NOT_EXIST
- ,META_TDMB_ERR_SERV_NOT_EXIST
- ,META_TDMB_ERR_SUB_CHAN_NOT_EXIST
- ,META_TDMB_ERR_DEMOD_STATE
- ,META_PERMISSION_DENIED
- ,META_ENUMERATE_USB_FAIL
- ,META_STOP_ENUM_USB_PROCEDURE
- ,META_LAST_RESULT
- } META_RESULT;
- typedef enum {
- META_BAUD2400 = 0,
- META_BAUD4800,
- META_BAUD9600,
- META_BAUD14400,
- META_BAUD19200,
- META_BAUD57600,
- META_BAUD115200,
- META_BAUD230400,
- META_BAUD460800,
- META_BAUD921600,
- META_BAUD_END = 0xFF
- } META_COMM_BAUDRATE;
- typedef enum {
- META_NO_FLOWCTRL = 0, // no flow control
- META_SW_FLOWCTRL, // enable S/W flow control
- META_FLOWCTRL_END
- } META_FLOWCTRL;
- typedef struct {
- char BB_CHIP[64]; // BaseBand chip version
- char ECO_VER[4]; // ECO version
- char DSP_FW[64]; // DSP firmware version
- char DSP_PATCH[64]; // DSP patch version
- char SW_VER[64]; // S/W version
- char HW_VER[64]; // H/W board version
- char MELODY_VER[64]; // Melody version
- } VerInfo_Cnf;
- typedef struct
- {
- unsigned short com_port_list[255];
- unsigned short com_port_num;
- unsigned int ms_connect_timeout; // [META] META enumerate port timeout value
- }META_Enumerate_USB_Req;
- typedef struct {
- int com_port;
- META_COMM_BAUDRATE baudrate[11]; // [META] META stage baudrate polling array, it must end with META_BAUD_END.
- META_FLOWCTRL flowctrl; // [META] META stage uart flow control type.
- BOOT_META_ARG boot_meta_arg; // [BootROM] please refer to brom.h
- unsigned int ms_connect_timeout; // [META] META stage sync timeout value (after BootROM negotiation pass)
- } META_Connect_Req;
- typedef struct {
- META_COMM_BAUDRATE final_baudrate; // [META] Detected META stage baudrate.
- unsigned int meta_ver_required_by_target; // [META] Target required META_DLL version.
- BOOT_RESULT boot_result; // [BootROM] boot-up result.
- STATUS_E boot_meta_ret; // [BROM_DLL] The return code of Boot_META function.
- } META_Connect_Report;
- typedef struct {
- int com_port;
- BOOT_META_ARG boot_meta_arg; // [BootROM] please refer to brom.h
- unsigned int ms_connect_timeout; // [META] META stage sync timeout value (after BootROM negotiation pass)
- } META_ConnectByUSB_Req;
- typedef struct {
- unsigned int meta_ver_required_by_target; // [META] Target required META_DLL version.
- BOOT_RESULT boot_result; // [BootROM] boot-up result.
- STATUS_E boot_meta_ret; // [BROM_DLL] The return code of Boot_META function.
- } META_ConnectByUSB_Report;
- typedef struct {
- int com_port;
- META_COMM_BAUDRATE baudrate[11]; // [META] META stage baudrate polling array, it must end with META_BAUD_END.
- META_FLOWCTRL flowctrl; // [META] META stage uart flow control type.
- unsigned int ms_connect_timeout; // [META] META stage sync timeout value (after BootROM negotiation pass)
- } META_ConnectInMETA_Req;
- typedef struct {
- META_COMM_BAUDRATE final_baudrate; // [META] Detected META stage baudrate.
- unsigned int meta_ver_required_by_target; // [META] Target required META_DLL version.
- } META_ConnectInMETA_Report;
- //-----------------------------------------------------//
- // META General: callback function definition //
- //-----------------------------------------------------//
- typedef void (__stdcall *META_Error_CallBack)(const META_CNF_ERR_CODE mr);
- typedef void (__stdcall *META_SysTrace_CallBack)(const char *sys_trace);
- typedef void (__stdcall *META_GET_VERSION_INFO_CNF)(const VerInfo_Cnf *cnf, const short token, void *usrData);
- //-----------------------------------------------------//
- // META for CTI //
- //-----------------------------------------------------//
- typedef enum {
- CTI_OK = 0
- ,CTI_MISSING_HEADER
- ,CTI_CORRUPTED_FAME
- ,CTI_EXCEED_LEN
- } CTI_RET_ENUM;
- typedef void (__stdcall *META_CTI_CallBack)(CTI_RET_ENUM ret, const int size, const unsigned char *data, void *param);
- META_RESULT __stdcall META_CTI_SendPacketCmd(const unsigned char *pPayLoadBuffer, int nPayloadLength);
- META_RESULT __stdcall META_CTI_SendPacketCmd_r(const int meta_handle, const unsigned char *pPayLoadBuffer, int nPayloadLength);
- META_RESULT __stdcall META_CTI_SetPacketCallback(META_CTI_CallBack pCBFunc, void* param);
- META_RESULT __stdcall META_CTI_SetPacketCallback_r(const int meta_handle, META_CTI_CallBack pCBFunc, void* param);
- //-----------------------------------------------------//
- // Switch TST message format //
- //-----------------------------------------------------//
- typedef enum {
- META_TST_MSG_2G = 0,
- META_TST_MSG_3G
- } META_TST_MSG_FORMAT;
- META_RESULT __stdcall META_SetTstMsgFormat(META_TST_MSG_FORMAT msg_fmt);
- META_RESULT __stdcall META_SetTstMsgFormat_r(const int meta_handle, META_TST_MSG_FORMAT msg_fmt);
- //-----------------------------------------------------//
- // META Debug: exported debug function definition //
- //-----------------------------------------------------//
- META_RESULT __stdcall META_DebugOn();
- META_RESULT __stdcall META_DebugOn_ex(const int meta_handle);
- META_RESULT __stdcall META_DebugOff();
- META_RESULT __stdcall META_DebugClear();
- //-----------------------------------------------------//
- // META UnitTest //
- //-----------------------------------------------------//
- typedef struct {
- unsigned int m_TestCaseID;
- const char * m_pDescription;
- } META_UT_TestCaseID_T;
- void __stdcall META_QueryTestCase(META_UT_TestCaseID_T **ppTestCase, unsigned int *pTestCaseCount);
- void __stdcall META_UnitTest(const unsigned int *p_TestCaseID_Array, unsigned int TestCaseCount);
- //-----------------------------------------------------//
- // META General: exported function definition //
- //-----------------------------------------------------//
- #define FT_MT_UNKNOWN 0
- #define FT_MT6305 1
- #define FT_MT6318 2
- typedef struct {
- unsigned char id;
- } PMIC_ID;
- typedef struct {
- unsigned int pcl;
- } RF_GetITC_PCL;
- // General
- void __stdcall META_GetDLLVer(unsigned int *major_ver, unsigned int *minor_ver, unsigned int *build_num, unsigned int *patch_num);
- void __stdcall META_GetDLLInfo(const char **pp_version, const char **pp_release_type, const char **pp_build_date, const char **pp_load_path);
- void __stdcall META_Cancel(const short token);
- void __stdcall META_Cancel_r(const int meta_handle, const short token);
- void __stdcall META_CancelAllBlockingCall(void);
- void __stdcall META_CancelAllBlockingCall_r(const int meta_handle);
- META_RESULT __stdcall META_QueryIfFunctionSupportedByTarget(unsigned int ms_timeout, const char *query_func_name);
- META_RESULT __stdcall META_QueryIfFunctionSupportedByTarget_r(const int meta_handle, unsigned int ms_timeout, const char *query_func_name);
- META_RESULT __stdcall META_QueryIfTargetSupportISP(unsigned int ms_timeout);
- META_RESULT __stdcall META_QueryIfTargetSupportISP_r(const int meta_handle, unsigned int ms_timeout);
- META_RESULT __stdcall META_QueryIfTargetSupportAcoustic16level(unsigned int ms_timeout);
- META_RESULT __stdcall META_QueryIfTargetSupportAcoustic16level_r(const int meta_handle, unsigned int ms_timeout);
- META_RESULT __stdcall META_QueryIfTargetSupportAudioParam45Tap(unsigned int ms_timeout);
- META_RESULT __stdcall META_QueryIfTargetSupportAudioParam45Tap_r(const int meta_handle, unsigned int ms_timeout);
- META_RESULT __stdcall META_QueryIfTargetIsLowCostSingleBankFlash(unsigned int ms_timeout);
- META_RESULT __stdcall META_QueryIfTargetIsLowCostSingleBankFlash_r(const int meta_handle, unsigned int ms_timeout);
- META_RESULT __stdcall META_QueryPMICID(unsigned int ms_timeout, PMIC_ID *cnf);
- META_RESULT __stdcall META_QueryPMICID_r(const int meta_handle, unsigned int ms_timeout, PMIC_ID *cnf);
- META_RESULT __stdcall META_BTPowerOn(unsigned int ms_timeout);
- META_RESULT __stdcall META_BTPowerOn_r(const int meta_handle, unsigned int ms_timeout);
- META_RESULT __stdcall META_QueryIfTargetSupportWifiALC(unsigned int ms_timeout);
- META_RESULT __stdcall META_QueryIfTargetSupportWifiALC_r(const int meta_handle, unsigned int ms_timeout);
- META_RESULT __stdcall META_QueryITC_PCL(unsigned int ms_timeout, RF_GetITC_PCL *cnf);
- META_RESULT __stdcall META_QueryITC_PCL_r(const int meta_handle, unsigned int ms_timeout, RF_GetITC_PCL *cnf);
- META_RESULT __stdcall META_QueryIfTargetSupportDRC(unsigned int ms_timeout);
- META_RESULT __stdcall META_QueryIfTargetSupportDRC_r(const int meta_handle, unsigned int ms_timeout);
- META_RESULT __stdcall META_QueryIfBTPowerOn(unsigned int ms_timeout);
- META_RESULT __stdcall META_QueryIfBTPowerOn_r(const int meta_handle, unsigned int ms_timeout);
- //-----------------------------------------------------//
- // UTILITY--ENABLE WATCHDOG //
- //-----------------------------------------------------//
- #define GPIO_DEV_LED_MAINLCD 0
- //#define GPIO_DEV_LED_SUBLCD 1
- typedef struct {
- unsigned int ms_timeout_interval;
- } FtWatchDog;
- typedef struct {
- unsigned char led_light_level;
- } FtLEDLevel;
- typedef struct {
- unsigned char lcd_type;
- unsigned char lcd_light_level;
- } FtLCDLevel;
- typedef struct {
- unsigned char onoff;
- } FtVibratorOnOff;
- typedef struct {
- unsigned char m_rtc_sec; /* seconds after the minute - [0,59] */
- unsigned char m_rtc_min; /* minutes after the hour - [0,59] */
- unsigned char m_rtc_hour; /* hours after the midnight - [0,23] */
- unsigned char m_rtc_day; /* day of the month - [1,31] */
- unsigned char m_rtc_mon; /* months - [1,12] */
- unsigned char m_rtc_wday; /* days in a week - [1,7] */
- unsigned char m_rtc_year;
- } T_Rtc;
- META_RESULT __stdcall META_EnableWatchDogTimer(unsigned int ms_timeout, FtWatchDog *req);
- META_RESULT __stdcall META_EnableWatchDogTimer_r(const int meta_handle, unsigned int ms_timeout, FtWatchDog *req);
- META_RESULT __stdcall META_SetLEDLightLevel(unsigned int ms_timeout, FtLEDLevel *req);
- META_RESULT __stdcall META_SetLEDLightLevel_r(const int meta_handle, unsigned int ms_timeout, FtLEDLevel *req);
- META_RESULT __stdcall META_SetVibratorOnOff(unsigned int ms_timeout, FtVibratorOnOff *req);
- META_RESULT __stdcall META_SetVibratorOnOff_r(const int meta_handle, unsigned int ms_timeout, FtVibratorOnOff *req);
- META_RESULT __stdcall META_QueryLocalTime(unsigned int ms_timeout, T_Rtc *cnf);
- META_RESULT __stdcall META_QueryLocalTime_r(const int meta_handle, unsigned int ms_timeout, T_Rtc *cnf);
- META_RESULT __stdcall META_SetMainSubLCDLightLevel(unsigned int ms_timeout, FtLCDLevel *req);
- META_RESULT __stdcall META_SetMainSubLCDLightLevel_r(const int meta_handle, unsigned int ms_timeout, FtLCDLevel *req);
- const char * __stdcall META_GetErrorString(META_RESULT ErrCode);
- const char * __stdcall META_BaudrateEnumToName(META_COMM_BAUDRATE baudrate);
- // Initialization
- META_RESULT __stdcall META_GetAvailableHandle(int *p_meta_handle);
- META_RESULT __stdcall META_Init(const META_Error_CallBack cb);
- META_RESULT __stdcall META_Init_r(const int meta_handle, const META_Error_CallBack cb);
- META_RESULT __stdcall META_SetSysTraceCallback(const META_SysTrace_CallBack sys_cb);
- META_RESULT __stdcall META_SetSysTraceCallback_r(const int meta_handle, const META_SysTrace_CallBack sys_cb);
- void __stdcall META_Deinit(void);
- void __stdcall META_Deinit_r(int *p_meta_handle);
- // connect with target
- META_RESULT __stdcall META_ConnectWithTarget(const META_Connect_Req *req, int *p_bootstop, META_Connect_Report *p_report);
- META_RESULT __stdcall META_ConnectWithTarget_r(const int meta_handle, const META_Connect_Req *req, int *p_bootstop, META_Connect_Report *p_report);
- // dsiconnect and shutdown target
- META_RESULT __stdcall META_DisconnectWithTarget(void);
- META_RESULT __stdcall META_DisconnectWithTarget_r(const int meta_handle);
- // connect with target when target already in meta mode
- META_RESULT __stdcall META_ConnectInMetaMode(const META_ConnectInMETA_Req *req, int *p_bootstop, META_ConnectInMETA_Report *p_report);
- META_RESULT __stdcall META_ConnectInMetaMode_r(const int meta_handle, const META_ConnectInMETA_Req *req, int *p_bootstop, META_ConnectInMETA_Report *p_report);
- // dsiconnect without shutdown target
- META_RESULT __stdcall META_DisconnectInMetaMode(void);
- META_RESULT __stdcall META_DisconnectInMetaMode_r(const int meta_handle);
- // USB-related connect
- META_RESULT __stdcall META_ConnectWithTargetByUSB(const META_ConnectByUSB_Req *req, int *p_bootstop, META_ConnectByUSB_Report *p_report);
- META_RESULT __stdcall META_ConnectWithTargetByUSB_r(const int meta_handle, const META_ConnectByUSB_Req *req, int *p_bootstop, META_ConnectByUSB_Report *p_report);
- META_RESULT __stdcall META_GetDynamicUSBComPort(unsigned int ms_scan_timeout, unsigned short *com_port, int *p_scanstop);
- META_RESULT __stdcall META_GetDynamicUSBComPort_r(const int meta_handle, unsigned int ms_scan_timeout, unsigned short *com_port, int *p_scanstop);
- // Get target S/W, H/W and Melody version
- META_RESULT __stdcall META_GetTargetVerInfo(const META_GET_VERSION_INFO_CNF cb, short *token, void *usrData);
- META_RESULT __stdcall META_GetTargetVerInfo_r(const int meta_handle, const META_GET_VERSION_INFO_CNF cb, short *token, void *usrData);
- // Shutdown target
- META_RESULT __stdcall META_ShutDownTarget(void);
- META_RESULT __stdcall META_ShutDownTarget_r(const int meta_handle);
- // ***** Expired Functions -- BEGIN ***** //
- // these functions are expired, we encourage you to use META_ConnectWithTarget and META_DisconnectWithTarget
- META_RESULT __stdcall META_COMM_Set_Baudrate(const META_COMM_BAUDRATE baudrate);
- META_RESULT __stdcall META_COMM_Set_Baudrate_r(const int meta_handle, const META_COMM_BAUDRATE baudrate);
- META_RESULT __stdcall META_COMM_Start(const int comm_port, const META_FLOWCTRL flowctrl);
- META_RESULT __stdcall META_COMM_Start_r(const int meta_handle, const int comm_port, const META_FLOWCTRL flowctrl);
- META_RESULT __stdcall META_COMM_Stop(void);
- META_RESULT __stdcall META_COMM_Stop_r(const int meta_handle);
- META_RESULT __stdcall META_WaitForTargetReady(unsigned int ms_waiting_time, unsigned int request_count);
- META_RESULT __stdcall META_WaitForTargetReady_r(const int meta_handle, unsigned int ms_waiting_time, unsigned int request_count);
- META_RESULT __stdcall META_GetTargetRequiredMetaVer(unsigned int *p_meta_ver_required_by_target);
- META_RESULT __stdcall META_GetTargetRequiredMetaVer_r(const int meta_handle, unsigned int *p_meta_ver_required_by_target);
- // ***** Expired Functions -- END ***** //
- //--------------------------------------------------------------------------//
- // 3G RF Testing //
- //--------------------------------------------------------------------------//
- //-----------------------------------------------------//
- // 3G RF Testing: data structure definition //
- //-----------------------------------------------------//
- typedef enum {
- URF_TEST_CMD_TXACCESS = 0
- ,URF_TEST_CMD_STOP
- ,URF_TEST_CMD_TX_DPCH
- ,URF_TEST_CMD_RX_DPCH
- ,URF_TEST_CMD_RSSI
- ,URF_TEST_CMD_RSCP
- ,URF_TEST_CMD_AFC
- ,URF_TEST_CMD_TX_PAAPC // for calling UL1D_RF_SetPaApcDac in FT task
- ,URF_TEST_CMD_GET_RFID
- ,URF_TEST_CMD_CONFIG_HWTPC
- ,URF_TEST_CMD_GET_PWR_DT_STEP
- ,URF_TEST_CMD_GET_PWR_DT_DAC
- ,URF_TEST_CMD_GET_PWR_DT_DEFAULT_THR
- ,URF_TEST_CMD_END
- }URfTestCmdType;
- typedef struct {
- unsigned short uarfcn; //kal_int16
- short psc; //kal_int16
- unsigned short signature; //kal_uint16
- unsigned char pa_mode; //unsigned char
- char init_power; //kal_int8
- unsigned char power_step; //kal_uint8
- unsigned char max_retrans; //kal_uint8
- }URfTestCmdTxAccess;
- typedef struct
- {
- //unsigned short dl_freq;
- unsigned short ul_freq;
- short psc; /* 0~511. */
- unsigned int sc_code; /* Scrambling code #. 0 ~ 16777215 */
- unsigned char power_ctrl_mode;
- unsigned char pa_mode;
- unsigned short idx;
- unsigned short afc_dac;
- unsigned char dpcch_pwr;
- unsigned char dpdch_pwr;
-
- /* Below for UL1D_RF_Meta_SetTxInfo. */
- bool no_loop_ctrl;
-
- /* Below for setPaApcDac. */
- unsigned char rf_band;
- unsigned char vm1;
- unsigned char vm2;
- unsigned short dc2dc_dac;
- unsigned short vbias_dac;
- bool pwr_det;
- unsigned short apc_dac;
- } URfTestCmdTxDPCh; //Anthony target side is :UL1TSTCmdTxDPCh and URfTestCmdTxDPCh
- typedef struct
- {
- unsigned short dl_freq;
- short psc; /* 0~511. */
- unsigned char ssc; /* 0~15. */
- short ovsf; /* 0~sf-1. */
- unsigned short afc_dac;
-
- /* Below for RF_SetBBRxParams. */
- bool hwAGC;
- unsigned char mode; /* 0: mode0, 1: mode1. */
- short gain; /* mode0. */
- unsigned char LNAmode; /* mode1. 0: LNA high, 1: LNA mid, 2: LNA low. */
- unsigned short pga; /* mode1. */
- } URfTestCmdRxDPCh;
- #define MAX_FREQ_LIST 36
- typedef struct
- {
- unsigned char num_freq;
- unsigned short dl_freq[ MAX_FREQ_LIST ];
- unsigned char temperature;
-
- /* Below for RF_SetBBRxParams. */
- bool hwAGC;
- unsigned char mode; /* 0: mode0, 1: mode1. */
- short gain; /* mode0. */
- unsigned char LNAmode; /* mode1. 0: LNA high, 1: LNA mid, 2: LNA low. */
- unsigned short pga; /* mode1. */
- } URfTestCmdRSSI;
- typedef struct
- {
- bool pscan_before_cell_search; /* True if UL1TST needs power scan before cell search/RSCP. */
- unsigned short dl_freq; /* Specific dl_freq to do cell search. Valid if pscan_before_cell_search=F. */
- unsigned char sample_num_per_cell;
- bool read_sfn; /* True if we need to do SFN measurement for the found cell. */
-
- /* Below for RF_SetBBRxParams. */
- bool hwAGC;
- unsigned char mode; /* 0: mode0, 1: mode1. */
- short gain; /* mode0. */
- unsigned char LNAmode; /* mode1. 0: LNA high, 1: LNA mid, 2: LNA low. */
- unsigned short pga; /* mode1. */
- } URfTestCmdRSCP;
- typedef struct
- {
- //kal_bool pscan_before_cell_search; /* True if UL1TST needs power scan before cell search/RSCP. */
- short dl_freq; /* Specific dl_freq to do cell search. Valid if pscan_before_cell_search=F. */
- //kal_uint8 sample_num_per_cell;
- //kal_bool read_sfn; /* True if we need to do SFN measurement for the found cell. */
-
- short afc_dac; //anthony 0514
-
- /* Below for RF_SetBBRxParams. */
- bool hwAGC;
- unsigned char mode; /* 0: mode0, 1: mode1. */
- short gain; /* mode0. */
- unsigned char LNAmode; /* mode1. 0: LNA high, 1: LNA mid, 2: LNA low. */
- unsigned short pga; /* mode1. */
- } URfTestCmdAFC;
- typedef struct
- {
- char m_cRfBand; // only 0 ~ 5
- unsigned short m_u2Idx;
- unsigned char m_ucPaMode;
- // unsigned short m_u2PaDac;
- unsigned char m_ucVm1;
- unsigned char m_ucVm2;
- unsigned short m_u2DC2DC_Dac;
- unsigned short m_u2Vbias_Dac;
- unsigned short m_u2ApcDac;
- }UL1D_RF_TX_PA_APC_REQ_T;
- typedef struct
- {
- // structure of META_HWTPC_FRAME_INFO in target
- unsigned char tpc_step;
- unsigned char itp;
- unsigned char rpp;
- unsigned char fmt_idx;
- unsigned char dl_frame_type;
- unsigned short slot_mask;
- char tpc_cmd[15];
- unsigned char beta_c;
- unsigned char beta_d;
- }UL1D_RF_HWTPC_FRAME_INFO;
- typedef struct
- {
- unsigned char pc_algo;
- unsigned char tpc_used_frame; // at most 8 so far
- short p_ini;
- UL1D_RF_HWTPC_FRAME_INFO frame_info[8];
-
- }UL1D_RF_HWTPC_CONFIG_REQ_T;
- typedef struct
- {
- unsigned char rf_band;
- }UL1D_RF_GET_PWR_THR_REQ_T;
- typedef union {
- URfTestCmdTxAccess txaccess;
- URfTestCmdTxDPCh txdpch; //Anthony
- URfTestCmdRxDPCh rxdpch;
- URfTestCmdRSSI rssi;
- URfTestCmdRSCP rscp;
- URfTestCmdAFC afc;
- UL1D_RF_TX_PA_APC_REQ_T m_rTxPaApc;
- UL1D_RF_HWTPC_CONFIG_REQ_T m_rHWTPC;
- UL1D_RF_GET_PWR_THR_REQ_T m_rGetPwrThr;
- }URfTestCmdParam;
- typedef struct
- {
- bool ok;
- unsigned char num_freq;
- short dl_freq[ MAX_FREQ_LIST ];
- int rssi[ MAX_FREQ_LIST ];
- } URfTestResultRSSI;
- typedef struct
- {
- unsigned short psc; /* Primary scrambling code */
- int tm; /* Cell frame boundary offset to LST */
- short off; /* Cell frame number offset to LST */
- bool sttd; /* True for STTD used. */
- unsigned char sample_num;
- unsigned char rscp_sum;
- short freq_error; // 20070514
- } UL1TST_cpich_result_T;
- #define MAX_NUM_MEAS_CELL 32
- typedef struct
- {
- bool ok;
- unsigned char num_cell;
- UL1TST_cpich_result_T cpich_result[ MAX_NUM_MEAS_CELL ];
- } URfTestResultRSCP;
- typedef struct
- {
- bool ok;
- unsigned short psc; /* Primary scrambling code */
- int tm; /* Cell frame boundary offset to LST */
- bool sttd; /* True for STTD used. */
- unsigned char rscp_sum;
- short freq_error; //anthony 0514
- }URfTestResultAFC;
- typedef struct
- {
- bool ok;
- unsigned int ber; /* Spec requirement=10^-3. We will count 10^5 frames(100 times spec requirement) for BER calculation. Only count for the only TRCh for DPDCh. */
- } URfTestResultRxDPCh;
- #define UL1D_RF_ID_SONY_CXA3359 0x00000001
- #define UL1D_RF_ID_MT6159B 0x00000002
- #define UL1D_RF_ID_SMARTI3G 0x00000003
- typedef struct
- {
- unsigned int m_u4Rfid;
-
- }URfTestResultRFID;
- typedef struct
- {
- unsigned char m_u1Result;
- }URfTestResultPwrDtStep;
- typedef struct
- {
- unsigned short m_u2Result;
- }URfTestResultPwrDtDac;
- typedef struct
- {
- unsigned char m_u1Result;
- }URfTestResultPwrDtDefaultThr;
- typedef union {
- bool ok; //kal_bool // for only request
- URfTestResultRSSI rssi;
- URfTestResultAFC afc;
- URfTestResultRSCP rscp;
- URfTestResultRxDPCh rx_dpch;
- URfTestResultRFID rfid;
- URfTestResultPwrDtStep pwr_dt_step;
- URfTestResultPwrDtDac pwr_dt_dac;
- URfTestResultPwrDtDefaultThr pwr_dt_default_thr;
- }URfTestResultParam;
- //-----------------------------------------------------//
- // 3G RF Testing: function definition //
- //-----------------------------------------------------//
- META_RESULT __stdcall META_3Grf_TxAccess(unsigned int ms_timeout, URfTestCmdTxAccess *req, URfTestResultParam *cnf);
- META_RESULT __stdcall META_3Grf_TxAccess_r(const int meta_handle, unsigned int ms_timeout, URfTestCmdTxAccess *req, URfTestResultParam *cnf);
- META_RESULT __stdcall META_3Grf_TestStop(unsigned int ms_timeout, URfTestResultParam *cnf);
- META_RESULT __stdcall META_3Grf_TestStop_r(const int meta_handle, unsigned int ms_timeout, URfTestResultParam *cnf);
- META_RESULT __stdcall META_3Grf_TxDpch(unsigned int ms_timeout, URfTestCmdTxDPCh *req, URfTestResultParam *cnf);
- META_RESULT __stdcall META_3Grf_TxDpch_r(const int meta_handle, unsigned int ms_timeout, URfTestCmdTxDPCh *req, URfTestResultParam *cnf);
- META_RESULT __stdcall META_3Grf_RxDpch(unsigned int ms_timeout, URfTestCmdRxDPCh *req, URfTestResultRxDPCh *cnf);
- META_RESULT __stdcall META_3Grf_RxDpch_r(const int meta_handle, unsigned int ms_timeout, URfTestCmdRxDPCh *req, URfTestResultRxDPCh *cnf);
- META_RESULT __stdcall META_3Grf_Rssi(unsigned int ms_timeout, URfTestCmdRSSI *req, URfTestResultRSSI *cnf);
- META_RESULT __stdcall META_3Grf_Rssi_r(const int meta_handle, unsigned int ms_timeout, URfTestCmdRSSI *req, URfTestResultRSSI *cnf);
- META_RESULT __stdcall META_3Grf_Rscp(unsigned int ms_timeout, URfTestCmdRSCP *req, URfTestResultRSCP *cnf);
- META_RESULT __stdcall META_3Grf_Rscp_r(const int meta_handle, unsigned int ms_timeout, URfTestCmdRSCP *req, URfTestResultRSCP *cnf);
-
- META_RESULT __stdcall META_3Grf_Set_Tx_PaApc(unsigned int ms_timeout, UL1D_RF_TX_PA_APC_REQ_T *req);
- META_RESULT __stdcall META_3Grf_Set_Tx_PaApc_r(const int meta_handle, unsigned int ms_timeout, UL1D_RF_TX_PA_APC_REQ_T *req);
- META_RESULT __stdcall META_3Grf_AFC(unsigned int ms_timeout, URfTestCmdAFC *req, URfTestResultAFC *cnf);
- META_RESULT __stdcall META_3Grf_AFC_r(const int meta_handle, unsigned int ms_timeout, URfTestCmdAFC *req, URfTestResultAFC *cnf);
- META_RESULT __stdcall META_3Grf_GetRFID(unsigned int ms_timeout, URfTestResultRFID *cnf);
- META_RESULT __stdcall META_3Grf_GetRFID_r(const int meta_handle, unsigned int ms_timeout, URfTestResultRFID *cnf);
- META_RESULT __stdcall META_3Grf_ConfigHWTPC(unsigned int ms_timeout, UL1D_RF_HWTPC_CONFIG_REQ_T *req);
- META_RESULT __stdcall META_3Grf_ConfigHWTPC_r(const int meta_handle, unsigned int ms_timeout, UL1D_RF_HWTPC_CONFIG_REQ_T *req);
- META_RESULT __stdcall META_3Grf_GetPwrDtStep(unsigned int ms_timeout, URfTestResultPwrDtStep *cnf);
- META_RESULT __stdcall META_3Grf_GetPwrDtStep_r(const int meta_handle, unsigned int ms_timeout, URfTestResultPwrDtStep *cnf);
- META_RESULT __stdcall META_3Grf_GetPwrDtDac(unsigned int ms_timeout, URfTestResultPwrDtDac *cnf);
- META_RESULT __stdcall META_3Grf_GetPwrDtDac_r(const int meta_handle, unsigned int ms_timeout, URfTestResultPwrDtDac *cnf);
- META_RESULT __stdcall META_3Grf_GetPwrDtDefaultThr(unsigned int ms_timeout, UL1D_RF_GET_PWR_THR_REQ_T *req, URfTestResultPwrDtDefaultThr *cnf);
- META_RESULT __stdcall META_3Grf_GetPwrDtDefaultThr_r(const int meta_handle, unsigned int ms_timeout, UL1D_RF_GET_PWR_THR_REQ_T *req, URfTestResultPwrDtDefaultThr *cnf);
- //--------------------------------------------------------------------------//
- // RF Testing //
- //--------------------------------------------------------------------------//
- //-----------------------------------------------------//
- // RF Testing: data structure definition //
- //-----------------------------------------------------//
- typedef short ARFCN;
- typedef short Gain;
- typedef char BSIC;
- typedef short Power;
- typedef unsigned char TimingAdvance;
- // RF ID
- #define RF_ID_UNKNOWN 0x00000000
- #define RF_ID_BRIGHT2 0x00000001
- #define RF_ID_BRIGHT4 0x00000002
- #define RF_ID_AERO 0x00000004
- #define RF_ID_AERO1PLUS 0x00000008
- #define RF_ID_POLARIS1 0x00000010
- #define RF_ID_POLARIS2 0x00000020
- #define RF_ID_SKY74045 0x00000040
- #define RF_ID_BRIGHT5P 0x00000080
- #define RF_ID_MT6116 0x00000100
- #define RF_ID_MT6119 0x00000200
- #define RF_ID_MT6119C 0x00000400
- #define RF_ID_MT6129A 0x00000800
- #define RF_ID_MT6129B 0x00001000
- #define RF_ID_MT6129C 0x00002000
- #define RF_ID_MT6129D 0x00004000
- #define RF_ID_MT6139B 0x00008000
- #define RF_ID_MT6139C 0x00010000
- #define RF_ID_MT6140A 0x00020000
- #define RF_ID_SKY74117 0x00040000
- #define RF_ID_SKY74400 0x00080000
- #define RF_ID_AERO2 0x00100000
- #define RF_ID_MT6140B 0x00200000
- #define RF_ID_ALICEG2S 0x00400000
- #define RF_ID_MT6139E 0x00800000
- #define RF_ID_SKY74137 0x01000000
- #define RF_ID_MT6140C 0x02000000
- #define RF_ID_GRF6201 0x04000000
- #define RF_ID_IRFS3001 0x08000000
- #define RF_ID_MT6140D 0x10000000
- #define RF_ID_AG2550 0x10000001
- #define RF_ID_AERO2E 0x10000002
- #define RF_ID_AD6548 0x10000005
- #define RF_ID_AD6546 0x10000006
- #define RF_ID_A60111A 0x10000007
- typedef enum
- {
- FrequencyBand400=0, // GSM 450/480 band
- FrequencyBand850, // GSM 850 band
- FrequencyBand900, // GSM 900 band
- FrequencyBand1800, // DCS 1800 band
- FrequencyBand1900, // PCS 1900 band
- FrequencyBandCount // count of supported bands
- } FrequencyBand;
- typedef struct
- {
- ARFCN arfcn; // Absolute radio frequency channel number
- char sampleNoPerFrame; // number of samples per frame
- Gain gain; // Gain that should be used in power management
- short frames; // number of frames
- } RfPm_Req;
- typedef struct {
- unsigned char valid; // if valid != zero, it means the extra info is meaningful.
- // otherwise, the extra info should be ignore.
- int iOffset;
- int qOffset;
- int validSamples;
- } RfPmExtraInfo_T;
- typedef struct
- {
- int power; // average power
- int deviation; // deviation of power measurement
- Gain usedGain; // Gain that is used
- unsigned char ok; // status
- RfPmExtraInfo_T extra_info; // extra info
- } RfPm_Cnf;
- typedef struct
- {
- ARFCN arfcn; // absolute radio frequency channel number
- short dacValue; // AFC DAC value
- Gain gain; // gain used for AFC testing
- short testNumber; // test number
- } RfAfc_Req;
- typedef struct
- {
- short fcb_ok_number; // successful number of FCB decoded
- int freqOffset; // average frequency error
- int deviation; // deviation of frequency error
- unsigned char ok; // status
- } RfAfc_Cnf;
- typedef enum {
- AB_TX_RANDOM_WITH_SYNC_SEQ
- ,NB_TX_ALL_ZEROS_WITHOUT_TSC
- ,NB_TX_ALL_ONES_WITHOUT_TSC
- ,NB_TX_ALTER_BITS_WITHOUT_TSC
- ,NB_TX_RANDOM_WITH_TSC
- ,NB_TX_PATTERN_WITHOUT_TSC
- ,NB_TX_FIXED_RANDOM_WITH_TSC
- ,NB_TX_FIXED_ALL_ZEROS_WITH_TSC
- ,NB_TX_FIXED_ALTER_BITS_WITH_TSC
- } APCTxPattern;
- typedef struct
- {
- ARFCN arfcn; // Absolute radio frequency channel number
- BSIC bsic; // bsic value used in transmission
- Power power; // Tx power in the unit of PCL
- short frames; // the number of frames NB should transmit
- short dacValue; // AFC DAC value
- APCTxPattern burstTypeNB;
- } RfNbtx_Req;
- typedef struct
- {
- ARFCN arfcn; // Absolute radio frequency channel number
- Gain gain; // Gain that should be used
- unsigned char OnOff; // On or off
- } RfCnRx_Req;
- typedef enum {
- CONT_TX_ALL_ZEROS
- ,CONT_TX_ALL_ONES
- ,CONT_TX_ALTERNATE_BITS
- ,CONT_TX_PSEUDO_RANDOM
- ,CONT_TX_PATTERN_WITHOUT_TSC
- } ContTxPattern;
- typedef struct
- {
- ARFCN arfcn; // Absolute radio frequency channel number
- ContTxPattern pattern;
- unsigned char OnOff; // On or off
- } RfCnTx_Req;
- typedef struct
- {
- char TxTrimI;
- char TxTrimQ;
- char TxOffsetI;
- char TxOffsetQ;
- } RfSetBBTXCfg_Req;
- typedef struct {
- char TxTrimI;
- char TxTrimQ;
- char TxOffsetI;
- char TxOffsetQ;
- char TxCalbias;
- char TxIQSwap;
- char TxCMV;
- char TxGain;
- char TxCalrcsel;
- } RfBBTXCfg2;
- typedef struct {
- char TxTrimI;
- char TxTrimQ;
- char TxOffsetI;
- char TxOffsetQ;
- char TxCalbias;
- char TxIQSwap;
- char TxCMV;
- char TxGain;
- char TxCalrcsel;
- char TxPhasesel;
- } RfBBTXCfg3;
- typedef struct {
- char TxTrimI;
- char TxTrimQ;
- char TxOffsetI;
- char TxOffsetQ;
- char TxCalbias;
- char TxIQSwap;
- char TxCMV;
- char TxGain;
- char TxCalrcsel;
- char TxPhasesel;
- char TxCoarseI;
- char TxCoarseQ;
- }RfBBTXCfg4; //RfTestCmdSetBBTXCfg4
- typedef struct
- {
- unsigned char bbtx_common_mode_voltage;
- unsigned char bbtx_gain;
- unsigned char bbtx_calrcsel;
- // unsigned char bbtx_coarseI; // need to set
- // unsigned char bbtx_coarseQ; // need to set
- unsigned char bbtx_trimI; // need to set
- unsigned char bbtx_trimQ; // need to set
- unsigned char bbtx_dccoarseI; // need to set
- unsigned char bbtx_dccoarseQ; // need to set
- unsigned char bbtx_offsetI; // need to set
- unsigned char bbtx_offsetQ; // need to set
- unsigned char bbtx_isCalibrated; // need to set
- int apc_bat_low_voltage;
- int apc_bat_high_voltage;
- int apc_bat_low_temperature;
- int apc_bat_high_temperature;
- unsigned char bbtx_common_mode_voltage_h;
- unsigned char bbtx_gain_h;
- unsigned char bbtx_calrcsel_h;
- unsigned char bbtx_trimI_h;
- unsigned char bbtx_trimQ_h;
- // unsigned char bbtx_coarseI_h;
- // unsigned char bbtx_coarseQ_h;
- unsigned char bbtx_dccoarseI_h;
- unsigned char bbtx_dccoarseQ_h;
- unsigned char bbtx_offsetI_h;
- unsigned char bbtx_offsetQ_h;
- unsigned char bbtx_phsel;
- unsigned char bbtx_phsel_h;
- // unsigned char bbrx_gsm850_gsm900_swap;
- // unsigned char bbrx_dcs1800_pcs1900_swap;
- }BBTXParameters_T;
- typedef enum {
- CodingSchemeCS1 = 1,
- CodingSchemeCS2,
- CodingSchemeCS3,
- CodingSchemeCS4,
- CodingSchemePRACh8,
- CodingSchemePRACh11,
- CodingSchemeMCS1,
- CodingSchemeMCS2,
- CodingSchemeMCS3,
- CodingSchemeMCS4,
- CodingSchemeMCS5,
- CodingSchemeMCS6,
- CodingSchemeMCS7,
- CodingSchemeMCS8,
- CodingSchemeMCS9
- } CodingScheme;
- typedef struct {
- ARFCN arfcn; // absolute radio frequency channel number
- BSIC bsic; // training sequence
- char timeSlotmask; // time slot mask, slot_1: 0x01, slot_2: 0x02, slot_3: 0x04, slot_4: 0x08
- Power powerLev[4]; // power level for each time slot
- CodingScheme cs[4]; // coding scheme for each time slot
- TimingAdvance ta; // time advance
- int frames; // the number of frames should transmit
- short dacValue; // AFC DAC value
- } RfMultiSlotTX_Req;
- typedef struct {
- FrequencyBand rf_band;
- int power_level;
- int apc_dac;
- } RfSetRampApcLevel_Req;
- typedef struct {
- short dacValue; // AFC DAC value
- } RfSetAfcDacValue_Req;
- typedef struct {
- int cap_id;
- } RfSetCrystalCfg_Req;
- typedef struct {
- ARFCN arfcn; // absolute radio frequency channel number
- BSIC bsic; // training sequence
- char timeSlotmask; // time slot mask, slot_1: 0x01, slot_2: 0x02, slot_3: 0x04, slot_4: 0x08
- Power powerLev[4]; // power level for each time slot
- CodingScheme cs[4]; // coding scheme for each time slot, MCS1~9 is only valid for EPSK function
- TimingAdvance ta; // time advance
- int frames; // the number of frames should transmit
- short dacValue; // AFC DAC value
- APCTxPattern pattern; // Tx pattern is only valid for EPSK function
- unsigned short pattern_data; // if NB_TX_PATTERN_WITHOUT_TSC==pattern, user can input any 16bits value as pattern.
- } Rf_MultiSlotTXEx_Req;
- typedef struct {
- unsigned int id; // please refer RF_ID_XXXX
- } RFMod_ID;
- typedef enum {
- MS_GSM = 0
- ,MS_GPRS
- ,MS_EGPRS_RX_ONLY
- ,MS_EGPRS_FULL_FUNCTION
- } MS_CAPABILITY_E;
- typedef struct {
- unsigned int GSM400; // Zero: not support, Non-zero: support
- unsigned int GSM850;
- unsigned int GSM900;
- unsigned int DCS1800;
- unsigned int PCS1900;
- } RFBandSupport_S;
- typedef struct {
- MS_CAPABILITY_E capability;
- RFBandSupport_S band_support;
- } RfMsCapability_S;
- typedef struct {
- unsigned int GSM:1;
- unsigned int GPRS:1;
- unsigned int EDGE_RX:1;
- unsigned int EDGE_8PSK_TX:1;
- unsigned int Calibration_8PM:1;
- } RfMsCapabilityBits;
- typedef struct {
- unsigned int GSM400:1;
- unsigned int GSM850:1;
- unsigned int GSM900:1;
- unsigned int DCS1800:1;
- unsigned int PCS1900:1;
- } RfMsBandSupportBits;
- typedef struct {
- RfMsCapabilityBits capability;
- RfMsBandSupportBits band_support;
- } RfMsCapabilityEx_S;
- typedef enum {
- AFC_SINWAVE_OFF = 0
- ,AFC_SINWAVE_ON
- } AFC_SINWAVE_DETECTION_E;
- typedef struct {
- ARFCN arfcn; // Absolute radio frequency channel number
- ContTxPattern pattern;
- unsigned short pattern_data;
- unsigned char OnOff; // On or off
- unsigned short modtype; // modulation type: 0->GMSK, 1->EPSK
- } RfCnTxEx_Req;
- typedef struct {
- ARFCN arfcn; // Absolute radio frequency channel number
- ContTxPattern pattern;
- unsigned short pattern_data;
- unsigned char OnOff; // On or off
- unsigned short modtype; // modulation type: 0->GMSK, 1->EPSK
- Power powerLev; // power level
- } RfCnTxEx2_Req;
- typedef struct {
- short dacValue; // AFC DAC value
- } RfGetAfcDacValueAtRTXOffsetCal;
- //-----------------------------------------------------//
- // TX Ramping Table //
- //-----------------------------------------------------//
- #define PROFILE_NUM 16
- #define ARFCN_SECTION_NUM 12
- #define ARFCN_SECTION_NUM_Ex 64
- typedef struct
- {
- unsigned char point[2][16]; // ramp up/down profile
- } sRAMPAREADATA;
- typedef struct
- {
- short max_arfcn; // sub-band boundary of this PCL weighting area
- unsigned short mid_level; // PCLboundary level to apply high/low weighting
- unsigned short hi_weight; // scale factor of PCLs higher than mid_level
- unsigned short low_weight; // scale factor of PCLs lower than mid_level
- } sARFCN_SECTION;
- typedef struct
- {
- int lowest_power; // The lower apc power of the indicated band
- unsigned short power[16]; // The mapping of power level to apc dac value
- sRAMPAREADATA ramp[ PROFILE_NUM ]; // ramp profile
- sARFCN_SECTION arfcn_weight[ ARFCN_SECTION_NUM ]; // profile of weighting power level by PCL and sub-band
- unsigned short battery_compensate[3][3]; // [volt][temp]
- short tx_afc_offset;
- } sRAMPDATA;
- typedef struct
- {
- int lowest_power; // The lower apc power of the indicated band
- unsigned short power[16]; // The mapping of power level to apc dac value
- sRAMPAREADATA ramp[ PROFILE_NUM ]; // ramp profile
- sARFCN_SECTION arfcn_weight[ ARFCN_SECTION_NUM_Ex ]; // profile of weighting power level by PCL and sub-band
- unsigned short battery_compensate[3][3]; // [volt][temp]
- short tx_afc_offset;
- } sRAMPDATA_Ex;
- typedef struct
- {
- int lowest_power; // The lower apc power of the indicated band
- unsigned short power[16]; // The mapping of power level to apc dac value
- sRAMPAREADATA ramp[ PROFILE_NUM ]; // ramp profile
- sARFCN_SECTION arfcn_weight[ ARFCN_SECTION_NUM ]; // profile of weighting power level by PCL and sub-band
- unsigned short battery_compensate[3][3]; // [volt][temp]
- short tx_afc_offset;
- unsigned char vbias[16];
- } sRAMPDATA_Ex2;
- typedef struct
- {
- sRAMPDATA rampData; // apc ramp profile of all bands
- }l1cal_rampTable_T;
- typedef struct
- {
- sRAMPDATA_Ex rampData; // apc ramp profile of all bands
- }l1cal_rampTable_T_Ex;
- typedef struct
- {
- sRAMPDATA_Ex2 rampData; // apc ramp profile of all bands
- }l1cal_rampTable_T_Ex2;
- //-----------------------------------------------------//
- // TX Inter Ramping Table //
- //-----------------------------------------------------//
- // interRampData
- typedef struct {
- unsigned char interRampData[16];
- } l1cal_interRampData_T;
- // EPSK interRampData
- typedef struct {
- unsigned char EPSK_interRampData[4][16];
- } l1cal_EPSK_interRampData_T;
- //-----------------------------------------------------//
- // 3F RF compose/decompose table //
- //-----------------------------------------------------//
- #define CAL_UARFCN_SECTION 15
- #define U_ARFCN_SECTION_NUM 15
- #define CAL_TEMP_SECTION 8
- #define CAL_PWR_DETECTOR_SECTION 32
- typedef struct
- {
- unsigned short max_uarfcn;
- char path_loss_H;//loss;
- char path_loss_M;//gain_diff_HM;
- char path_loss_L;//gain_diff_HL;
- } U_sAGCGAINOFFSET;
- typedef struct
- {
- //char temp;
- U_sAGCGAINOFFSET gain_of_uarfcn[CAL_UARFCN_SECTION];
- } U_sTEMPAGCOFFSET;
- typedef struct
- {
- unsigned short dc2dc_dac;
- unsigned short vbias_dac;
- unsigned char vm1;
- unsigned char vm2;
- } U_sPADATA;
- typedef struct
- {
- unsigned short max_uarfcn;
- short pwr_offset;
- short pwr_slope;
- } U_sARFCN_SECTION;
- typedef struct
- {
- //unsigned short pa_dac;
- U_sPADATA pa_data;
- unsigned short vga_dac[90];//vga_dac[81];
- U_sARFCN_SECTION vga_comp_by_subband[CAL_UARFCN_SECTION];
- short vga_comp_by_temperature[8][2]; //[0]:slope, [1]:offset
- //short vga_offset_by_temperature[8];
- } U_sTXPOWERDATA;
- typedef struct
- {
- unsigned short start;
- unsigned short end;
- } U_sHYSTERESISDATA;
- typedef struct
- {
- unsigned char pwr_dt_thr;
- unsigned char pwr_dt_section; // can not be larger than CAL_PWR_DETECTOR_SECTION
- unsigned short pwr_dt_dac[CAL_PWR_DETECTOR_SECTION];
-
- short pwr_dt_value[CAL_PWR_DETECTOR_SECTION]; //bit0~4 is used for fractions
- U_sARFCN_SECTION pwr_dt_comp_by_subband[CAL_UARFCN_SECTION]; // for compensation, no need calibration, after test, will auto-store
- short pwr_dt_comp_by_temperature[8][2]; //[0]:slope, [1]:offset
-
- } U_sPWTDTDATA;
- typedef struct
- {
- U_sTXPOWERDATA power_dac[3]; //0:PA high mode, 1:PA mid mode, 2:PA low mode (use 0&1 if only 2 mode)
- U_sHYSTERESISDATA tx_hysteresis[2];
- U_sPWTDTDATA pwr_dt_data;
- // U_sRAMPAREADATA u_ramp;
- // U_sARFCN_SECTION u_arfcn_weight[ U_ARFCN_SECTION_NUM ];
- } U_sRAMPDATA;
- //chliu provide
- typedef struct
- {
- unsigned char tempdacData[8];
- }ul1cal_tempdacData_T;
- typedef struct
- {
- U_sTEMPAGCOFFSET pathlossData[CAL_TEMP_SECTION];
- }ul1cal_pathlossData_T;
- typedef struct
- {
- U_sRAMPDATA txdacData;
- }ul1cal_txdacData_T;
- /* end of chliu */
- //-----------------------------------------------------//
- // RF Module Special Coef //
- //-----------------------------------------------------//
- //mt6140D
- typedef struct{
- short pcl_index;
- unsigned char pa_vbias1;
- }pa_vbias;
- typedef struct {
- pa_vbias GSM850_pa_vbias[8];
- pa_vbias GSM900_pa_vbias[8];
- pa_vbias DCS1800_pa_vbias[8];
- pa_vbias PCS1900_pa_vbias[8];
- //pa_vbias low_band_pa_vbias[8];
- //pa_vbias high_band_pa_vbias[8];
- }mt6140tx_pa_vbias;
- typedef struct{
- mt6140tx_pa_vbias data;
- }mt6140tx;
- // Skyworks
- typedef struct {
- unsigned int icorrection;
- unsigned int qcorrection;
- } RF_SKY74045_IP2_Coef;
- typedef struct {
- RF_SKY74045_IP2_Coef coef[5/*band*/];
- } RF_SKY74045_RX_Coef;
- typedef struct {
- RF_SKY74045_RX_Coef rx;
- } RF_SKY74045_Coef_T;
- typedef struct {
- unsigned int ipol;
- unsigned int qpol;
- } RF_SKY74117_IP2_Pol;
- typedef struct {
- RF_SKY74045_IP2_Coef coef[5/*band*/];
- RF_SKY74117_IP2_Pol pol[5/*band*/];
- } RF_SKY74117_RX_Coef;
- typedef struct {
- RF_SKY74117_RX_Coef rx;
- } RF_SKY74117_Coef_T;
- // MT6139B
- typedef struct {
- unsigned int acode;
- unsigned int amcode;
- } RF_MT6139B_IP2_Coef;
- typedef struct {
- RF_MT6139B_IP2_Coef coef[5/*band*/];
- unsigned int rxamcalmode;
- } RF_MT6139B_RX_Coef;
- typedef struct {
- RF_MT6139B_RX_Coef rx;
- } RF_MT6139B_Coef_T;
- // Bright5P
- typedef struct {
- unsigned int word6_4_0;
- unsigned int word6_5_0;
- unsigned int word6_6_0;
- unsigned int word6_7_0;
- unsigned int bvmode;
- unsigned int c3mode;
- unsigned int wordC3;
- } RF_BRIGHT5P_TX_Coef;
- typedef struct {
- RF_BRIGHT5P_TX_Coef tx;
- } RF_BRIGHT5P_Coef_T;
- typedef struct
- {
- unsigned char REFDET_SLOPE_SKEW;
- unsigned char AM_FB_DAC;
-
- }ad6546tx;
- //-----------------------------------------------------//
- // RF Testing: callback function definition //
- //-----------------------------------------------------//
- typedef void (__stdcall *META_RF_PM_CNF)(const RfPm_Cnf *cnf, const short token, void *usrData);
- typedef void (__stdcall *META_RF_AFC_CNF)(const RfAfc_Cnf *cnf, const short token, void *usrData);
- typedef void (__stdcall *META_RF_NB_TX_CNF)(const unsigned char cnf, const short token, void *usrData);
- typedef void (__stdcall *META_RF_CONT_RX_CNF)(const unsigned char cnf, const short token, void *usrData);
- typedef void (__stdcall *META_RF_CONT_TX_CNF)(const unsigned char cnf, const short token, void *usrData);
- typedef void (__stdcall *META_RF_SETBBTX_CFG_CNF)(const unsigned char cnf, const short token, void *usrData);
- typedef void (__stdcall *META_RF_SELBAND_CNF)(const unsigned char cnf, const short token, void *usrData);
- typedef void (__stdcall *META_RF_STOP_CNF)(const unsigned char cnf, const short token, void *usrData);
- typedef void (__stdcall *META_RF_MULTISLOT_TX_CNF)(const unsigned char cnf, const short token, void *usrData);
- typedef void (__stdcall *META_RF_SET_RAMPAPCLEVEL_CNF)(const unsigned char cnf, const short token, void *usrData);
- typedef void (__stdcall *META_RF_SET_AFCDACVALUE_CNF)(const unsigned char cnf, const short token, void *usrData);
- //-----------------------------------------------------//
- // RF Testing: exported function definition //
- //-----------------------------------------------------//
- META_RESULT __stdcall META_Rf_PM(const RfPm_Req *req, const META_RF_PM_CNF cb, short *token, void *usrData);
- META_RESULT __stdcall META_Rf_PM_r(const int meta_handle, const RfPm_Req *req, const META_RF_PM_CNF cb, short *token, void *usrData);
- META_RESULT __stdcall META_Rf_AFC(const RfAfc_Req *req, const META_RF_AFC_CNF cb, short *token, void *usrData);
- META_RESULT __stdcall META_Rf_AFC_r(const int meta_handle, const RfAfc_Req *req, const META_RF_AFC_CNF cb, short *token, void *usrData);
- META_RESULT __stdcall META_Rf_NB_TX(const RfNbtx_Req *req, const META_RF_NB_TX_CNF cb, short *token, void *usrData);
- META_RESULT __stdcall META_Rf_NB_TX_r(const int meta_handle, const RfNbtx_Req *req, const META_RF_NB_TX_CNF cb, short *token, void *usrData);
- META_RESULT __stdcall META_Rf_CONTINUE_RX(const RfCnRx_Req *req, const META_RF_CONT_RX_CNF cb, short *token, void *usrData);
- META_RESULT __stdcall META_Rf_CONTINUE_RX_r(const int meta_handle, const RfCnRx_Req *req, const META_RF_CONT_RX_CNF cb, short *token, void *usrData);
- META_RESULT __stdcall META_Rf_CONTINUE_TX(const RfCnTx_Req *req, const META_RF_CONT_TX_CNF cb, short *token, void *usrData);
- META_RESULT __stdcall META_Rf_CONTINUE_TX_r(const int meta_handle, const RfCnTx_Req *req, const META_RF_CONT_TX_CNF cb, short *token, void *usrData);
- META_RESULT __stdcall META_Rf_SetBBTXCfg(const RfSetBBTXCfg_Req *req, const META_RF_SETBBTX_CFG_CNF cb, short *token, void *usrData);
- META_RESULT __stdcall META_Rf_SetBBTXCfg_r(const int meta_handle, const RfSetBBTXCfg_Req *req, const META_RF_SETBBTX_CFG_CNF cb, short *token, void *usrData);
- META_RESULT __stdcall META_Rf_SelectFrequencyBand1900(const unsigned char selectPCS1900, const META_RF_SELBAND_CNF cb, short *token, void *usrData);
- META_RESULT __stdcall META_Rf_SelectFrequencyBand1900_r(const int meta_handle, const unsigned char selectPCS1900, const META_RF_SELBAND_CNF cb, short *token, void *usrData);
- META_RESULT __stdcall META_Rf_Stop(const META_RF_STOP_CNF cb, short *token, void *usrData);
- META_RESULT __stdcall META_Rf_Stop_r(const int meta_handle, const META_RF_STOP_CNF cb, short *token, void *usrData);
- META_RESULT __stdcall META_Rf_MultiSlot_TX(const RfMultiSlotTX_Req *req, const META_RF_MULTISLOT_TX_CNF cb, short *token, void *usrData);
- META_RESULT __stdcall META_Rf_MultiSlot_TX_r(const int meta_handle, const RfMultiSlotTX_Req *req, const META_RF_MULTISLOT_TX_CNF cb, short *token, void *usrData);
- META_RESULT __stdcall META_Rf_SetAfcDacValue(const RfSetAfcDacValue_Req *req, const META_RF_SET_AFCDACVALUE_CNF cb, short *token, void *usrData);
- META_RESULT __stdcall META_Rf_SetAfcDacValue_r(const int meta_handle, const RfSetAfcDacValue_Req *req, const META_RF_SET_AFCDACVALUE_CNF cb, short *token, void *usrData);
- META_RESULT __stdcall META_Rf_SetBBTxCfg2(unsigned int ms_timeout, const RfBBTXCfg2 *tx_cfg_req, RfBBTXCfg2 *tx_cfg_cnf);
- META_RESULT __stdcall META_Rf_SetBBTxCfg2_r(const int meta_handle, unsigned int ms_timeout, const RfBBTXCfg2 *tx_cfg_req, RfBBTXCfg2 *tx_cfg_cnf);
- META_RESULT __stdcall META_Rf_GetBBTxCfg2(unsigned int ms_timeout, RfBBTXCfg2 *tx_cfg_cnf);
- META_RESULT __stdcall META_Rf_GetBBTxCfg2_r(const int meta_handle, unsigned int ms_timeout, RfBBTXCfg2 *tx_cfg_cnf);
- META_RESULT __stdcall META_Rf_SetCrystalCapId(unsigned int ms_timeout, const RfSetCrystalCfg_Req *req);
- META_RESULT __stdcall META_Rf_SetCrystalCapId_r(const int meta_handle, unsigned int ms_timeout, const RfSetCrystalCfg_Req *req);
- META_RESULT __stdcall META_Rf_BBTXAutoCal(unsigned int ms_timeout);
- META_RESULT __stdcall META_Rf_BBTXAutoCal_r(const int meta_handle, unsigned int ms_timeout);
- META_RESULT __stdcall META_Rf_QueryMSCapability(unsigned int ms_timeout, RfMsCapability_S *p_type);
- META_RESULT __stdcall META_Rf_QueryMSCapability_r(const int meta_handle, unsigned int ms_timeout, RfMsCapability_S *p_type);
- META_RESULT __stdcall META_Rf_QueryMSCapabilityEx(unsigned int ms_timeout, RfMsCapabilityEx_S *p_ms_cap);
- META_RESULT __stdcall META_Rf_QueryMSCapabilityEx_r(const int meta_handle, unsigned int ms_timeout, RfMsCapabilityEx_S *p_ms_cap);
- META_RESULT __stdcall META_Rf_SetAfcSinWaveDetection(unsigned int ms_timeout, AFC_SINWAVE_DETECTION_E bIsAfcSinWaveOn);
- META_RESULT __stdcall META_Rf_SetAfcSinWaveDetection_r(const int meta_handle, unsigned int ms_timeout, AFC_SINWAVE_DETECTION_E bIsAfcSinWaveOn);
- META_RESULT __stdcall META_Rf_QueryIfTwoApcDCOffsetSupport(unsigned int ms_timeout);
- META_RESULT __stdcall META_Rf_QueryIfTwoApcDCOffsetSupport_r(const int meta_handle, unsigned int ms_timeout);
- META_RESULT __stdcall META_Rf_MultiSlot_TX_Ex(unsigned int ms_timeout, const Rf_MultiSlotTXEx_Req *req);
- META_RESULT __stdcall META_Rf_MultiSlot_TX_Ex_r(const int meta_handle, unsigned int ms_timeout, const Rf_MultiSlotTXEx_Req *req);
- META_RESULT __stdcall META_Rf_GetRFID(unsigned int ms_timeout, RFMod_ID *cnf);
- META_RESULT __stdcall META_Rf_GetRFID_r(const int meta_handle, unsigned int ms_timeout, RFMod_ID *cnf);
- META_RESULT __stdcall META_Rf_CONTINUE_TX_Ex(unsigned int ms_timeout, const RfCnTxEx_Req *req);
- META_RESULT __stdcall META_Rf_CONTINUE_TX_Ex_r(const int meta_handle, unsigned int ms_timeout, const RfCnTxEx_Req *req);
- META_RESULT __stdcall META_Rf_SetBBTxCfg3(unsigned int ms_timeout, const RfBBTXCfg3 *tx_cfg_req, RfBBTXCfg3 *tx_cfg_cnf);
- META_RESULT __stdcall META_Rf_SetBBTxCfg3_r(const int meta_handle, unsigned int ms_timeout, const RfBBTXCfg3 *tx_cfg_req, RfBBTXCfg3 *tx_cfg_cnf);
- META_RESULT __stdcall META_Rf_GetBBTxCfg3(unsigned int ms_timeout, RfBBTXCfg3 *tx_cfg_cnf);
- META_RESULT __stdcall META_Rf_GetBBTxCfg3_r(const int meta_handle, unsigned int ms_timeout, RfBBTXCfg3 *tx_cfg_cnf);
- META_RESULT __stdcall META_Rf_CONTINUE_TX_Ex2(unsigned int ms_timeout, const RfCnTxEx2_Req *req);
- META_RESULT __stdcall META_Rf_CONTINUE_TX_Ex2_r(const int meta_handle, unsigned int ms_timeout, const RfCnTxEx2_Req *req);
- META_RESULT __stdcall META_Rf_GetAfcDacValueAtRTXOffsetCal(unsigned int ms_timeout, RfGetAfcDacValueAtRTXOffsetCal *cnf);
- META_RESULT __stdcall META_Rf_GetAfcDacValueAtRTXOffsetCal_r(const int meta_handle, unsigned int ms_timeout, RfGetAfcDacValueAtRTXOffsetCal *cnf);
- META_RESULT __stdcall META_Rf_SetBBTxCfg4(unsigned int ms_timeout, const RfBBTXCfg4 *tx_cfg_req, RfBBTXCfg4 *tx_cfg_cnf);
- META_RESULT __stdcall META_Rf_SetBBTxCfg4_r(const int meta_handle, unsigned int ms_timeout, const RfBBTXCfg4 *tx_cfg_req, RfBBTXCfg4 *tx_cfg_cnf);
- META_RESULT __stdcall META_Rf_GetBBTxCfg4(unsigned int ms_timeout, RfBBTXCfg4 *tx_cfg_cnf);
- META_RESULT __stdcall META_Rf_GetBBTxCfg4_r(const int meta_handle, unsigned int ms_timeout, RfBBTXCfg4 *tx_cfg_cnf);
- META_RESULT __stdcall META_Rf_SetBBTxCfg5(unsigned int ms_timeout, const RfBBTXCfg4 *tx_cfg_req, RfBBTXCfg4 *tx_cfg_cnf);
- META_RESULT __stdcall META_Rf_SetBBTxCfg5_r(const int meta_handle, unsigned int ms_timeout, const RfBBTXCfg4 *tx_cfg_req, RfBBTXCfg4 *tx_cfg_cnf);
- META_RESULT __stdcall META_Rf_GetBBTxCfg5(unsigned int ms_timeout, RfBBTXCfg4 *tx_cfg_cnf);
- META_RESULT __stdcall META_Rf_GetBBTxCfg5_r(const int meta_handle, unsigned int ms_timeout, RfBBTXCfg4 *tx_cfg_cnf);
- //-----------------------------------------------------//
- // RunTime Setting Functions Without Update NVRAM //
- //-----------------------------------------------------//
- META_RESULT __stdcall META_Rf_SetRampTable(unsigned int ms_timeout, FrequencyBand band, const l1cal_rampTable_T *ramp);
- META_RESULT __stdcall META_Rf_SetRampTable_r(const int meta_handle, unsigned int ms_timeout, FrequencyBand band, const l1cal_rampTable_T *ramp);
- META_RESULT __stdcall META_Rf_SetRampApcLevel(const RfSetRampApcLevel_Req *req, const META_RF_SET_RAMPAPCLEVEL_CNF cb, short *token, void *usrData);
- META_RESULT __stdcall META_Rf_SetRampApcLevel_r(const int meta_handle, const RfSetRampApcLevel_Req *req, const META_RF_SET_RAMPAPCLEVEL_CNF cb, short *token, void *usrData);
- META_RESULT __stdcall META_Rf_EPSK_SetRampTable(unsigned int ms_timeout, FrequencyBand band, const l1cal_rampTable_T *ramp);
- META_RESULT __stdcall META_Rf_EPSK_SetRampTable_r(const int meta_handle, unsigned int ms_timeout, FrequencyBand band, const l1cal_rampTable_T *ramp);
- META_RESULT __stdcall META_Rf_EPSK_SetRampApcLevel(unsigned int ms_timeout, const RfSetRampApcLevel_Req *req);
- META_RESULT __stdcall META_Rf_EPSK_SetRampApcLevel_r(const int meta_handle, unsigned int ms_timeout, const RfSetRampApcLevel_Req *req);
- META_RESULT __stdcall META_Rf_SetRFImmediateBSI(unsigned int ms_timeout, const unsigned int bsi_data);
- META_RESULT __stdcall META_Rf_SetRFImmediateBSI_r(const int meta_handle, unsigned int ms_timeout, const unsigned int bsi_data);
- META_RESULT __stdcall META_Rf_GetRFImmediateBSI(unsigned int ms_timeout, unsigned int bsi_addr, unsigned int *p_bsi_data);
- META_RESULT __stdcall META_Rf_GetRFImmediateBSI_r(const int meta_handle, unsigned int ms_timeout, unsigned int bsi_addr, unsigned int *p_bsi_data);
- META_RESULT __stdcall META_Rf_SetRampTable_Ex(unsigned int ms_timeout, FrequencyBand band, const l1cal_rampTable_T_Ex *ramp);
- META_RESULT __stdcall META_Rf_SetRampTable_Ex_r(const int meta_handle, unsigned int ms_timeout, FrequencyBand band, const l1cal_rampTable_T_Ex *ramp);
- META_RESULT __stdcall META_Rf_SetRampTable_Ex2(unsigned int ms_timeout, FrequencyBand band, const l1cal_rampTable_T_Ex2 *ramp);
- META_RESULT __stdcall META_Rf_SetRampTable_Ex2_r(const int meta_handle, unsigned int ms_timeout, FrequencyBand band, const l1cal_rampTable_T_Ex2 *ramp);
- // Skyworks
- META_RESULT __stdcall META_Rf_SKY74045_SetSpecialCoef(unsigned int ms_timeout, const RF_SKY74045_Coef_T *rf_mod_coef);
- META_RESULT __stdcall META_Rf_SKY74045_SetSpecialCoef_r(const int meta_handle, unsigned int ms_timeout, const RF_SKY74045_Coef_T *rf_mod_coef);
- META_RESULT __stdcall META_Rf_SKY74117_SetSpecialCoef(unsigned int ms_timeout, const RF_SKY74117_Coef_T *rf_mod_coef);
- META_RESULT __stdcall META_Rf_SKY74117_SetSpecialCoef_r(const int meta_handle, unsigned int ms_timeout, const RF_SKY74117_Coef_T *rf_mod_coef);
- // MT6139B
- META_RESULT __stdcall META_Rf_MT6139B_SetSpecialCoef(unsigned int ms_timeout, const RF_MT6139B_Coef_T *rf_mod_coef);
- META_RESULT __stdcall META_Rf_MT6139B_SetSpecialCoef_r(const int meta_handle, unsigned int ms_timeout, const RF_MT6139B_Coef_T *rf_mod_coef);
- // Renesas Bright5P
- META_RESULT __stdcall META_Rf_BRIGHT5P_SetSpecialCoef(unsigned int ms_timeout, const RF_BRIGHT5P_Coef_T *rf_mod_coef);
- META_RESULT __stdcall META_Rf_BRIGHT5P_SetSpecialCoef_r(const int meta_handle, unsigned int ms_timeout, const RF_BRIGHT5P_Coef_T *rf_mod_coef);
- META_RESULT __stdcall META_Rf_32kCalibration(unsigned int ms_timeout, int *p_result);
- META_RESULT __stdcall META_Rf_32kCalibration_r(const int meta_handle, unsigned int ms_timeout, int *p_result);
- //--------------------------------------------------------------------------//
- // NVRAM //