diff options
Diffstat (limited to 'software/rda1846dongle/rda1846_defines.h')
-rw-r--r-- | software/rda1846dongle/rda1846_defines.h | 62 |
1 files changed, 46 insertions, 16 deletions
diff --git a/software/rda1846dongle/rda1846_defines.h b/software/rda1846dongle/rda1846_defines.h index 6b9c29a..379ce3b 100644 --- a/software/rda1846dongle/rda1846_defines.h +++ b/software/rda1846dongle/rda1846_defines.h @@ -76,7 +76,13 @@ #define RDA1846_REG_DTMF_OUT 0x6C //freq +#ifdef QUARTZ_12M288 #define RDA1846_FREQ_CORR_2M 73.1428567759 +#endif // QUARTZ_12M288 +#ifdef QUARTZ_13M +#define RDA1846_FREQ_CORR_2M 69.136878448 +#endif // QUARTZ_13M + #define RDA1846_FREQ_CORR_1M5 RDA1846_FREQ_CORR_2M/1.5 #define RDA1846_FREQ_CORR_70CM RDA1846_FREQ_CORR_2M/3.0 @@ -94,30 +100,40 @@ #define RDA1846_BAND_70CM_LOW 400000 // kHz #define RDA1846_BAND_70CM_HIGH 520000 // kHZ +#ifdef QUARTZ_12M288 #define RDA1846_XTAL_FREQ 12288 // 12.288 MHz #define RDA1846_ADCLK_FREQ 6144 // 12.288/2 MHz #define RDA1846_CLK_MODE 0x0F11 // 12-14 MHz +#endif // QUARTZ_12M288 + +#ifdef QUARTZ_13M +#define RDA1846_XTAL_FREQ 13000 // 13.000 MHz +#define RDA1846_ADCLK_FREQ 6500 // 13.000/2 MHz +#define RDA1846_CLK_MODE 0x0F11 // 12-14 MHz +#endif // QUARTZ_13M + + // ctl -#define RDA1846_CTL_CH_25K 0x3000 -#define RDA1846_CTL_CH_12K5 0x0000 -#define RDA1846_CTL_CH_RESET 0xCFFF +#define RDA1846_CTL_CH_25K 0x3000 +#define RDA1846_CTL_CH_12K5 0x0000 +#define RDA1846_CTL_CH_RESET 0xCFFF -#define RDA1846_CTL_TAIL_ELIM 0x0800 +#define RDA1846_CTL_TAIL_ELIM 0x0800 -#define RDA1846_CTL_RX_A_TX_A 0x0200 -#define RDA1846_CTL_RX_A_TX_M 0x0100 -#define RDA1846_CTL_RX_M_TX_M 0x0000 +#define RDA1846_CTL_RX_A_TX_A 0x0200 +#define RDA1846_CTL_RX_A_TX_M 0x0100 +#define RDA1846_CTL_RX_M_TX_M 0x0000 -#define RDA1846_CTL_MUTE 0x0080 -#define RDA1846_CTL_TX 0x0040 -#define RDA1846_CTL_RX 0x0020 -#define RDA1846_CTL_VOX 0x0010 -#define RDA1846_CTL_SQ 0x0008 -#define RDA1846_CTL_PDN 0x0004 -#define RDA1846_CTL_CHIP_CAL 0x0002 -#define RDA1846_CTL_SOFT_RST 0x0001 +#define RDA1846_CTL_MUTE 0x0080 +#define RDA1846_CTL_TX 0x0040 +#define RDA1846_CTL_RX 0x0020 +#define RDA1846_CTL_VOX 0x0010 +#define RDA1846_CTL_SQ 0x0008 +#define RDA1846_CTL_PDN 0x0004 +#define RDA1846_CTL_CHIP_CAL 0x0002 +#define RDA1846_CTL_SOFT_RST 0x0001 // flag @@ -205,7 +221,8 @@ #define dtmf_tone_freq_hz(value) (uint16_t)round(value/4.096) #define dtmf_tone_freq_value(hz) (uint16_t)round(hz*4.096) -// DTMF frequencies @ 12.288 MHz - these are the defaults... +#ifdef QUARTZ_12M288 +// DTMF frequencies @ 12.288 MHz - these are the defaults... are they? #define RDA1846_DTMF_C0 0x61 // 697 Hz #define RDA1846_DTMF_C1 0x5B // 770 Hz #define RDA1846_DTMF_C2 0x53 // 852 Hz @@ -214,5 +231,18 @@ #define RDA1846_DTMF_C5 0x1E // 1336 Hz #define RDA1846_DTMF_C6 0x0A // 1477 Hz #define RDA1846_DTMF_C7 0xF6 // 1633 Hz +#endif // QUARTZ_12M8 + +#ifdef QUARTZ_13M +// DTMF frequencies @ 13 MHz - these are the defaults... +#define RDA1846_DTMF_C0 0x61 // 697 Hz +#define RDA1846_DTMF_C1 0x5E // 770 Hz +#define RDA1846_DTMF_C2 0x57 // 852 Hz +#define RDA1846_DTMF_C3 0x4B // 941 Hz +#define RDA1846_DTMF_C4 0x31 // 1209 Hz +#define RDA1846_DTMF_C5 0x1E // 1336 Hz +#define RDA1846_DTMF_C6 0x0F // 1477 Hz +#define RDA1846_DTMF_C7 0xFB // 1633 Hz +#endif // QUARTZ_13M #endif |