diff options
author | Josh Blum | 2010-05-04 13:15:57 -0700 |
---|---|---|
committer | Josh Blum | 2010-05-04 13:15:57 -0700 |
commit | b6f86944737975efde1275144c1c344e4a633146 (patch) | |
tree | 6287b1cd117425a34d9499bc69c706bd0fdc971b /usrp2 | |
parent | 1e4bf239c1f09a0180585de62746922bcd34b639 (diff) | |
parent | e22224454f63be561fa2a5923d35b65ba403b6ac (diff) | |
download | gnuradio-b6f86944737975efde1275144c1c344e4a633146.tar.gz gnuradio-b6f86944737975efde1275144c1c344e4a633146.tar.bz2 gnuradio-b6f86944737975efde1275144c1c344e4a633146.zip |
Merge branch 'master' of http://gnuradio.org/git/gnuradio into uhd
Diffstat (limited to 'usrp2')
-rw-r--r-- | usrp2/firmware/lib/adf4350.c | 4 | ||||
-rw-r--r-- | usrp2/firmware/lib/db_wbxng.c | 14 | ||||
-rw-r--r-- | usrp2/host/apps/tx_samples.cc | 4 | ||||
-rw-r--r-- | usrp2/host/lib/usrp2_impl.cc | 2 | ||||
-rw-r--r-- | usrp2/host/usrp2.pc.in | 2 |
5 files changed, 19 insertions, 7 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; } diff --git a/usrp2/host/apps/tx_samples.cc b/usrp2/host/apps/tx_samples.cc index 5c3728fb1..3e41bbf8d 100644 --- a/usrp2/host/apps/tx_samples.cc +++ b/usrp2/host/apps/tx_samples.cc @@ -150,6 +150,10 @@ main(int argc, char **argv) interp = strtol(optarg, 0, 0); break; + case 'g': + gain = strtod(optarg, 0); + break; + case 'S': if (!strtod_si(optarg, &tmp)){ std::cerr << "invalid number: " << optarg << std::endl; diff --git a/usrp2/host/lib/usrp2_impl.cc b/usrp2/host/lib/usrp2_impl.cc index 5592c76ea..333e2d1e7 100644 --- a/usrp2/host/lib/usrp2_impl.cc +++ b/usrp2/host/lib/usrp2_impl.cc @@ -25,6 +25,7 @@ #include <usrp2/copiers.h> #include <gruel/inet.h> #include <gruel/realtime.h> +#include <boost/bind.hpp> #include <usrp2_types.h> #include "usrp2_impl.h" #include "eth_buffer.h" @@ -840,6 +841,7 @@ namespace usrp2 { success = transmit_cmd_and_wait(&cmd, sizeof(cmd), &p, DEF_CMD_TIMEOUT); success = success && (ntohx(reply.ok) == 1); d_channel_rings[channel].reset(); + d_rx_seqno = -1; //fprintf(stderr, "usrp2::stop_rx_streaming: success = %d\n", success); return success; } diff --git a/usrp2/host/usrp2.pc.in b/usrp2/host/usrp2.pc.in index eaef5f41d..e0c2b1986 100644 --- a/usrp2/host/usrp2.pc.in +++ b/usrp2/host/usrp2.pc.in @@ -5,7 +5,7 @@ includedir=@includedir@ Name: usrp2 Description: Universal Software Radio Peripheral 2 -Requires: gnuradio-omnithread gruel +Requires: gruel Version: @VERSION@ Libs: -L${libdir} -lusrp2 Cflags: -I${includedir} @DEFINES@ |