- //---------------------------------------------------------------------------
- #ifndef _FORM_FM_H_
- #define _FORM_FM_H_
- //---------------------------------------------------------------------------
- #include <Classes.hpp>
- #include <Controls.hpp>
- #include <StdCtrls.hpp>
- #include <Forms.hpp>
- #include <ComCtrls.hpp>
- #include <ExtCtrls.hpp>
- #ifndef _FM_RADIO_H_
- #include "fm_radio.h"
- #endif
- //---------------------------------------------------------------------------
- typedef enum
- {
- DRAW_FM_STATION = 0x01,
- DRAW_FM_REGISTER = 0x02,
- DRAW_FM_STATUS = 0x04
- }E_DRAW_FM_T;
- //---------------------------------------------------------------------------
- class TfrmFM : public TForm
- {
- __published: // IDE-managed Components
- TPanel *Panel1;
- TPanel *Panel2;
- TLabel *Label2;
- TEdit *m_edtFreq;
- TLabel *Label3;
- TButton *m_btnSetFreq;
- TPanel *Panel3;
- TPanel *Panel4;
- TCheckBox *m_cbSoftMute;
- TCheckBox *m_cbStereoBlend;
- TLabel *Label6;
- TComboBox *m_cbStereoBlendLevel;
- TPanel *Panel5;
- TPanel *Panel6;
- TLabel *Label8;
- TLabel *Label9;
- TEdit *m_edtAddr;
- TEdit *m_edtWord1;
- TButton *m_btnRead;
- TButton *m_btnWrite;
- TPanel *Panel7;
- TStatusBar *m_sbFM;
- TPanel *Panel8;
- TLabel *Label10;
- TLabel *Label11;
- TButton *m_btnGet;
- TPanel *Panel9;
- TPanel *Panel10;
- TLabel *Label12;
- TButton *m_btnSearchNextStation;
- TLabel *Label4;
- TComboBox *m_cbMode;
- TButton *m_btnSearchPreStation;
- TButton *m_btnSetAudio;
- TLabel *Label1;
- TLabel *Label13;
- TLabel *Label14;
- TStaticText *m_stRssi;
- TStaticText *m_stIfCounter;
- TStaticText *m_stHLSide;
- TLabel *Label15;
- TLabel *Label16;
- TStaticText *m_stStereoMono;
- TStaticText *lblHint;
- TTimer *HintTimer;
- TEdit *m_edtStation;
- TPanel *Panel11;
- TPanel *Panel12;
- TButton *m_btnReset;
- TEdit *m_edtWord0;
- TLabel *Label17;
- TComboBox *m_cbRssiThreshold;
- TComboBox *m_cbIfCounterDelta;
- void __fastcall FormActivate(TObject *Sender);
- void __fastcall edtFreqCheck(TObject *Sender);
- void __fastcall m_btnSetFreqClick(TObject *Sender);
- void __fastcall edtRssiThresholdCheck(TObject *Sender);
- void __fastcall edtIFCounterDeltaCheck(TObject *Sender);
- void __fastcall m_btnSearchNextStationClick(TObject *Sender);
- void __fastcall m_btnSearchPreStationClick(TObject *Sender);
- void __fastcall m_btnSetAudioClick(TObject *Sender);
- void __fastcall m_btnReadClick(TObject *Sender);
- void __fastcall m_btnWriteClick(TObject *Sender);
- void __fastcall HintTimerTimer(TObject *Sender);
- void __fastcall m_btnGetClick(TObject *Sender);
- void __fastcall m_btnResetClick(TObject *Sender);
- void __fastcall m_cbModeChange(TObject *Sender);
- private: // User declarations
- CFMRADIO m_cFM_RADIO_Obj;
- bool m_bInit;
- FM_VAILD_FREQ_CNF_T m_sValidFreq;
- unsigned char m_ucAddr;
- unsigned short m_usData;
- S_FM_STATUS_T m_sStatus;
- public: // User declarations
- __fastcall TfrmFM(TComponent* Owner);
- void Init(void);
- // UI
- void ShowHintLabel(TControl *sender, char* hint);
- void CurrentPageReset(void);
- void CurrentPageLock(void);
- void ReDrawFields(E_DRAW_FM_T draw);
- // call back
- void CNF_FM_PowerOn(void);
- void CNF_FM_PowerReset(void);
- void CNF_FM_PowerOff(void);
- void CNF_FM_SetFreq(void);
- void CNF_FM_SearchNextStation(void);
- void CNF_FM_SearchPreStation(void);
- void CNF_FM_SetAudio(void);
- void CNF_FM_ReadData(void);
- void CNF_FM_WriteData(void);
- void CNF_FM_GetStatus(void);
- };
- //---------------------------------------------------------------------------
- extern PACKAGE TfrmFM *frmFM;
- //---------------------------------------------------------------------------
- #endif