⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tuner.h

📁 这是一个TDA7540的模版程序
💻 H
字号:
/***************************************************************************
Project  :   TDA7540 Jig board 
Compiler : ST7 HiCross C (HiWARE)
Module   :  tuner.h
Version  :  V 1.0
Created  :  
Author   :  Jerry HE / ST-ShenZhen
Description
         -  tuner head file
Modified
	  - Jan.24th,2005    
***************************************************************************/


/**************************************************************************
        Constants/Macro Definitions
***************************************************************************/
#if TDA7540_IC
#define TUNER_ADR   0xC4
#define AUTO_INC     0x40

EXTR unsigned char Tun_Buff[40];
//EXTR unsigned char Pll_Buff[10];
#define radio_pll_cpump                Tun_Buff[0]  	/*Pll charge pump high and low current*/
#define radio_pll_pcl                      Tun_Buff[1]     /*Pll program counter low  byte*/
#define radio_pll_pch                     Tun_Buff[2]     /*Pll program counter high byte*/
#define radio_tun_tunvolt1            Tun_Buff[3]     /*Tuning Voltage 1*/
#define radio_tun_tunvolt2            Tun_Buff[4]     /*Tuning Voltage 2*/
#define radio_pll_sampletime        Tun_Buff[5] /* Lock detect;IF counter status;Mute&AGC;Tsample*/
#define radio_pll_ewcentre            Tun_Buff[6]  /*Error window; center freqency*/
#define radio_tun_amcontrol         Tun_Buff[7]   /*AM seek stop constant; multipath pin; AM prescaler; weather band 
                                                                              TV offset; TV tracking in pll; local mode; */
#define radio_tun_qualityiss          Tun_Buff[8]  /*ISS filter;ISS filter bandwidth;weather band ISS filter
                                                                      charge/discharge current*/
#define radio_tun_qualdetAdj           Tun_Buff[9]  /*AC high pass; AC gain; AC narrow band; AC wide band */
#define radio_tun_qualdetMul           Tun_Buff[10]  /*Multipath thereshold;Multipath gain;Multipath bandpass freq*/
#define radio_tun_qualdetDev           Tun_Buff[11] /*ISS fixed bandwidth 80K; dev ratio; dev theres bandwidth
                                                                              dev charge current xxuA, xuA*/
#define radio_tun_softmute             Tun_Buff[12]   /*Mute enable; Mute depth; Mute start point */
#define radio_tun_adjmute              Tun_Buff[13]   /*AC mute filter bandwidth; AC mute theres; AC mute depth*/
#define radio_tun_vcoplldiv            Tun_Buff[14]  /* PLL for FM/AM; PLL reference freq; VCO 0 degree/180 degree VCO divider */
#define radio_tun_fmagc                Tun_Buff[15]  /* KAGC thereshold; IF AGC thereshold;RF thereshold */
#define radio_tun_amagc                Tun_Buff[16]  /* DAGC th; WAGC th */
#define radio_tun_fmdem                Tun_Buff[17]  /*spike cancelation; demo adjust */
#define radio_tun_smeter               Tun_Buff[18]  /*S meter offset; slope; overdeviation current */
#define radio_tun_ifgainXtal           Tun_Buff[19]  /* IF Gain; Xtal adjust; Xtal limitation*/
#define radio_tun_ift1ift2                Tun_Buff[20]   /*IFT1; IFT2*/
#define radio_tun_IQmixer              Tun_Buff[21]    /*IQ mixer; softmute refer offset */
#define radio_tun_amifNB               Tun_Buff[22]   /*Int xus; detection; thereshold */
#define radio_tun_sstop                  Tun_Buff[23]   /* SStop */
#define radio_str_amnoise              Tun_Buff[24]   /*Stereo VCO adjust; Audio noise blanker; audio AM noise blanker */
#define radio_str_stringain            Tun_Buff[25]   /* In gain; de-emphasis; noise blanker peak charge; mono-stereo */
#define radio_str_nb                       Tun_Buff[26]  /* Deviation adjust; audio noise blanker */
#define radio_str_HiCut                   Tun_Buff[27]  /* hiCut depth;VHCH; VHCL;*/
#define radio_str_blend                   Tun_Buff[28] /* Quality detect; audio noise field strength; stereo blend*/
#define radio_str_multipath            Tun_Buff[29] /* Multipath detector gain; charge current; band pass gain; */
#define radio_str_rolloff                 Tun_Buff[30] /* Level gain; roll off */
#define radio_str_afs                      Tun_Buff[31] /* AFS control ablility, AM audio noise blanker setting */
#define radio_str_amcornerfreq     Tun_Buff[32] /* Deemphasis, am corner freq */
#define radio_test1                         Tun_Buff[33]  /* Testing 1 */
#define radio_test2                         Tun_Buff[34]  /* Testing 2 */
#define radio_test3                         Tun_Buff[35]  /* Testing 3 */
#define radio_test4                         Tun_Buff[36]  /* Testing 4 */
#define radio_test5                         Tun_Buff[37]  /* Testing 5 */
#define radio_test6                         Tun_Buff[38]  /* Testing 6 */
#define radio_str_spike                  Tun_Buff[39]  /* Spike canceler */

