diff options
author | Johnathan Corgan | 2012-04-01 16:47:32 -0700 |
---|---|---|
committer | Johnathan Corgan | 2012-04-01 16:47:32 -0700 |
commit | de0070d765ea31befcbc14eaecae2b934eec4afb (patch) | |
tree | c48808337128e50775ed0f31c3c2c4528fcea009 /gr-fcd | |
parent | 269691c7d45675382bafbdf8a56f0682f1927fd9 (diff) | |
parent | 98c703b3282b47ae2e0deaf317468f789cc9176e (diff) | |
download | gnuradio-de0070d765ea31befcbc14eaecae2b934eec4afb.tar.gz gnuradio-de0070d765ea31befcbc14eaecae2b934eec4afb.tar.bz2 gnuradio-de0070d765ea31befcbc14eaecae2b934eec4afb.zip |
Merge branch 'master' into next
Diffstat (limited to 'gr-fcd')
-rw-r--r-- | gr-fcd/grc/fcd_source_c.xml | 15 | ||||
-rw-r--r-- | gr-fcd/include/fcd/fcd_source_c.h | 14 | ||||
-rw-r--r-- | gr-fcd/lib/fcd_source_c_impl.cc | 16 | ||||
-rw-r--r-- | gr-fcd/lib/fcd_source_c_impl.h | 1 | ||||
-rw-r--r-- | gr-fcd/swig/fcd_source_c.i | 1 |
5 files changed, 44 insertions, 3 deletions
diff --git a/gr-fcd/grc/fcd_source_c.xml b/gr-fcd/grc/fcd_source_c.xml index 8572e6da1..7c55239aa 100644 --- a/gr-fcd/grc/fcd_source_c.xml +++ b/gr-fcd/grc/fcd_source_c.xml @@ -9,6 +9,9 @@ #if $lna() != 20.0 self.$(id).set_lna_gain($lna) #end if +#if $mixer() != +12.0 +self.$(id).set_mixer_gain($mixer) +#end if #if $ppm() != 115 self.$(id).set_freq_corr($ppm) #end if @@ -22,6 +25,7 @@ self.$(id).set_freq($freq) </make> <callback>set_freq($freq)</callback> <callback>set_lna_gain($lna)</callback> + <callback>set_mixer_gain($mixer)</callback> <callback>set_freq_corr($ppm)</callback> <callback>set_dc_corr($dci,$dcq)</callback> <callback>set_iq_corr($iq_gain,$iq_phase)</callback> @@ -45,6 +49,12 @@ self.$(id).set_freq($freq) <type>real</type> </param> <param> + <name>Mixer Gain (dB)</name> + <key>mixer</key> + <value>+12</value> + <type>real</type> + </param> + <param> <name>Frequency corr. (ppm)</name> <key>ppm</key> <value>-120</value> @@ -94,7 +104,10 @@ To find the device name on Linux type: The LNA gain is a set of discrete values between -5 to 30 dB with 2.5 dB step, but you can \ use any float value and it will be rounded to the nearest valid value. - + +The Mixer gain can be set either to +4 or +12 dB, but you can use any float value \ +and it will be rounded to the nearest valid value. + The FCD block can autmatically apply frequency correction: - For FCD v1.0 you can leave at -120 ppm - For FCD v1.1 with serial number 810 or greater use -12 ppm diff --git a/gr-fcd/include/fcd/fcd_source_c.h b/gr-fcd/include/fcd/fcd_source_c.h index 31393418f..988925c2e 100644 --- a/gr-fcd/include/fcd/fcd_source_c.h +++ b/gr-fcd/include/fcd/fcd_source_c.h @@ -88,11 +88,21 @@ public: * 2.5 dB steps, you can can call this method with any float value * and it will be rounded to the nearest valid value. * - * By default the FCD is set to 20 dB and this is a good value for most - * cases. In noisy areas you may try to reduce the gain. + * By default the LNA gain is set to 20 dB and this is a good value for + * most cases. In noisy areas you may try to reduce the gain. */ virtual void set_lna_gain(float gain) = 0; + /*! \brief Set mixer gain. + * \param gain The new gain in dB. + * + * Set the mixer gain in the FCD. Valid values are +4 and +12 dB. + * + * By default the mixer gain is set to +12 dB and this is a good value for + * most cases. In noisy areas you may try to reduce the gain. + */ + virtual void set_mixer_gain(float gain) = 0; + /*! \brief Set new frequency correction. * \param ppm The new frequency correction in parts per million * diff --git a/gr-fcd/lib/fcd_source_c_impl.cc b/gr-fcd/lib/fcd_source_c_impl.cc index a67d5bdbb..9543f16eb 100644 --- a/gr-fcd/lib/fcd_source_c_impl.cc +++ b/gr-fcd/lib/fcd_source_c_impl.cc @@ -173,6 +173,22 @@ void fcd_source_c_impl::set_lna_gain(float gain) /* TODO: check fme */ } +// Set mixer gain +void fcd_source_c_impl::set_mixer_gain(float gain) +{ + FCD_MODE_ENUM fme; + unsigned char g; + + if ( gain > 4.0 ) { + g = TMGE_P12_0DB; + } else { + g = TMGE_P4_0DB; + } + + fme = fcdAppSetParam(FCD_CMD_APP_SET_MIXER_GAIN, &g, 1); + /* TODO: check fme */ +} + // Set new frequency correction void fcd_source_c_impl::set_freq_corr(int ppm) { diff --git a/gr-fcd/lib/fcd_source_c_impl.h b/gr-fcd/lib/fcd_source_c_impl.h index e4a7467c5..d082ecc1e 100644 --- a/gr-fcd/lib/fcd_source_c_impl.h +++ b/gr-fcd/lib/fcd_source_c_impl.h @@ -32,6 +32,7 @@ public: void set_freq(float freq); void set_freq_khz(int freq); void set_lna_gain(float gain); + void set_mixer_gain(float gain); void set_freq_corr(int ppm); void set_dc_corr(double _dci, double _dcq); void set_iq_corr(double _gain, double _phase); diff --git a/gr-fcd/swig/fcd_source_c.i b/gr-fcd/swig/fcd_source_c.i index 3438ab74d..77fcf8a42 100644 --- a/gr-fcd/swig/fcd_source_c.i +++ b/gr-fcd/swig/fcd_source_c.i @@ -15,6 +15,7 @@ public: void set_freq(float freq); void set_freq_khz(int freq); void set_lna_gain(float gain); + void set_mixer_gain(float gain); void set_freq_corr(int ppm); void set_dc_corr(double dci, double dcq); void set_iq_corr(double gain, double phase); |