|
gr-baz Package
|
00001 #ifndef __TUNER_FC0013_H 00002 #define __TUNER_FC0013_H 00003 00004 #include "rtl2832.h" 00005 00006 namespace RTL2832_NAMESPACE 00007 { 00008 namespace TUNERS_NAMESPACE 00009 { 00010 00011 class fc0013 : public RTL2832_NAMESPACE::tuner_skeleton 00012 { 00013 IMPLEMENT_INLINE_TUNER_FACTORY(fc0013) 00014 public: 00015 fc0013(demod* p); 00016 public: 00017 inline virtual const char* name() const 00018 { return "Fitipower FC0013"; } 00019 public: 00020 int initialise(tuner::PPARAMS params = NULL); 00021 int set_frequency(double freq); 00022 int set_bandwidth(double bw); 00023 int set_gain(double gain); 00024 }; 00025 00026 } 00027 } 00028 00029 /** 00030 @file 00031 00032 @brief FC0013 tuner module declaration 00033 00034 One can manipulate FC0013 tuner through FC0013 module. 00035 FC0013 module is derived from tuner module. 00036 00037 // The following context is implemented for FC0013 source code. 00038 **/ 00039 00040 // Definitions 00041 enum FC0013_TRUE_FALSE_STATUS 00042 { 00043 FC0013_FALSE, 00044 FC0013_TRUE, 00045 }; 00046 00047 enum FC0013_I2C_STATUS 00048 { 00049 FC0013_I2C_SUCCESS, 00050 FC0013_I2C_ERROR, 00051 }; 00052 00053 enum FC0013_FUNCTION_STATUS 00054 { 00055 FC0013_FUNCTION_SUCCESS, 00056 FC0013_FUNCTION_ERROR, 00057 }; 00058 /* 00059 // Functions 00060 int FC0013_Read(RTL2832_NAMESPACE::tuner* pTuner, unsigned char RegAddr, unsigned char *pByte); 00061 int FC0013_Write(RTL2832_NAMESPACE::tuner* pTuner, unsigned char RegAddr, unsigned char Byte); 00062 00063 int 00064 fc0013_SetRegMaskBits( 00065 RTL2832_NAMESPACE::tuner* pTuner, 00066 unsigned char RegAddr, 00067 unsigned char Msb, 00068 unsigned char Lsb, 00069 const unsigned char WritingValue 00070 ); 00071 00072 int 00073 fc0013_GetRegMaskBits( 00074 RTL2832_NAMESPACE::tuner* pTuner, 00075 unsigned char RegAddr, 00076 unsigned char Msb, 00077 unsigned char Lsb, 00078 unsigned char *pReadingValue 00079 ); 00080 */ 00081 int FC0013_Open(RTL2832_NAMESPACE::tuner* pTuner); 00082 int FC0013_SetFrequency(RTL2832_NAMESPACE::tuner* pTuner, unsigned long Frequency, unsigned short Bandwidth); 00083 00084 // Set VHF Track depends on input frequency 00085 int FC0013_SetVhfTrack(RTL2832_NAMESPACE::tuner* pTuner, unsigned long Frequency); 00086 00087 // The following context is FC0013 tuner API source code 00088 00089 // Definitions 00090 00091 // Bandwidth mode 00092 enum FC0013_BANDWIDTH_MODE 00093 { 00094 FC0013_BANDWIDTH_6000000HZ = 6, 00095 FC0013_BANDWIDTH_7000000HZ = 7, 00096 FC0013_BANDWIDTH_8000000HZ = 8, 00097 }; 00098 00099 // Default for initialing 00100 #define FC0013_RF_FREQ_HZ_DEFAULT 50000000 00101 #define FC0013_BANDWIDTH_MODE_DEFAULT FC0013_BANDWIDTH_8000000HZ 00102 00103 // Tuner LNA 00104 enum FC0013_LNA_GAIN_VALUE 00105 { 00106 FC0013_LNA_GAIN_LOW = 0x00, // -6.3dB 00107 FC0013_LNA_GAIN_MIDDLE = 0x08, // 7.1dB 00108 FC0013_LNA_GAIN_HIGH_17 = 0x11, // 19.1dB 00109 FC0013_LNA_GAIN_HIGH_19 = 0x10, // 19.7dB 00110 }; 00111 00112 // Manipulaing functions 00113 void 00114 fc0013_GetTunerType( 00115 RTL2832_NAMESPACE::tuner* pTuner, 00116 int *pTunerType 00117 ); 00118 00119 void 00120 fc0013_GetDeviceAddr( 00121 RTL2832_NAMESPACE::tuner* pTuner, 00122 unsigned char *pDeviceAddr 00123 ); 00124 00125 int 00126 fc0013_Initialize( 00127 RTL2832_NAMESPACE::tuner* pTuner 00128 ); 00129 00130 int 00131 fc0013_SetRfFreqHz( 00132 RTL2832_NAMESPACE::tuner* pTuner, 00133 unsigned long RfFreqHz 00134 ); 00135 00136 int 00137 fc0013_GetRfFreqHz( 00138 RTL2832_NAMESPACE::tuner* pTuner, 00139 unsigned long *pRfFreqHz 00140 ); 00141 00142 // Extra manipulaing functions 00143 int 00144 fc0013_SetBandwidthMode( 00145 RTL2832_NAMESPACE::tuner* pTuner, 00146 int BandwidthMode 00147 ); 00148 00149 int 00150 fc0013_GetBandwidthMode( 00151 RTL2832_NAMESPACE::tuner* pTuner, 00152 int *pBandwidthMode 00153 ); 00154 00155 int 00156 fc0013_RcCalReset( 00157 RTL2832_NAMESPACE::tuner* pTuner 00158 ); 00159 00160 int 00161 fc0013_RcCalAdd( 00162 RTL2832_NAMESPACE::tuner* pTuner, 00163 int RcValue 00164 ); 00165 00166 #endif