gr-baz Package
rtl2832-tuner_fc2580.h
Go to the documentation of this file.
1 #ifndef __TUNER_FC2580_H
2 #define __TUNER_FC2580_H
3 
4 #include "rtl2832.h"
5 
6 namespace RTL2832_NAMESPACE
7 {
8 namespace TUNERS_NAMESPACE
9 {
10 
12 {
14 public:
15  fc2580(demod* p);
16 public:
17  inline virtual const char* name() const
18  { return "Fitipower FC2580"; }
19 public:
20  int initialise(tuner::PPARAMS params = NULL);
21  int set_frequency(double freq);
22  int set_bandwidth(double bw);
23  int set_gain(double gain);
24 };
25 
26 }
27 }
28 
29 #define BORDER_FREQ 2600000 //2.6GHz : The border frequency which determines whether Low VCO or High VCO is used
30 #define USE_EXT_CLK 0 //0 : Use internal XTAL Oscillator / 1 : Use External Clock input
31 #define OFS_RSSI 57
32 
33 #define FC2580_I2C_ADDR 0xac
34 #define FC2580_CHECK_ADDR 0x01
35 #define FC2580_CHECK_VAL 0x56
36 
37 typedef enum {
43 
45 
46 #define FC2580_FCI_FAIL 0
47 #define FC2580_FCI_SUCCESS 1
48 
50 {
53 };
54 
55 extern void fc2580_wait_msec(RTL2832_NAMESPACE::tuner* pTuner, int a);
56 /*
57 fc2580_fci_result_type fc2580_i2c_write(RTL2832_NAMESPACE::tuner* pTuner, unsigned char reg, unsigned char val);
58 fc2580_fci_result_type fc2580_i2c_read(RTL2832_NAMESPACE::tuner* pTuner, unsigned char reg, unsigned char *read_data);
59 */
60 /*==============================================================================
61  fc2580 initial setting
62 
63  This function is a generic function which gets called to initialize
64 
65  fc2580 in DVB-H mode or L-Band TDMB mode
66 
67  <input parameter>
68 
69  ifagc_mode
70  type : integer
71  1 : Internal AGC
72  2 : Voltage Control Mode
73 
74 ==============================================================================*/
75 fc2580_fci_result_type fc2580_set_init(RTL2832_NAMESPACE::tuner* pTuner, int ifagc_mode, unsigned int freq_xtal );
76 
77 /*==============================================================================
78  fc2580 frequency setting
79 
80  This function is a generic function which gets called to change LO Frequency
81 
82  of fc2580 in DVB-H mode or L-Band TDMB mode
83 
84  <input parameter>
85 
86  f_lo
87  Value of target LO Frequency in 'kHz' unit
88  ex) 2.6GHz = 2600000
89 
90 ==============================================================================*/
91 fc2580_fci_result_type fc2580_set_freq(RTL2832_NAMESPACE::tuner* pTuner, unsigned int f_lo, unsigned int freq_xtal );
92 
93 
94 /*==============================================================================
95  fc2580 filter BW setting
96 
97  This function is a generic function which gets called to change Bandwidth
98 
99  frequency of fc2580's channel selection filter
100 
101  <input parameter>
102 
103  filter_bw
104  1 : 1.53MHz(TDMB)
105  6 : 6MHz
106  7 : 7MHz
107  8 : 7.8MHz
108 
109 
110 ==============================================================================*/
111 fc2580_fci_result_type fc2580_set_filter( RTL2832_NAMESPACE::tuner* pTuner, unsigned char filter_bw, unsigned int freq_xtal );
112 
113 // The following context is FC2580 tuner API source code
114 // Definitions
115 
116 // AGC mode
118 {
121 };
122 
123 
124 // Bandwidth mode
126 {
131 };
132 
133 // Manipulaing functions
134 int
137  );
138 
139 int
141  RTL2832_NAMESPACE::tuner* pTuner,
142  unsigned long RfFreqHz
143  );
144 
145 // Extra manipulaing functions
146 int
148  RTL2832_NAMESPACE::tuner* pTuner,
149  int BandwidthMode
150  );
151 
152 #endif
int initialise(tuner::PPARAMS params=NULL)
void fc2580_wait_msec(RTL2832_NAMESPACE::tuner *pTuner, int a)
Definition: rtl2832-tuner_fc2580.h:127
const tuner::PARAMS & params() const
Definition: rtl2832.h:253
Definition: rtl2832-tuner_fc2580.h:39
Definition: rtl2832.h:144
Definition: rtl2832-tuner_fc2580.h:40
Definition: rtl2832-tuner_fc2580.h:38
FUNCTION_STATUS
Definition: rtl2832-tuner_fc2580.h:49
Definition: rtl2832-tuner_fc2580.h:130
fc2580_fci_result_type fc2580_set_init(RTL2832_NAMESPACE::tuner *pTuner, int ifagc_mode, unsigned int freq_xtal)
#define IMPLEMENT_INLINE_TUNER_FACTORY(class_name)
Definition: rtl2832.h:77
int fc2580_Initialize(RTL2832_NAMESPACE::tuner *pTuner)
int fc2580_SetRfFreqHz(RTL2832_NAMESPACE::tuner *pTuner, unsigned long RfFreqHz)
fc2580_band_type
Definition: rtl2832-tuner_fc2580.h:37
Definition: rtl2832-tuner_fc2580.h:128
Definition: rtl2832-tuner_fc2580.h:119
Definition: rtl2832.h:309
Definition: rtl2832-tuner_fc2580.h:51
Definition: rtl2832.h:186
int fc2580_fci_result_type
Definition: rtl2832-tuner_fc2580.h:44
Definition: rtl2832.h:137
#define TUNERS_NAMESPACE
Definition: rtl2832.h:66
Definition: rtl2832-tuner_fc2580.h:41
Definition: rtl2832-tuner_fc2580.h:11
virtual double gain() const
Definition: rtl2832.h:228
fc2580_fci_result_type fc2580_set_freq(RTL2832_NAMESPACE::tuner *pTuner, unsigned int f_lo, unsigned int freq_xtal)
Definition: rtl2832-tuner_fc2580.h:129
virtual const char * name() const
Definition: rtl2832-tuner_fc2580.h:17
fc2580_fci_result_type fc2580_set_filter(RTL2832_NAMESPACE::tuner *pTuner, unsigned char filter_bw, unsigned int freq_xtal)
Definition: rtl2832-tuner_fc2580.h:52
Definition: rtl2832-tuner_e4000.h:6
Definition: rtl2832-tuner_fc2580.h:120
int fc2580_SetBandwidthMode(RTL2832_NAMESPACE::tuner *pTuner, int BandwidthMode)
FC2580_BANDWIDTH_MODE
Definition: rtl2832-tuner_fc2580.h:125
FC2580_AGC_MODE
Definition: rtl2832-tuner_fc2580.h:117