form_FM.h
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:4k
源码类别:

MTK

开发平台:

C++ Builder

  1. //---------------------------------------------------------------------------
  2. #ifndef _FORM_FM_H_
  3. #define _FORM_FM_H_
  4. //---------------------------------------------------------------------------
  5. #include <Classes.hpp>
  6. #include <Controls.hpp>
  7. #include <StdCtrls.hpp>
  8. #include <Forms.hpp>
  9. #include <ComCtrls.hpp>
  10. #include <ExtCtrls.hpp>
  11. #ifndef  _FM_RADIO_H_
  12. #include "fm_radio.h"
  13. #endif
  14. //---------------------------------------------------------------------------
  15. typedef enum
  16. {
  17.     DRAW_FM_STATION = 0x01,
  18.     DRAW_FM_REGISTER = 0x02,
  19.     DRAW_FM_STATUS = 0x04
  20. }E_DRAW_FM_T;
  21. //---------------------------------------------------------------------------
  22. class TfrmFM : public TForm
  23. {
  24. __published: // IDE-managed Components
  25.         TPanel *Panel1;
  26.         TPanel *Panel2;
  27.         TLabel *Label2;
  28.         TEdit *m_edtFreq;
  29.         TLabel *Label3;
  30.         TButton *m_btnSetFreq;
  31.         TPanel *Panel3;
  32.         TPanel *Panel4;
  33.         TCheckBox *m_cbSoftMute;
  34.         TCheckBox *m_cbStereoBlend;
  35.         TLabel *Label6;
  36.         TComboBox *m_cbStereoBlendLevel;
  37.         TPanel *Panel5;
  38.         TPanel *Panel6;
  39.         TLabel *Label8;
  40.         TLabel *Label9;
  41.         TEdit *m_edtAddr;
  42.         TEdit *m_edtWord1;
  43.         TButton *m_btnRead;
  44.         TButton *m_btnWrite;
  45.         TPanel *Panel7;
  46.         TStatusBar *m_sbFM;
  47.         TPanel *Panel8;
  48.         TLabel *Label10;
  49.         TLabel *Label11;
  50.         TButton *m_btnGet;
  51.         TPanel *Panel9;
  52.         TPanel *Panel10;
  53.         TLabel *Label12;
  54.         TButton *m_btnSearchNextStation;
  55.         TLabel *Label4;
  56.         TComboBox *m_cbMode;
  57.         TButton *m_btnSearchPreStation;
  58.         TButton *m_btnSetAudio;
  59.         TLabel *Label1;
  60.         TLabel *Label13;
  61.         TLabel *Label14;
  62.         TStaticText *m_stRssi;
  63.         TStaticText *m_stIfCounter;
  64.         TStaticText *m_stHLSide;
  65.         TLabel *Label15;
  66.         TLabel *Label16;
  67.         TStaticText *m_stStereoMono;
  68.         TStaticText *lblHint;
  69.         TTimer *HintTimer;
  70.         TEdit *m_edtStation;
  71.         TPanel *Panel11;
  72.         TPanel *Panel12;
  73.         TButton *m_btnReset;
  74.         TEdit *m_edtWord0;
  75.         TLabel *Label17;
  76.         TComboBox *m_cbRssiThreshold;
  77.         TComboBox *m_cbIfCounterDelta;
  78.         void __fastcall FormActivate(TObject *Sender);
  79.         void __fastcall edtFreqCheck(TObject *Sender);
  80.         void __fastcall m_btnSetFreqClick(TObject *Sender);
  81.         void __fastcall edtRssiThresholdCheck(TObject *Sender);
  82.         void __fastcall edtIFCounterDeltaCheck(TObject *Sender);
  83.         void __fastcall m_btnSearchNextStationClick(TObject *Sender);
  84.         void __fastcall m_btnSearchPreStationClick(TObject *Sender);
  85.         void __fastcall m_btnSetAudioClick(TObject *Sender);
  86.         void __fastcall m_btnReadClick(TObject *Sender);
  87.         void __fastcall m_btnWriteClick(TObject *Sender);
  88.         void __fastcall HintTimerTimer(TObject *Sender);
  89.         void __fastcall m_btnGetClick(TObject *Sender);
  90.         void __fastcall m_btnResetClick(TObject *Sender);
  91.         void __fastcall m_cbModeChange(TObject *Sender);
  92. private: // User declarations
  93.         CFMRADIO m_cFM_RADIO_Obj;
  94.         bool m_bInit;
  95.         FM_VAILD_FREQ_CNF_T m_sValidFreq;
  96.         unsigned char m_ucAddr;
  97.         unsigned short m_usData;
  98.         S_FM_STATUS_T m_sStatus;
  99. public: // User declarations
  100.         __fastcall TfrmFM(TComponent* Owner);
  101.         void Init(void);
  102.         // UI
  103.         void ShowHintLabel(TControl *sender, char* hint);
  104.         void CurrentPageReset(void);
  105.         void CurrentPageLock(void);
  106.         void ReDrawFields(E_DRAW_FM_T draw);
  107.         // call back
  108.         void CNF_FM_PowerOn(void);
  109.         void CNF_FM_PowerReset(void);
  110.         void CNF_FM_PowerOff(void);
  111.         void CNF_FM_SetFreq(void);
  112.         void CNF_FM_SearchNextStation(void);
  113.         void CNF_FM_SearchPreStation(void);
  114.         void CNF_FM_SetAudio(void);
  115.         void CNF_FM_ReadData(void);
  116.         void CNF_FM_WriteData(void);
  117.         void CNF_FM_GetStatus(void);
  118. };
  119. //---------------------------------------------------------------------------
  120. extern PACKAGE TfrmFM *frmFM;
  121. //---------------------------------------------------------------------------
  122. #endif