form_BaseBand.h
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:14k
- /*****************************************************************************
- * 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:
- * ---------
- * form_Baseband.h
- *
- * Project:
- * --------
- * Maui META APP
- *
- * Description:
- * ------------
- * Baseband form 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 _FORM_BASEBAND_H_
- #define _FORM_BASEBAND_H_
- //---------------------------------------------------------------------------
- #include <Classes.hpp>
- #include <Controls.hpp>
- #include <StdCtrls.hpp>
- #include <Forms.hpp>
- #include <Buttons.hpp>
- #include <ComCtrls.hpp>
- #include <Dialogs.hpp>
- #include <ExtCtrls.hpp>
- #ifndef _BB_ADC_H_
- #include "bb_adc.h"
- #endif
- #ifndef _BB_REG_H_
- #include "bb_reg.h"
- #endif
- #ifndef _BB_PMIC_REG_H_
- #include "bb_pmic_reg.h"
- #endif
- #ifndef _BB_CUST_HW_H_
- #include "bb_cust_hw.h"
- #endif
- #ifndef _BB_LED_H_
- #include "bb_led.h"
- #endif
- #ifndef _BB_VIBRATOR_H_
- #include "bb_vibrator.h"
- #endif
- #ifndef _BB_RTC_H_
- #include "bb_rtc.h"
- #endif
- //---------------------------------------------------------------------------
- // BG
- #define BATTERY_LEVEL_SHUT_DOWN_IDX 0
- #define BATTERY_LEVEL_NO_MO_CALL_IDX 1
- #define BATTERY_LEVEL_LOW_BATTERY_WARNING_IDX 2
- #define BATTERY_LEVEL_LEVEL1_IDX 3
- #define BATTERY_LEVEL_LEVEL2_IDX 4
- #define BATTERY_LEVEL_LEVEL3_IDX 5
- //---------------------------------------------------------------------------
- typedef enum
- {
- BB_PAGEIDX_ADC = 0,
- BB_PAGEIDX_BB_REG,
- BB_PAGEIDX_PMIC_REG,
- BB_PAGEIDX_BATTERY,
- BB_PAGEIDX_LED,
- BB_PAGEIDX_VBR,
- BB_PAGEIDX_RTC
- }E_BB_PAGEIDX_T;
- //---------------------------------------------------------------------------
- class TfrmBaseBand : public TForm
- {
- __published: // IDE-managed Components
- TBevel *Bevel1;
- TBitBtn *btnMeasureAdcStart1;
- TBitBtn *btnMeasureAdcStart2;
- TButton *btnADC0;
- TButton *btnADC1;
- TButton *btnADC2;
- TButton *btnADC3;
- TButton *btnADC4;
- TButton *btnAdcDownloadToFlash;
- TButton *btnAdcLoadFromFile;
- TButton *btnAdcSaveToFile;
- TButton *btnAdcUploadFromFlash;
- TButton *btnApply;
- TButton *btnBBRegRead;
- TButton *btnBBRegValue;
- TButton *btnBBRegWrite;
- TEdit *edtBBAddress;
- TEdit *edtInput1;
- TEdit *edtInput2;
- TEdit *edtOffset0;
- TEdit *edtOffset1;
- TEdit *edtOffset2;
- TEdit *edtOffset3;
- TEdit *edtOffset4;
- TEdit *edtSlope0;
- TEdit *edtSlope1;
- TEdit *edtSlope2;
- TEdit *edtSlope3;
- TEdit *edtSlope4;
- TEdit *edtBBValue;
- TLabel *lblLabel01;
- TLabel *lblLabel02;
- TLabel *lblLabel03;
- TLabel *lblLabel04;
- TLabel *lblLabel05;
- TLabel *lblLabel06;
- TLabel *lblLabel07;
- TLabel *lblLabel08;
- TLabel *lblLabel09;
- TLabel *lblLabel10;
- TLabel *lblLabel12;
- TLabel *lblBBRegAddr0X;
- TLabel *lblBBRegValue0X;
- TOpenDialog *OpenDialog;
- TPageControl *pctlToolSel;
- TPanel *Panel1;
- TPanel *pnlProfileTitle;
- TSaveDialog *SaveDialog;
- TStaticText *lblHint;
- TStaticText *txtOutput1;
- TStaticText *txtOutput2;
- TStaticText *txtResultOffset;
- TStaticText *txtResultSlope;
- TTabSheet *tsADC;
- TTabSheet *tsBBReg;
- TTimer *HintTimer;
- TLabel *Label1;
- TEdit *edtMeasureCount;
- TButton *btnADC5;
- TEdit *edtSlope5;
- TEdit *edtOffset5;
- TButton *btnADC6;
- TEdit *edtSlope6;
- TEdit *edtOffset6;
- TButton *btnADCChangeDB;
- TStatusBar *sbAdc;
- TStatusBar *sbReg;
- TTabSheet *tsBL;
- TStatusBar *sbBG;
- TLabel *Label2;
- TGroupBox *GroupBox1;
- TLabel *Label3;
- TEdit *edtBGShutdown;
- TLabel *Label4;
- TEdit *edtBGNoMoCall;
- TEdit *edtBGLowBatteryWarning;
- TLabel *Label5;
- TLabel *Label6;
- TEdit *edtBGLevel1;
- TLabel *Label7;
- TEdit *edtBGLevel2;
- TLabel *Label8;
- TEdit *edtBGLevel3;
- TButton *btnBGUploadFromFlash;
- TButton *btnBGDownloadToFlash;
- TButton *btnBGChangeDB;
- TButton *btnBGLoadFromFile;
- TButton *btnBGSaveToFile;
- TLabel *Label9;
- TLabel *Label10;
- TLabel *Label11;
- TLabel *Label12;
- TLabel *Label13;
- TLabel *Label14;
- TLabel *Label15;
- TComboBox *cbADCBatteryChannel;
- TLabel *Label16;
- TComboBox *cbADCChargerChannel;
- TTabSheet *tsPMICReg;
- TLabel *lblPMICRegAddr;
- TEdit *edtPMICAddress;
- TLabel *lblPMICRegAddr0X;
- TButton *btnPMICRegValue;
- TEdit *edtPMICValue;
- TLabel *lblPMICRegValue0X;
- TButton *btnPMICRegRead;
- TButton *btnPMICRegWrite;
- TStatusBar *m_sbPMIC;
- TButton *btnPMICReg;
- TTabSheet *tsLED;
- TEdit *m_edtKeypadLED;
- TLabel *Label17;
- TButton *m_btnKeypadLEDSet;
- TTabSheet *tsVBR;
- TButton *btnVBROn;
- TButton *btnVBROff;
- TTabSheet *tsRTC;
- TLabel *Label18;
- TEdit *edtRTCYear;
- TLabel *Label19;
- TEdit *edtRTCWDay;
- TEdit *edtRTCMonth;
- TLabel *Label20;
- TLabel *Label21;
- TEdit *edtRTCDay;
- TLabel *Label22;
- TEdit *edtRTCWHour;
- TEdit *edtRTCMinute;
- TEdit *edtRTCSec;
- TLabel *Label23;
- TLabel *Label24;
- TButton *btnRTCQuery;
- TStatusBar *m_sbLED;
- TStatusBar *m_sbVBR;
- TStatusBar *m_sbRTC;
- TEdit *m_edtMainLCD;
- TLabel *Label25;
- TButton *m_btnMainLCDSet;
- void __fastcall btnAdcLoadFromFileClick(TObject *Sender);
- void __fastcall btnAdcSaveToFileClick(TObject *Sender);
- void __fastcall btnAdcDownloadToFlashClick(TObject *Sender);
- void __fastcall btnAdcUploadFromFlashClick(TObject *Sender);
- void __fastcall edtSlopeCheck(TObject *Sender);
- void __fastcall edtOffsetCheck(TObject *Sender);
- void __fastcall edtInputCheck(TObject *Sender);
- void __fastcall HintTimerTimer(TObject *Sender);
- void __fastcall btnAdcClick(TObject *Sender);
- void __fastcall btnMeasureAdcStart1Click(TObject *Sender);
- void __fastcall btnMeasureAdcStart2Click(TObject *Sender);
- void __fastcall btnApplyClick(TObject *Sender);
- void __fastcall edtRegAddrCheck(TObject *Sender);
- void __fastcall edtRegValueCheck(TObject *Sender);
- void __fastcall pctlToolSelChange(TObject *Sender);
- void __fastcall btnBBRegReadClick(TObject *Sender);
- void __fastcall btnBBRegWriteClick(TObject *Sender);
- void __fastcall btnBBRegValueClick(TObject *Sender);
- void __fastcall FormHide(TObject *Sender);
- void __fastcall edtMeasureCountCheck(TObject *Sender);
- void __fastcall btnADCChangeDBClick(TObject *Sender);
- void __fastcall btnBGUploadFromFlashClick(TObject *Sender);
- void __fastcall btnBGDownloadToFlashClick(TObject *Sender);
- void __fastcall btnBGChangeDBClick(TObject *Sender);
- void __fastcall btnBGLoadFromFileClick(TObject *Sender);
- void __fastcall btnBGSaveToFileClick(TObject *Sender);
- void __fastcall edtBatteryLevelVoltageCheck(TObject *Sender);
- void __fastcall FormCreate(TObject *Sender);
- void __fastcall btnPMICRegValueClick(TObject *Sender);
- void __fastcall btnPMICRegReadClick(TObject *Sender);
- void __fastcall btnPMICRegWriteClick(TObject *Sender);
- void __fastcall FormActivate(TObject *Sender);
- void __fastcall edtPMICAddressCheck(TObject *Sender);
- void __fastcall edtPMICValueCheck(TObject *Sender);
- void __fastcall btnPMICRegClick(TObject *Sender);
- void __fastcall m_btnKeypadLEDSetClick(TObject *Sender);
- void __fastcall btnVBROnClick(TObject *Sender);
- void __fastcall edtLEDLightLevelCheck(TObject *Sender);
- void __fastcall btnVBROffClick(TObject *Sender);
- void __fastcall edtRTCYearCheck(TObject *Sender);
- void __fastcall edtRTCMonthCheck(TObject *Sender);
- void __fastcall edtRTCDayCheck(TObject *Sender);
- void __fastcall edtRTCWDayCheck(TObject *Sender);
- void __fastcall edtRTCHourCheck(TObject *Sender);
- void __fastcall edtRTCMinuteCheck(TObject *Sender);
- void __fastcall edtRTCSecCheck(TObject *Sender);
- void __fastcall btnRTCQueryClick(TObject *Sender);
- void __fastcall m_edtMainLCDCheck(TObject *Sender);
- void __fastcall m_edtSubLCDCheck(TObject *Sender);
- void __fastcall m_btnMainLCDSetClick(TObject *Sender);
- void __fastcall m_btnSubLCDSetClick(TObject *Sender);
- private: // User declarations
- bool m_bInit;
- int m_iFinalBBChip;
- CBBADC m_BB_ADC_Obj;
- CBBREG m_BB_REG_Obj;
- CBBPMICREG m_cBB_PMIC_REG_Obj;
- CBBCUSTHW m_BB_CUSTHW_Obj;
- CBBLED m_cBB_LED_Obj;
- CBBVBR m_cBB_VBR_Obj;
- CBBRTC m_cBB_RTC_Obj;
- // ADC
- unsigned short m_usMeasureCount;
- // BG
- bool m_bDownloadTrigger;
- unsigned int m_uiBatteryLevelVoltage[VISIBLE_BATTERY_LEVEL_NUM];
- S_CUSTOM_HW_LEVEL m_custom_hw_level;
- TEdit *m_edtSlope[TOTAL_6218_ADC_NUM];
- TEdit *m_edtOffset[TOTAL_6218_ADC_NUM];
- TButton *m_btnADC[TOTAL_6218_ADC_NUM];
- int m_iCurAdcChannel;
- // BB register
- unsigned int m_uiBBRegAddr;
- unsigned short m_usBBRegValue;
- // PMIC register
- PMIC_ID m_sPmicId;
- unsigned int m_uiPMICRegAddr;
- unsigned short m_usPMICRegValue;
- // LED
- FtLEDLevel m_sLEDLevel;
- unsigned char m_cMainLCDLevel;
- unsigned char m_cSubLCDLevel;
- // RTC
- T_Rtc m_sRTC;
- public: // User declarations
- // common
- __fastcall TfrmBaseBand(TComponent* Owner);
- void CurrentPageReset(void);
- void CurrentPageLock(void);
- void ShowHintLabel(TControl *sender, char* hint);
- void ReDrawFields(E_BB_PAGEIDX_T pageidx);
- bool CheckFields(void );
- void Force_BB_Stop(void);
- void Init(void);
- // ADC
- void Display_AdcBatteryChannel( int bb_chip );
- void Display_AdcChargerChannel( int bb_chip );
- void MeasureAdc1_Done( void );
- void MeasureAdc2_Done( void );
- void UploadFromFlashDone( void );
- void DownloadToFlashDone( void );
- // BB register
- void ReadRegister_Done( void );
- void WriteRegister_Done( void );
- // PMIC register
- void PMIC_ReadRegister_Done( void );
- void PMIC_WriteRegister_Done( void );
- // BG
- void ReDrawBGFields( void );
- void UploadBGFromFlashDone( void );
- void DownloadBGToFlashDone( void );
- // LED
- void CNF_LED_SetLightLevel(void);
- void CNF_LED_MainLCDLightLevel(void);
- void CNF_LED_SubLCDLightLevel(void);
- // vibrator
- void CNF_VBR_TurnOnVibrator(void);
- void CNF_VBR_TurnOffVibrator(void);
- // RTC
- void CNF_RTC_Query(void);
- // share information
- PMIC_ID* Get_PMIC_ID(void);
- };
- //---------------------------------------------------------------------------
- extern PACKAGE TfrmBaseBand *frmBaseBand;
- //---------------------------------------------------------------------------
- #endif