summaryrefslogtreecommitdiff
path: root/usrp2/firmware/lib
diff options
context:
space:
mode:
authorJohnathan Corgan2010-05-11 18:00:19 -0700
committerJohnathan Corgan2010-05-11 18:00:19 -0700
commitc1c29651e8a13c090228723684d6f693a6ae8c34 (patch)
tree7f38fa94a51e68be60243e5a2bd3bb3acc1e700d /usrp2/firmware/lib
parentc76897abcbfe1c149bffd27fba0224d3ebc83503 (diff)
parent1fc7c57f778a9f05ded1d216247242ee13632d03 (diff)
downloadgnuradio-c1c29651e8a13c090228723684d6f693a6ae8c34.tar.gz
gnuradio-c1c29651e8a13c090228723684d6f693a6ae8c34.tar.bz2
gnuradio-c1c29651e8a13c090228723684d6f693a6ae8c34.zip
Merge branch 'master' into wip/burx_support
* master: (39 commits) Add gru.hexshort to deal with short hex constants Assign USB PID for Hans de Bok Add missing buffer allocator hint to gr_ofdm_sampler.cc Really fix the missing include for boost::bind gr-wxgui: Added additional color table entries Missed updates for omnithread/mblock removal Remove omnithreads library. Remove mblock library. We hardly knew 'ye. Convert gr-audio-portaudio to Boost via gruel Further updates for removing omnithreads Update build configuration for OSX omnithreads changeover Add missing include file for boost::bind Convert gcell to use boost::threads instead of omnithread. Fix sequence error indication after stopping then restarting streaming on USRP2. initial move from mld_threads to gruel:: namespace threads and such Initial changes to remove mld_thread and instead use gruel:: namespace classes Fixing doxygen warnings from arb_resampler. Also, removed set_taps from public Fixing doxygen warnings from channelizer block. Fixing documentation to get rid of doxygen warnings. Adding documentation for fff version of othe PFB clock sync algorithm. ...
Diffstat (limited to 'usrp2/firmware/lib')
-rw-r--r--usrp2/firmware/lib/adf4350.c4
-rw-r--r--usrp2/firmware/lib/db_wbxng.c14
2 files changed, 12 insertions, 6 deletions
diff --git a/usrp2/firmware/lib/adf4350.c b/usrp2/firmware/lib/adf4350.c
index 0725c9337..dbab654ea 100644
--- a/usrp2/firmware/lib/adf4350.c
+++ b/usrp2/firmware/lib/adf4350.c
@@ -30,7 +30,7 @@
#define MIN_VCO_FREQ U2_DOUBLE_TO_FXPT_FREQ(2.2e9) /* minimum vco freq */
#define MAX_VCO_FREQ U2_DOUBLE_TO_FXPT_FREQ(4.4e9) /* minimum vco freq */
#define MAX_FREQ MAX_VCO_FREQ /* upper bound freq (rf div = 1) */
-#define MIN_FREQ DIV_ROUND(MIN_VCO_FREQ, MAX_RF_DIV) /* calculated lower bound freq */
+#define MIN_FREQ U2_DOUBLE_TO_FXPT_FREQ(68.75e6) /* lower bound freq (rf div = 16) */
u2_fxpt_freq_t adf4350_get_max_freq(void){
return MAX_FREQ;
@@ -170,7 +170,7 @@ bool adf4350_set_freq(u2_fxpt_freq_t freq, struct db_base *dbb){
adf4350_load_register(2, dbb);
adf4350_load_register(4, dbb);
adf4350_load_register(0, dbb); /* register 0 must be last */
- return true;
+ return adf4350_get_locked(dbb);
}
u2_fxpt_freq_t adf4350_get_freq(struct db_base *dbb){
diff --git a/usrp2/firmware/lib/db_wbxng.c b/usrp2/firmware/lib/db_wbxng.c
index 115ac8a24..954633da2 100644
--- a/usrp2/firmware/lib/db_wbxng.c
+++ b/usrp2/firmware/lib/db_wbxng.c
@@ -29,6 +29,9 @@
#include <stdio.h>
#include <stdint.h>
+#define min(X,Y) ((X) < (Y) ? (X) : (Y))
+#define max(X,Y) ((X) > (Y) ? (X) : (Y))
+
bool wbxng_init_rx(struct db_base *dbb);
bool wbxng_init_tx(struct db_base *dbb);
bool wbxng_set_freq(struct db_base *dbb, u2_fxpt_freq_t freq, u2_fxpt_freq_t *dc);
@@ -45,7 +48,7 @@ struct db_wbxng_rx db_wbxng_rx = {
.base.is_tx = false,
.base.output_enables = RX2_RX1N|RXBB_EN|ATTN_MASK|ENABLE_33|ENABLE_5|PLL_CE|PLL_PDBRF|ATTN_MASK,
.base.used_pins = 0xFFFF,
- .base.freq_min = U2_DOUBLE_TO_FXPT_FREQ(67.5e6),
+ .base.freq_min = U2_DOUBLE_TO_FXPT_FREQ(68.75e6),
.base.freq_max = U2_DOUBLE_TO_FXPT_FREQ(2200e6),
.base.gain_min = U2_DOUBLE_TO_FXPT_GAIN(0),
.base.gain_max = U2_DOUBLE_TO_FXPT_GAIN(31.5),
@@ -81,7 +84,7 @@ struct db_wbxng_tx db_wbxng_tx = {
.base.is_tx = true,
.base.output_enables = RX_TXN|TXMOD_EN|ENABLE_33|ENABLE_5|PLL_CE|PLL_PDBRF,
.base.used_pins = 0xFFFF,
- .base.freq_min = U2_DOUBLE_TO_FXPT_FREQ(67.5e6),
+ .base.freq_min = U2_DOUBLE_TO_FXPT_FREQ(68.75e6),
.base.freq_max = U2_DOUBLE_TO_FXPT_FREQ(2200e6),
.base.gain_min = U2_DOUBLE_TO_FXPT_GAIN(0),
.base.gain_max = U2_DOUBLE_TO_FXPT_GAIN(25),
@@ -149,8 +152,11 @@ wbxng_init_rx(struct db_base *dbb)
bool
wbxng_set_freq(struct db_base *dbb, u2_fxpt_freq_t freq, u2_fxpt_freq_t *dc)
{
- bool ok = adf4350_set_freq(2*freq,dbb);
- *dc = adf4350_get_freq(dbb)/2;
+ // clamp freq
+ u2_fxpt_freq_t clamp_freq = max(dbb->freq_min, min(freq, dbb->freq_max));
+ //printf("Requested LO freq = %u", (uint32_t) ((clamp_freq >> U2_FPF_RP)/1000));
+ bool ok = adf4350_set_freq(clamp_freq<<1,dbb);
+ *dc = adf4350_get_freq(dbb)>>1;
return ok;
}