1 #ifndef __MT6620_FM_LIB_H__
2 #define __MT6620_FM_LIB_H__
4 #include "fm_typedef.h"
6 #define MT6620_VOL_MAX 0x2B // 43 volume(0-15)
12 POLL_N = 0xFFFE, //poling check if bit(n) is '0'
13 POLL_P = 0xFFFF, //polling check if bit(n) is '1'
17 FM_PUS_DSPPATCH = DSPPATCH,
18 FM_PUS_USDELAY = USDELAY,
19 FM_PUS_MSDELAY = MSDELAY,
20 FM_PUS_HW_VER = HW_VER,
21 FM_PUS_POLL_N = POLL_N, //poling check if bit(n) is '0'
22 FM_PUS_POLL_P = POLL_P, //polling check if bit(n) is '1'
55 MT6620_I2S_MASTER = 0,
65 struct mt6620_fm_i2s_info {
70 struct mt6620_fm_softmute_tune_cqi_t
72 fm_u16 ch; //current frequency
73 fm_u16 rssi; // RSSI of current channel (raw data)
74 fm_u16 pamd; // PAMD of current channel (raw data)
75 fm_u16 mr; // MR of current channel (raw data)
76 fm_u16 atdc; // ATDC of current channel (raw data)
77 fm_u16 prx; // PRX of current channel (raw data)
78 fm_u16 smg; // soft mute gain of current channel (raw data)
81 #define BITn(n) (uint16_t)(1<<(n))
82 #define MASK(n) (uint16_t)(~(1<<(n)))
83 //#define HiSideTableSize 1
84 #define FM_TX_PWR_CTRL_FREQ_THR 890
85 #define FM_TX_PWR_CTRL_TMP_THR_UP 45
86 #define FM_TX_PWR_CTRL_TMP_THR_DOWN 0
88 #define FM_TX_TRACKING_TIME_MAX 10000 //TX VCO tracking time, default 100ms
91 //#define FM_MAIN_PGSEL (0x9F)
93 #define FM_MAIN_BASE (0x0)
94 #define FM_MAIN_BITMAP0 (FM_MAIN_BASE + 0x80)
95 #define FM_MAIN_BITMAP1 (FM_MAIN_BASE + 0x81)
96 #define FM_MAIN_BITMAP2 (FM_MAIN_BASE + 0x82)
97 #define FM_MAIN_BITMAP3 (FM_MAIN_BASE + 0x83)
98 #define FM_MAIN_BITMAP4 (FM_MAIN_BASE + 0x84)
99 #define FM_MAIN_BITMAP5 (FM_MAIN_BASE + 0x85)
100 #define FM_MAIN_BITMAP6 (FM_MAIN_BASE + 0x86)
101 #define FM_MAIN_BITMAP7 (FM_MAIN_BASE + 0x87)
102 #define FM_MAIN_BITMAP8 (FM_MAIN_BASE + 0x88)
103 #define FM_MAIN_BITMAP9 (FM_MAIN_BASE + 0x89)
104 #define FM_MAIN_BITMAPA (FM_MAIN_BASE + 0x8a)
105 #define FM_MAIN_BITMAPB (FM_MAIN_BASE + 0x8b)
106 #define FM_MAIN_BITMAPC (FM_MAIN_BASE + 0x8c)
107 #define FM_MAIN_BITMAPD (FM_MAIN_BASE + 0x8d)
108 #define FM_MAIN_BITMAPE (FM_MAIN_BASE + 0x8e)
109 #define FM_MAIN_BITMAPF (FM_MAIN_BASE + 0x8f)