#define PLL_AREA                    0,2
#define CPUMP_AREA               0,0
#define TUNVOLT_AREA           4,4
#define IF_AREA                      5,6
#define IF_SAMPLE_AREA        5,5
#define IF_ERROR_AREA          6,6
#define SOFTMUTE_AREA         12,12
#define VCO_AREA                   14,14
#define SSTOP_AREA                23,23
#define AMAGC_AREA               16,16
#define FMDEM_AREA               17,17
#define SMETER_AREA              18,18
#define XTAL_AREA                  19,19
#define IFT_AREA                     20,20
#define IQMIXER_AREA             21,21
#define STEREOMUTE_AREA      25,25
#define HICUT_AREA                 27,27
#define BLEND_AREA                 28,28
#define ROLLOFF_AREA             30,30
#define AFS_AREA                     31,31

//For PLL current Tun_Buff[0]
//Bit3~0
#define PLL_HICURRENT_0MA       0x00
#define PLL_HICURRENT_0_5mA     0x01
#define PLL_HICURRENT_1MA       0x02
#define PLL_HICURRENT_1_5mA     0x03
#define PLL_HICURRENT_2MA       0x04
#define PLL_HICURRENT_2_5mA     0x05
#define PLL_HICURRENT_3MA       0x06
#define PLL_HICURRENT_3_5mA     0x07
#define PLL_HICURRENT_4MA       0x08
#define PLL_HICURRENT_4_5mA     0x09
#define PLL_HICURRENT_5MA       0x0A
#define PLL_HICURRENT_5_5mA     0x0B
#define PLL_HICURRENT_6MA       0x0C
#define PLL_HICURRENT_6_5mA     0x0D
#define PLL_HICURRENT_7MA       0x0E
#define PLL_HICURRENT_7_5mA     0x0F
//Bit 5~4
#define PLL_LOWCURRENT_0uA      0x00
#define PLL_LOWCURRENT_50uA     0x10
#define PLL_LOWCURRENT_100uA    0x20
#define PLL_LOWCURRENT_150uA    0x30
//Bit6
#define PLL_LOWCURRENT_MODE     0x00
#define PLL_HIGHCURRENT_MODE    0x40
//Bit7
#define PLL_FMSEEK_ON           0x00
#define PLL_FMSEEK_OFF          0x80

//Sample time and IFC   Tun_Buff[5]
#define PLL_TSAMPLE_FM20_48_AM128  0x00
#define PLL_TSAMPLE_FM10_24_AM64    0x01
#define PLL_TSAMPLE_FM5_12_AM32      0x02
#define PLL_TSAMPLE_FM2_56_AM16      0x03
#define PLL_TSAMPLE_FM1_28_AM8        0x04
#define PLL_TSAMPLE_FM0_64_AM4        0x05
#define PLL_TSAMPLE_FM0_32_AM2        0x06
#define PLL_TSAMPLE_FM0_16_AM1        0x07

#define PLL_IFC_DISABLE                        0x00
#define PLL_IFC_ENABLE                         0x08

#define PLL_IFC_FMMODE                        0x10
#define PLL_IFC_AM450K                         0x20
#define PLL_IFC_AM10_7M                      0x30

#define DISABLE_MUTEONHOLD               0x00
#define ENABLE_MUTEONHOLD                0x40

#define PLL_LOCK_DISABLE                    0x00
#define PLL_LOCK_ENABLE                     0x80

//center freqency and delta window   Tun_Buff[5]
#define PLL_IFC_CENTER_10_7MHZ     0x0F
#define PLL_IFC_CENTER_450KHZ      0x01

#define PLL_IFC_EW_FM6_25_AM1K     0x60
#define PLL_IFC_EW_FM12_5_AM2K     0x80
#define PLL_IFC_EW_FM25_AM4K       0xA0
#define PLL_IFC_EW_FM50_AM8K       0xC0
#define PLL_IFC_EW_FM100_AM16K     0xE0


//For reference freqency
#define PLL_REFERECE_50KHz      0x20     
#define PLL_REFERECE_25KHz      0x28
#define PLL_REFERECE_10KHz      0x30
#define PLL_REFERECE_9KHz       0x38
#define PLL_REFERECE_2KHz       0x00

//For SD threshold
#define SSTOP_IFC                       0x00
#define SSTOP_IFC_0_89V           0x10    // IFC=H & FSU>0.89V
#define SSTOP_IFC_1_16V           0x20    // IFC=H & FSU>1.16V
#define SSTOP_IFC_1_43V           0x30    // IFC=H & FSU>1.43V
#define SSTOP_IFC_1_7V             0x40    // IFC=H & FSU>1.7V
#define SSTOP_IFC_1_97V           0x50
#define SSTOP_IFC_2_24V           0x60
#define SSTOP_IFC_2_51V           0x70
#define SSTOP_IFC_2_78V           0x80
#define SSTOP_IFC_3_05V           0x90
#define SSTOP_IFC_3_32V           0xA0
#define SSTOP_IFC_3_59V           0xB0
#define SSTOP_IFC_3_86V           0xC0
#define SSTOP_IFC_4_13V           0xD0
#define SSTOP_IFC_4_40V           0xE0
#define SSTOP_IFC_4_67V           0xF0


#endif

extern void TunerSettingLoad(void);
extern void TunerRegisterRefresh(void);
extern void WriteTunerRegister(unsigned char,unsigned char);
/*** (c) 2005  STMicroelectronics ****************** END OF FILE ***/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -