summaryrefslogtreecommitdiffstats
path: root/sdr_lib
diff options
context:
space:
mode:
authorjcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5>2009-04-04 05:59:44 +0000
committerjcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5>2009-04-04 05:59:44 +0000
commitc29931c19091ccd7f0473ae6f955a268208f9033 (patch)
tree77a01ea2e48846635f51069e73527db11632480f /sdr_lib
parent2578e827f5e3f7436ac4904edceb19e1b53e1b45 (diff)
downloaduhd-c29931c19091ccd7f0473ae6f955a268208f9033.tar.gz
uhd-c29931c19091ccd7f0473ae6f955a268208f9033.tar.bz2
uhd-c29931c19091ccd7f0473ae6f955a268208f9033.zip
Merged r10712:10765 from jcorgan/gpio into trunk. Adds out-of-band and streaming GPIO functions for USRP2.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10766 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'sdr_lib')
-rw-r--r--sdr_lib/dsp_core_rx.v23
1 files changed, 22 insertions, 1 deletions
diff --git a/sdr_lib/dsp_core_rx.v b/sdr_lib/dsp_core_rx.v
index 716182f65..ee713e4ac 100644
--- a/sdr_lib/dsp_core_rx.v
+++ b/sdr_lib/dsp_core_rx.v
@@ -7,6 +7,8 @@ module dsp_core_rx
input [13:0] adc_a, input adc_ovf_a,
input [13:0] adc_b, input adc_ovf_b,
+ input [15:0] io_rx,
+
output [31:0] sample,
input run,
output strobe,
@@ -56,6 +58,11 @@ module dsp_core_rx
(.clk(clk),.rst(rst),.strobe(set_stb),.addr(set_addr),
.in(set_data),.out(muxctrl),.changed());
+ wire [1:0] gpio_ena;
+ setting_reg #(.my_addr(`DSP_CORE_RX_BASE+9)) sr_9
+ (.clk(clk),.rst(rst),.strobe(set_stb),.addr(set_addr),
+ .in(set_data),.out(gpio_ena),.changed());
+
// The TVRX connects to what is called adc_b, thus A and B are
// swapped throughout the design.
//
@@ -151,7 +158,21 @@ module dsp_core_rx
round #(.bits_in(18),.bits_out(16)) round_iout (.in(i_hb2),.out(i_out));
round #(.bits_in(18),.bits_out(16)) round_qout (.in(q_hb2),.out(q_out));
- assign sample = {i_out,q_out};
+ // Streaming GPIO
+ //
+ // io_rx[15] => I channel LSB if gpio_ena[0] high
+ // io_rx[14] => Q channel LSB if gpio_ena[1] high
+
+ reg [31:0] sample_reg;
+ always @(posedge clk)
+ begin
+ sample_reg[31:17] <= i_out[15:1];
+ sample_reg[15:1] <= q_out[15:1];
+ sample_reg[16] <= gpio_ena[0] ? io_rx[15] : i_out[0];
+ sample_reg[0] <= gpio_ena[1] ? io_rx[14] : q_out[0];
+ end
+
+ assign sample = sample_reg;
assign strobe = strobe_hb2;
assign debug = {enable_hb1, enable_hb2, run, strobe, strobe_cic, strobe_cic_d1, strobe_hb1, strobe_hb2};