From ed6fc0788832aecd9379e833dd8dee4413b71b38 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Mon, 5 Nov 2012 11:45:07 -0800 Subject: wbx v4: fixing the drivers for the new rev of the WBX board --- host/lib/ic_reg_maps/gen_adf4351_regs.py | 20 +++--------- host/lib/usrp/dboard/db_wbx_version4.cpp | 53 ++++++++++++++++++++++---------- 2 files changed, 41 insertions(+), 32 deletions(-) (limited to 'host') diff --git a/host/lib/ic_reg_maps/gen_adf4351_regs.py b/host/lib/ic_reg_maps/gen_adf4351_regs.py index 607b2979d..4b0ef788c 100755 --- a/host/lib/ic_reg_maps/gen_adf4351_regs.py +++ b/host/lib/ic_reg_maps/gen_adf4351_regs.py @@ -57,7 +57,7 @@ low_noise_and_spur 2[29:30] 3 low_noise, reserved0, reserved1, low ## address 3 ######################################################################## clock_divider_12_bit 3[3:14] 0 -clock_div_mode 3[15:16] 0 clock_divider_off, fast_lock, resync_enable, reserved +clock_div_mode 3[15:16] 1 clock_divider_off, fast_lock, resync_enable, reserved ##reserved 3[17] 0 cycle_slip_reduction 3[18] 0 disabled, enabled ##reserved 3[19:20] 0 @@ -76,7 +76,7 @@ aux_output_select 4[9] 1 divided, fundamental mute_till_lock_detect 4[10] 0 mute_disabled, mute_enabled vco_power_down 4[11] 0 vco_powered_up, vco_powered_down band_select_clock_div 4[12:19] 0 -rf_divider_select 4[20:22] 5 div1, div2, div4, div8, div16, div32, div64 +rf_divider_select 4[20:22] 0 div1, div2, div4, div8, div16, div32, div64 feedback_select 4[23] 1 divided, fundamental ##reserved 4[24:31] 0 ######################################################################## @@ -103,9 +103,9 @@ enum addr_t{ }; boost::uint32_t get_reg(boost::uint8_t addr){ - boost::uint32_t reg = 0; + boost::uint32_t reg = addr & 0x7; switch(addr){ - #for $addr in sorted(set(map(lambda r: r.get_addr(), $regs))) + #for $addr in range(5+1) case $addr: #for $reg in filter(lambda r: r.get_addr() == addr, $regs) reg |= (boost::uint32_t($reg.get_name()) & $reg.get_mask()) << $reg.get_shift(); @@ -115,18 +115,6 @@ boost::uint32_t get_reg(boost::uint8_t addr){ } return reg; } - -void set_reg(boost::uint8_t addr, boost::uint32_t reg){ - switch(addr){ - #for $addr in sorted(set(map(lambda r: r.get_addr(), $regs))) - case $addr: - #for $reg in filter(lambda r: r.get_addr() == addr, $regs) - $reg.get_name() = $(reg.get_type())((reg >> $reg.get_shift()) & $reg.get_mask()); - #end for - break; - #end for - } -} """ if __name__ == '__main__': diff --git a/host/lib/usrp/dboard/db_wbx_version4.cpp b/host/lib/usrp/dboard/db_wbx_version4.cpp index 3a85826cd..c1de2af56 100644 --- a/host/lib/usrp/dboard/db_wbx_version4.cpp +++ b/host/lib/usrp/dboard/db_wbx_version4.cpp @@ -115,22 +115,43 @@ wbx_base::wbx_version4::wbx_version4(wbx_base *_self_wbx_base) { int v4_tx_mod = ADF4351_PDBRF; //set the gpio directions and atr controls - self_base->get_iface()->set_pin_ctrl(dboard_iface::UNIT_TX, v4_tx_mod|v4_iobits); - self_base->get_iface()->set_pin_ctrl(dboard_iface::UNIT_RX, RXBB_PDB|ADF4351_PDBRF); - self_base->get_iface()->set_gpio_ddr(dboard_iface::UNIT_TX, TX_PUP_5V|TX_PUP_3V|v4_tx_mod|v4_iobits); - self_base->get_iface()->set_gpio_ddr(dboard_iface::UNIT_RX, RX_PUP_5V|RX_PUP_3V|ADF4351_CE|RXBB_PDB|ADF4351_PDBRF|RX_ATTN_MASK); - - //setup ATR for the mixer enables (always enabled to prevent phase slip between bursts) - //set TX gain iobits to min gain (max attenuation) when RX_ONLY or IDLE to suppress LO leakage - self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, dboard_iface::ATR_REG_IDLE, v4_tx_mod, TX_ATTN_MASK | TX_MIXER_DIS | v4_tx_mod); - self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, dboard_iface::ATR_REG_RX_ONLY, v4_tx_mod, TX_ATTN_MASK | TX_MIXER_DIS | v4_tx_mod); - self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, dboard_iface::ATR_REG_TX_ONLY, v4_tx_mod, TX_ATTN_MASK | TX_MIXER_DIS | v4_tx_mod); - self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, dboard_iface::ATR_REG_FULL_DUPLEX, v4_tx_mod, TX_ATTN_MASK | TX_MIXER_DIS | v4_tx_mod); - - self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, dboard_iface::ATR_REG_IDLE, RX_MIXER_ENB, RX_MIXER_DIS | RX_MIXER_ENB); - self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, dboard_iface::ATR_REG_TX_ONLY, RX_MIXER_ENB, RX_MIXER_DIS | RX_MIXER_ENB); - self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, dboard_iface::ATR_REG_RX_ONLY, RX_MIXER_ENB, RX_MIXER_DIS | RX_MIXER_ENB); - self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, dboard_iface::ATR_REG_FULL_DUPLEX, RX_MIXER_ENB, RX_MIXER_DIS | RX_MIXER_ENB); + self_base->get_iface()->set_pin_ctrl(dboard_iface::UNIT_TX, \ + v4_tx_mod|v4_iobits); + self_base->get_iface()->set_pin_ctrl(dboard_iface::UNIT_RX, \ + RXBB_PDB|ADF4351_PDBRF); + self_base->get_iface()->set_gpio_ddr(dboard_iface::UNIT_TX, \ + TX_PUP_5V|TX_PUP_3V|v4_tx_mod|v4_iobits); + self_base->get_iface()->set_gpio_ddr(dboard_iface::UNIT_RX, \ + RX_PUP_5V|RX_PUP_3V|ADF4351_CE|RXBB_PDB|ADF4351_PDBRF|RX_ATTN_MASK); + + //setup ATR for the mixer enables (always enabled to prevent phase slip + //between bursts) set TX gain iobits to min gain (max attenuation) when + //RX_ONLY or IDLE to suppress LO leakage + self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, \ + dboard_iface::ATR_REG_IDLE, v4_tx_mod, \ + TX_ATTN_MASK | TX_MIXER_DIS | v4_tx_mod); + self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, \ + dboard_iface::ATR_REG_RX_ONLY, v4_tx_mod, \ + TX_ATTN_MASK | TX_MIXER_DIS | v4_tx_mod); + self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, \ + dboard_iface::ATR_REG_TX_ONLY, v4_tx_mod, \ + TX_ATTN_MASK | TX_MIXER_DIS | v4_tx_mod); + self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, \ + dboard_iface::ATR_REG_FULL_DUPLEX, v4_tx_mod, \ + TX_ATTN_MASK | TX_MIXER_DIS | v4_tx_mod); + + self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, \ + dboard_iface::ATR_REG_IDLE, \ + RX_MIXER_ENB, RX_MIXER_DIS | RX_MIXER_ENB); + self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, \ + dboard_iface::ATR_REG_TX_ONLY, \ + RX_MIXER_ENB, RX_MIXER_DIS | RX_MIXER_ENB); + self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, \ + dboard_iface::ATR_REG_RX_ONLY, \ + RX_MIXER_ENB, RX_MIXER_DIS | RX_MIXER_ENB); + self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, \ + dboard_iface::ATR_REG_FULL_DUPLEX, \ + RX_MIXER_ENB, RX_MIXER_DIS | RX_MIXER_ENB); } wbx_base::wbx_version4::~wbx_version4(void){ -- cgit v1.2.3 From 5d0a0631cad9cd16c14e6c5209ab0ce3bf9c53e4 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Mon, 5 Nov 2012 12:48:33 -0800 Subject: wbx: updating the code to allow full range of the VCO. --- host/lib/usrp/dboard/db_wbx_version4.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'host') diff --git a/host/lib/usrp/dboard/db_wbx_version4.cpp b/host/lib/usrp/dboard/db_wbx_version4.cpp index c1de2af56..2fc3416ee 100644 --- a/host/lib/usrp/dboard/db_wbx_version4.cpp +++ b/host/lib/usrp/dboard/db_wbx_version4.cpp @@ -41,7 +41,7 @@ static const uhd::dict wbx_v4_tx_gain_ranges = map_li ("PGA0", gain_range_t(0, 31, 1.0)) ; -static const freq_range_t wbx_v4_freq_range(50.0e6, 2.2e9); +static const freq_range_t wbx_v4_freq_range(35.0e6, 2.2e9); /*********************************************************************** -- cgit v1.2.3 From a3f18afa672d4f14b8982e5666de920e9bc08f7e Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 9 Nov 2012 16:16:18 -0800 Subject: uhd: make stream cmd enums easier on SWIG --- host/include/uhd/types/stream_cmd.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'host') diff --git a/host/include/uhd/types/stream_cmd.hpp b/host/include/uhd/types/stream_cmd.hpp index 41708e2e2..3c34c9656 100644 --- a/host/include/uhd/types/stream_cmd.hpp +++ b/host/include/uhd/types/stream_cmd.hpp @@ -1,5 +1,5 @@ // -// Copyright 2010 Ettus Research LLC +// Copyright 2010-2012 Ettus Research LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -46,10 +46,10 @@ namespace uhd{ struct UHD_API stream_cmd_t{ enum stream_mode_t { - STREAM_MODE_START_CONTINUOUS = 'a', - STREAM_MODE_STOP_CONTINUOUS = 'o', - STREAM_MODE_NUM_SAMPS_AND_DONE = 'd', - STREAM_MODE_NUM_SAMPS_AND_MORE = 'm' + STREAM_MODE_START_CONTINUOUS = int('a'), + STREAM_MODE_STOP_CONTINUOUS = int('o'), + STREAM_MODE_NUM_SAMPS_AND_DONE = int('d'), + STREAM_MODE_NUM_SAMPS_AND_MORE = int('m') } stream_mode; size_t num_samps; -- cgit v1.2.3