From f15df8146cffb6cf42e0365396484af085be5df4 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 31 Mar 2010 18:55:48 -0700 Subject: Moved dsp (rx and tx), time config, and clock config (mostly) into the host. --- host/lib/usrp/usrp2/dsp_impl.cpp | 56 +++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 26 deletions(-) (limited to 'host/lib/usrp/usrp2/dsp_impl.cpp') diff --git a/host/lib/usrp/usrp2/dsp_impl.cpp b/host/lib/usrp/usrp2/dsp_impl.cpp index 0d43fac0e..6edfec61a 100644 --- a/host/lib/usrp/usrp2/dsp_impl.cpp +++ b/host/lib/usrp/usrp2/dsp_impl.cpp @@ -15,11 +15,13 @@ // along with this program. If not, see . // +#include "usrp2_impl.hpp" +#include "usrp2_regs.hpp" #include #include #include #include -#include "usrp2_impl.hpp" +#include using namespace uhd; @@ -64,25 +66,25 @@ void usrp2_impl::init_ddc_config(void){ update_ddc_config(); //initial command that kills streaming (in case if was left on) - //issue_ddc_stream_cmd(TODO) + stream_cmd_t stream_cmd_off; + stream_cmd_off.stream_now = true; + stream_cmd_off.continuous = false; + stream_cmd_off.num_samps = 0; + issue_ddc_stream_cmd(stream_cmd_off); } void usrp2_impl::update_ddc_config(void){ - //setup the out data - usrp2_ctrl_data_t out_data; - out_data.id = htonl(USRP2_CTRL_ID_SETUP_THIS_DDC_FOR_ME_BRO); - out_data.data.ddc_args.freq_word = htonl( - calculate_freq_word_and_update_actual_freq(_ddc_freq, get_master_clock_freq()) + //set the decimation + this->poke( + offsetof(dsp_rx_regs_t, decim_rate) + DSP_RX_BASE, _ddc_decim ); - out_data.data.ddc_args.decim = htonl(_ddc_decim); + + //set the scaling static const boost::int16_t default_rx_scale_iq = 1024; - out_data.data.ddc_args.scale_iq = htonl( + this->poke( + offsetof(dsp_rx_regs_t, scale_iq) + DSP_RX_BASE, calculate_iq_scale_word(default_rx_scale_iq, default_rx_scale_iq) ); - - //send and recv - usrp2_ctrl_data_t in_data = ctrl_send_and_recv(out_data); - ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_TOTALLY_SETUP_THE_DDC_DUDE); } void usrp2_impl::issue_ddc_stream_cmd(const stream_cmd_t &stream_cmd){ @@ -172,7 +174,10 @@ void usrp2_impl::ddc_set(const wax::obj &key, const wax::obj &val){ ASSERT_THROW(new_freq <= get_master_clock_freq()/2.0); ASSERT_THROW(new_freq >= -get_master_clock_freq()/2.0); _ddc_freq = new_freq; //shadow - update_ddc_config(); + this->poke( //set the cordic + offsetof(dsp_rx_regs_t, freq) + DSP_RX_BASE, + calculate_freq_word_and_update_actual_freq(_ddc_freq, get_master_clock_freq()) + ); return; } else if (key_name == "stream_cmd"){ @@ -210,20 +215,16 @@ void usrp2_impl::update_duc_config(void){ double interp_cubed = std::pow(double(tmp_interp), 3); boost::int16_t scale = rint((4096*std::pow(2, ceil(log2(interp_cubed))))/(1.65*interp_cubed)); - //setup the out data - usrp2_ctrl_data_t out_data; - out_data.id = htonl(USRP2_CTRL_ID_SETUP_THIS_DUC_FOR_ME_BRO); - out_data.data.duc_args.freq_word = htonl( - calculate_freq_word_and_update_actual_freq(_duc_freq, get_master_clock_freq()) + //set the interpolation + this->poke( + offsetof(dsp_tx_regs_t, interp_rate) + DSP_TX_BASE, _ddc_decim ); - out_data.data.duc_args.interp = htonl(_duc_interp); - out_data.data.duc_args.scale_iq = htonl( + + //set the scaling + this->poke( + offsetof(dsp_tx_regs_t, scale_iq) + DSP_TX_BASE, calculate_iq_scale_word(scale, scale) ); - - //send and recv - usrp2_ctrl_data_t in_data = ctrl_send_and_recv(out_data); - ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_TOTALLY_SETUP_THE_DUC_DUDE); } /*********************************************************************** @@ -297,7 +298,10 @@ void usrp2_impl::duc_set(const wax::obj &key, const wax::obj &val){ ASSERT_THROW(new_freq <= get_master_clock_freq()/2.0); ASSERT_THROW(new_freq >= -get_master_clock_freq()/2.0); _duc_freq = new_freq; //shadow - update_duc_config(); + this->poke( //set the cordic + offsetof(dsp_tx_regs_t, freq) + DSP_TX_BASE, + calculate_freq_word_and_update_actual_freq(_duc_freq, get_master_clock_freq()) + ); return; } -- cgit v1.2.3 From 792fad3afca0eb45fdc3eb27b5d1678c507d4724 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 1 Apr 2010 13:30:34 -0700 Subject: use defined constants for the register addresses --- host/lib/usrp/usrp2/dboard_impl.cpp | 5 +- host/lib/usrp/usrp2/dboard_interface.cpp | 15 ++--- host/lib/usrp/usrp2/dsp_impl.cpp | 23 ++----- host/lib/usrp/usrp2/mboard_impl.cpp | 19 +++--- host/lib/usrp/usrp2/usrp2_regs.hpp | 112 ++++++++++++------------------- 5 files changed, 67 insertions(+), 107 deletions(-) (limited to 'host/lib/usrp/usrp2/dsp_impl.cpp') diff --git a/host/lib/usrp/usrp2/dboard_impl.cpp b/host/lib/usrp/usrp2/dboard_impl.cpp index 86ee52594..29fb32eeb 100644 --- a/host/lib/usrp/usrp2/dboard_impl.cpp +++ b/host/lib/usrp/usrp2/dboard_impl.cpp @@ -20,7 +20,6 @@ #include "usrp2_regs.hpp" #include #include -#include using namespace uhd; using namespace uhd::usrp; @@ -80,7 +79,7 @@ void usrp2_impl::update_rx_mux_config(void){ rx_mux = (((rx_mux >> 0) & 0x3) << 2) | (((rx_mux >> 2) & 0x3) << 0); } - this->poke(offsetof(dsp_rx_regs_t, rx_mux) + DSP_RX_BASE, rx_mux); + this->poke(FR_DSP_RX_MUX, rx_mux); } void usrp2_impl::update_tx_mux_config(void){ @@ -93,7 +92,7 @@ void usrp2_impl::update_tx_mux_config(void){ tx_mux = (((tx_mux >> 0) & 0x1) << 1) | (((tx_mux >> 1) & 0x1) << 0); } - this->poke(offsetof(dsp_tx_regs_t, tx_mux) + DSP_TX_BASE, tx_mux); + this->poke(FR_DSP_TX_MUX, tx_mux); } /*********************************************************************** diff --git a/host/lib/usrp/usrp2/dboard_interface.cpp b/host/lib/usrp/usrp2/dboard_interface.cpp index f5fe68152..4160ad467 100644 --- a/host/lib/usrp/usrp2/dboard_interface.cpp +++ b/host/lib/usrp/usrp2/dboard_interface.cpp @@ -21,7 +21,6 @@ #include #include #include -#include using namespace uhd::usrp; @@ -103,22 +102,22 @@ void usrp2_dboard_interface::set_gpio_ddr(gpio_bank_t bank, boost::uint16_t valu | (boost::uint32_t(value) << shift); //or'ed in the new bits //poke in the value and shadow - _impl->poke(offsetof(gpio_regs_t, ddr) + 0xC800, new_ddr_val); + _impl->poke(FR_GPIO_DDR, new_ddr_val); _ddr_shadow = new_ddr_val; } boost::uint16_t usrp2_dboard_interface::read_gpio(gpio_bank_t bank){ - boost::uint32_t data = _impl->peek(offsetof(gpio_regs_t, io) + 0xC800); + boost::uint32_t data = _impl->peek(FR_GPIO_IO); return boost::uint16_t(data >> bank_to_shift(bank)); } void usrp2_dboard_interface::set_atr_reg(gpio_bank_t bank, atr_reg_t reg, boost::uint16_t value){ //map the atr reg to an offset in register space - static const uhd::dict reg_to_offset = boost::assign::map_list_of - (ATR_REG_IDLE, ATR_IDLE) (ATR_REG_TXONLY, ATR_TX) - (ATR_REG_RXONLY, ATR_RX) (ATR_REG_BOTH, ATR_FULL) + static const uhd::dict reg_to_addr = boost::assign::map_list_of + (ATR_REG_IDLE, FR_ATR_IDLE) (ATR_REG_TXONLY, FR_ATR_TX) + (ATR_REG_RXONLY, FR_ATR_RX) (ATR_REG_BOTH, FR_ATR_FULL) ; - int offset = reg_to_offset[reg]; + ASSERT_THROW(reg_to_addr.has_key(reg)); //ensure a value exists in the shadow if (not _atr_reg_shadows.has_key(reg)) _atr_reg_shadows[reg] = 0; @@ -130,7 +129,7 @@ void usrp2_dboard_interface::set_atr_reg(gpio_bank_t bank, atr_reg_t reg, boost: | (boost::uint32_t(value) << shift); //or'ed in the new bits //poke in the value and shadow - _impl->poke(offsetof(atr_regs_t, v) + 0xE400 + offset, new_atr_val); + _impl->poke(reg_to_addr[reg], new_atr_val); _atr_reg_shadows[reg] = new_atr_val; } diff --git a/host/lib/usrp/usrp2/dsp_impl.cpp b/host/lib/usrp/usrp2/dsp_impl.cpp index 6edfec61a..d50c1ad56 100644 --- a/host/lib/usrp/usrp2/dsp_impl.cpp +++ b/host/lib/usrp/usrp2/dsp_impl.cpp @@ -21,7 +21,6 @@ #include #include #include -#include using namespace uhd; @@ -75,14 +74,11 @@ void usrp2_impl::init_ddc_config(void){ void usrp2_impl::update_ddc_config(void){ //set the decimation - this->poke( - offsetof(dsp_rx_regs_t, decim_rate) + DSP_RX_BASE, _ddc_decim - ); + this->poke(FR_DSP_RX_DECIM_RATE, _ddc_decim); //set the scaling static const boost::int16_t default_rx_scale_iq = 1024; - this->poke( - offsetof(dsp_rx_regs_t, scale_iq) + DSP_RX_BASE, + this->poke(FR_DSP_RX_SCALE_IQ, calculate_iq_scale_word(default_rx_scale_iq, default_rx_scale_iq) ); } @@ -174,8 +170,7 @@ void usrp2_impl::ddc_set(const wax::obj &key, const wax::obj &val){ ASSERT_THROW(new_freq <= get_master_clock_freq()/2.0); ASSERT_THROW(new_freq >= -get_master_clock_freq()/2.0); _ddc_freq = new_freq; //shadow - this->poke( //set the cordic - offsetof(dsp_rx_regs_t, freq) + DSP_RX_BASE, + this->poke(FR_DSP_RX_FREQ, calculate_freq_word_and_update_actual_freq(_ddc_freq, get_master_clock_freq()) ); return; @@ -216,15 +211,10 @@ void usrp2_impl::update_duc_config(void){ boost::int16_t scale = rint((4096*std::pow(2, ceil(log2(interp_cubed))))/(1.65*interp_cubed)); //set the interpolation - this->poke( - offsetof(dsp_tx_regs_t, interp_rate) + DSP_TX_BASE, _ddc_decim - ); + this->poke(FR_DSP_TX_INTERP_RATE, _ddc_decim); //set the scaling - this->poke( - offsetof(dsp_tx_regs_t, scale_iq) + DSP_TX_BASE, - calculate_iq_scale_word(scale, scale) - ); + this->poke(FR_DSP_TX_SCALE_IQ, calculate_iq_scale_word(scale, scale)); } /*********************************************************************** @@ -298,8 +288,7 @@ void usrp2_impl::duc_set(const wax::obj &key, const wax::obj &val){ ASSERT_THROW(new_freq <= get_master_clock_freq()/2.0); ASSERT_THROW(new_freq >= -get_master_clock_freq()/2.0); _duc_freq = new_freq; //shadow - this->poke( //set the cordic - offsetof(dsp_tx_regs_t, freq) + DSP_TX_BASE, + this->poke(FR_DSP_TX_FREQ, calculate_freq_word_and_update_actual_freq(_duc_freq, get_master_clock_freq()) ); return; diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp index eff53c5b2..7b658b22d 100644 --- a/host/lib/usrp/usrp2/mboard_impl.cpp +++ b/host/lib/usrp/usrp2/mboard_impl.cpp @@ -20,7 +20,6 @@ #include #include #include -#include using namespace uhd; @@ -53,32 +52,32 @@ void usrp2_impl::update_clock_config(void){ //translate pps source enums switch(_clock_config.pps_source){ - case clock_config_t::PPS_SMA: pps_flags |= PPS_FLAG_SMA; break; - case clock_config_t::PPS_MIMO: pps_flags |= PPS_FLAG_MIMO; break; + case clock_config_t::PPS_SMA: pps_flags |= FRF_TIME64_PPS_SMA; break; + case clock_config_t::PPS_MIMO: pps_flags |= FRF_TIME64_PPS_MIMO; break; default: throw std::runtime_error("usrp2: unhandled clock configuration pps source"); } //translate pps polarity enums switch(_clock_config.pps_polarity){ - case clock_config_t::PPS_POS: pps_flags |= PPS_FLAG_POSEDGE; break; - case clock_config_t::PPS_NEG: pps_flags |= PPS_FLAG_NEGEDGE; break; + case clock_config_t::PPS_POS: pps_flags |= FRF_TIME64_PPS_POSEDGE; break; + case clock_config_t::PPS_NEG: pps_flags |= FRF_TIME64_PPS_NEGEDGE; break; default: throw std::runtime_error("usrp2: unhandled clock configuration pps polarity"); } //set the pps flags - this->poke(offsetof(sr_time64_t, flags) + TIME64_BASE, pps_flags); + this->poke(FR_TIME64_FLAGS, pps_flags); //TODO clock source ref 10mhz (spi ad9510) } void usrp2_impl::set_time_spec(const time_spec_t &time_spec, bool now){ //set ticks and seconds - this->poke(offsetof(sr_time64_t, secs) + TIME64_BASE, time_spec.secs); - this->poke(offsetof(sr_time64_t, ticks) + TIME64_BASE, time_spec.ticks); + this->poke(FR_TIME64_SECS, time_spec.secs); + this->poke(FR_TIME64_TICKS, time_spec.ticks); //set the register to latch it all in - boost::uint32_t imm_flags = (now)? TIME64_LATCH_NOW : TIME64_LATCH_NEXT_PPS; - this->poke(offsetof(sr_time64_t, imm) + TIME64_BASE, imm_flags); + boost::uint32_t imm_flags = (now)? FRF_TIME64_LATCH_NOW : FRF_TIME64_LATCH_NEXT_PPS; + this->poke(FR_TIME64_IMM, imm_flags); } /*********************************************************************** diff --git a/host/lib/usrp/usrp2/usrp2_regs.hpp b/host/lib/usrp/usrp2/usrp2_regs.hpp index b7fd239a6..10545d712 100644 --- a/host/lib/usrp/usrp2/usrp2_regs.hpp +++ b/host/lib/usrp/usrp2/usrp2_regs.hpp @@ -28,10 +28,10 @@ #define MISC_OUTPUT_BASE 0xD400 -#define TX_PROTOCOL_ENGINE_BASE 0xD480 -#define RX_PROTOCOL_ENGINE_BASE 0xD4C0 -#define BUFFER_POOL_CTRL_BASE 0xD500 -#define LAST_SETTING_REG 0xD7FC // last valid setting register +//#define TX_PROTOCOL_ENGINE_BASE 0xD480 +//#define RX_PROTOCOL_ENGINE_BASE 0xD4C0 +//#define BUFFER_POOL_CTRL_BASE 0xD500 +//#define LAST_SETTING_REG 0xD7FC // last valid setting register #define SR_MISC 0 #define SR_TX_PROT_ENG 32 @@ -46,7 +46,7 @@ #define SR_SIMTIMER 198 #define SR_LAST 255 -#define _SR_ADDR(sr) (MISC_OUTPUT_BASE + (sr) * sizeof(uint32_t)) +#define _SR_ADDR(sr) (MISC_OUTPUT_BASE + (sr) * sizeof(boost::uint32_t)) ///////////////////////////////////////////////// // SPI Slave Constants @@ -64,9 +64,6 @@ ///////////////////////////////////////////////// // VITA49 64 bit time (write only) //////////////////////////////////////////////// - -#define TIME64_BASE _SR_ADDR(SR_TIME64) - /*! * \brief Time 64 flags * @@ -83,34 +80,27 @@ * * */ -typedef struct { - boost::uint32_t secs; // value to set absolute secs to on next PPS - boost::uint32_t ticks; // value to set absolute ticks to on next PPS - boost::uint32_t flags; // flags - see chart above - boost::uint32_t imm; // set immediate (0=latch on next pps, 1=latch immediate, default=0) -} sr_time64_t; +#define FR_TIME64_SECS _SR_ADDR(SR_TIME64 + 0) // value to set absolute secs to on next PPS +#define FR_TIME64_TICKS _SR_ADDR(SR_TIME64 + 1) // value to set absolute ticks to on next PPS +#define FR_TIME64_FLAGS _SR_ADDR(SR_TIME64 + 2) // flags - see chart above +#define FR_TIME64_IMM _SR_ADDR(SR_TIME64 + 3) // set immediate (0=latch on next pps, 1=latch immediate, default=0) //pps flags (see above) -#define PPS_FLAG_NEGEDGE (0 << 0) -#define PPS_FLAG_POSEDGE (1 << 0) -#define PPS_FLAG_SMA (0 << 1) -#define PPS_FLAG_MIMO (1 << 1) +#define FRF_TIME64_PPS_NEGEDGE (0 << 0) +#define FRF_TIME64_PPS_POSEDGE (1 << 0) +#define FRF_TIME64_PPS_SMA (0 << 1) +#define FRF_TIME64_PPS_MIMO (1 << 1) -#define TIME64_LATCH_NOW 1 -#define TIME64_LATCH_NEXT_PPS 0 +#define FRF_TIME64_LATCH_NOW 1 +#define FRF_TIME64_LATCH_NEXT_PPS 0 ///////////////////////////////////////////////// // DSP TX Regs //////////////////////////////////////////////// +#define FR_DSP_TX_FREQ _SR_ADDR(SR_TX_DSP + 0) +#define FR_DSP_TX_SCALE_IQ _SR_ADDR(SR_TX_DSP + 1) // {scale_i,scale_q} +#define FR_DSP_TX_INTERP_RATE _SR_ADDR(SR_TX_DSP + 2) -#define DSP_TX_BASE _SR_ADDR(SR_TX_DSP) - -typedef struct { - boost::int32_t freq; - boost::uint32_t scale_iq; // {scale_i,scale_q} - boost::uint32_t interp_rate; - boost::uint32_t _padding0; // padding for the tx_mux - // NOT freq, scale, interp /*! * \brief output mux configuration. * @@ -145,24 +135,17 @@ typedef struct { * The default value is 0x10 * */ - boost::uint32_t tx_mux; - -} dsp_tx_regs_t; +#define FR_DSP_TX_MUX _SR_ADDR(SR_TX_DSP + 4) ///////////////////////////////////////////////// // DSP RX Regs //////////////////////////////////////////////// - -#define DSP_RX_BASE _SR_ADDR(SR_RX_DSP) - -typedef struct { - boost::int32_t freq; - boost::uint32_t scale_iq; // {scale_i,scale_q} - boost::uint32_t decim_rate; - boost::uint32_t dcoffset_i; // Bit 31 high sets fixed offset mode, using lower 14 bits, - // otherwise it is automatic - boost::uint32_t dcoffset_q; // Bit 31 high sets fixed offset mode, using lower 14 bits - +#define FR_DSP_RX_FREQ _SR_ADDR(SR_RX_DSP + 0) +#define FR_DSP_RX_SCALE_IQ _SR_ADDR(SR_RX_DSP + 1) // {scale_i,scale_q} +#define FR_DSP_RX_DECIM_RATE _SR_ADDR(SR_RX_DSP + 2) +#define FR_DSP_RX_DCOFFSET_I _SR_ADDR(SR_RX_DSP + 3) // Bit 31 high sets fixed offset mode, using lower 14 bits, + // otherwise it is automatic +#define FR_DSP_RX_DCOFFSET_Q _SR_ADDR(SR_RX_DSP + 4) // Bit 31 high sets fixed offset mode, using lower 14 bits /*! * \brief input mux configuration. * @@ -184,42 +167,33 @@ typedef struct { * The default value is 0x4 * */ - boost::uint32_t rx_mux; // called adc_mux in dsp_core_rx.v - -} dsp_rx_regs_t; +#define FR_DSP_RX_MUX _SR_ADDR(SR_RX_DSP + 5) // called adc_mux in dsp_core_rx.v //////////////////////////////////////////////// // GPIO, Slave 4 +//////////////////////////////////////////////// // // These go to the daughterboard i/o pins - -#define GPIO_BASE 0xC800 - -typedef struct { - boost::uint32_t io; // tx data in high 16, rx in low 16 - boost::uint32_t ddr; // 32 bits, 1 means output. tx in high 16, rx in low 16 - boost::uint32_t tx_sel; // 16 2-bit fields select which source goes to TX DB - boost::uint32_t rx_sel; // 16 2-bit fields select which source goes to RX DB -} gpio_regs_t; +// +#define _FR_GPIO_ADDR(off) (0xC800 + (off) * sizeof(boost::uint32_t)) +#define FR_GPIO_IO _FR_GPIO_ADDR(0) // tx data in high 16, rx in low 16 +#define FR_GPIO_DDR _FR_GPIO_ADDR(1) // 32 bits, 1 means output. tx in high 16, rx in low 16 +#define FR_GPIO_TX_SEL _FR_GPIO_ADDR(2) // 16 2-bit fields select which source goes to TX DB +#define FR_GPIO_RX_SEL _FR_GPIO_ADDR(3) // 16 2-bit fields select which source goes to RX DB // each 2-bit sel field is layed out this way -#define GPIO_SEL_SW 0 // if pin is an output, set by software in the io reg -#define GPIO_SEL_ATR 1 // if pin is an output, set by ATR logic -#define GPIO_SEL_DEBUG_0 2 // if pin is an output, debug lines from FPGA fabric -#define GPIO_SEL_DEBUG_1 3 // if pin is an output, debug lines from FPGA fabric +#define FRF_GPIO_SEL_SW 0 // if pin is an output, set by software in the io reg +#define FRF_GPIO_SEL_ATR 1 // if pin is an output, set by ATR logic +#define FRF_GPIO_SEL_DEBUG_0 2 // if pin is an output, debug lines from FPGA fabric +#define FRF_GPIO_SEL_DEBUG_1 3 // if pin is an output, debug lines from FPGA fabric /////////////////////////////////////////////////// // ATR Controller, Slave 11 - -#define ATR_BASE 0xE400 - -typedef struct { - boost::uint32_t v[16]; -} atr_regs_t; - -#define ATR_IDLE 0x0 // indicies into v -#define ATR_TX 0x1 -#define ATR_RX 0x2 -#define ATR_FULL 0x3 +//////////////////////////////////////////////// +#define _FR_ATR_ADDR(off) (0xE400 + (off) * sizeof(boost::uint32_t)) +#define FR_ATR_IDLE _FR_ATR_ADDR(0) // tx data in high 16, rx in low 16 +#define FR_ATR_TX _FR_ATR_ADDR(1) +#define FR_ATR_RX _FR_ATR_ADDR(2) +#define FR_ATR_FULL _FR_ATR_ADDR(3) #endif /* INCLUDED_USRP2_REGS_HPP */ -- cgit v1.2.3 From 91ef18021c0f0f5fe8ff7705e23b5f1a6b25162f Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 1 Apr 2010 15:08:52 -0700 Subject: moved props into usrp and multiple hpp files --- host/examples/rx_timed_samples.cpp | 1 - host/include/uhd/CMakeLists.txt | 1 - host/include/uhd/props.hpp | 145 ----------------------------- host/include/uhd/usrp/CMakeLists.txt | 10 ++ host/include/uhd/usrp/dboard_interface.hpp | 8 +- host/include/uhd/usrp/dboard_manager.hpp | 2 +- host/include/uhd/usrp/dboard_props.hpp | 38 ++++++++ host/include/uhd/usrp/device_props.hpp | 57 ++++++++++++ host/include/uhd/usrp/dsp_props.hpp | 40 ++++++++ host/include/uhd/usrp/mboard_props.hpp | 50 ++++++++++ host/include/uhd/usrp/subdev_props.hpp | 49 ++++++++++ host/include/uhd/utils/CMakeLists.txt | 1 + host/include/uhd/utils/props.hpp | 48 ++++++++++ host/lib/gain_handler.cpp | 2 +- host/lib/simple_device.cpp | 6 +- host/lib/tune_helper.cpp | 3 +- host/lib/usrp/dboard/db_basic_and_lf.cpp | 2 +- host/lib/usrp/dboard_manager.cpp | 1 + host/lib/usrp/usrp2/dboard_impl.cpp | 2 + host/lib/usrp/usrp2/dboard_interface.cpp | 4 +- host/lib/usrp/usrp2/dsp_impl.cpp | 2 + host/lib/usrp/usrp2/mboard_impl.cpp | 2 + host/lib/usrp/usrp2/usrp2_impl.cpp | 1 + host/test/gain_handler_test.cpp | 2 +- host/utils/uhd_find_devices.cpp | 1 - host/utils/usrp2_burner.cpp | 4 +- 26 files changed, 320 insertions(+), 162 deletions(-) delete mode 100644 host/include/uhd/props.hpp create mode 100644 host/include/uhd/usrp/dboard_props.hpp create mode 100644 host/include/uhd/usrp/device_props.hpp create mode 100644 host/include/uhd/usrp/dsp_props.hpp create mode 100644 host/include/uhd/usrp/mboard_props.hpp create mode 100644 host/include/uhd/usrp/subdev_props.hpp create mode 100644 host/include/uhd/utils/props.hpp (limited to 'host/lib/usrp/usrp2/dsp_impl.cpp') diff --git a/host/examples/rx_timed_samples.cpp b/host/examples/rx_timed_samples.cpp index 88e112584..b3516e686 100644 --- a/host/examples/rx_timed_samples.cpp +++ b/host/examples/rx_timed_samples.cpp @@ -17,7 +17,6 @@ #include #include -#include #include #include #include diff --git a/host/include/uhd/CMakeLists.txt b/host/include/uhd/CMakeLists.txt index b364f78cd..1c5202caa 100644 --- a/host/include/uhd/CMakeLists.txt +++ b/host/include/uhd/CMakeLists.txt @@ -24,7 +24,6 @@ ADD_SUBDIRECTORY(utils) INSTALL(FILES config.hpp device.hpp - props.hpp simple_device.hpp wax.hpp DESTINATION ${INCLUDE_DIR}/uhd diff --git a/host/include/uhd/props.hpp b/host/include/uhd/props.hpp deleted file mode 100644 index 01746f853..000000000 --- a/host/include/uhd/props.hpp +++ /dev/null @@ -1,145 +0,0 @@ -// -// Copyright 2010 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 -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// - -#ifndef INCLUDED_UHD_PROPS_HPP -#define INCLUDED_UHD_PROPS_HPP - -#include -#include -#include -#include -#include - -namespace uhd{ - - //typedef for handling named properties - typedef std::vector prop_names_t; - typedef boost::tuple named_prop_t; - - /*! - * Utility function to separate a named property into its components. - * \param key a reference to the prop object - * \param name a reference to the name object - */ - inline UHD_API named_prop_t //must be exported as part of the api to work (TODO move guts to cpp file) - extract_named_prop(const wax::obj &key, const std::string &name = ""){ - if (key.type() == typeid(named_prop_t)){ - return key.as(); - } - return named_prop_t(key, name); - } - - /*! - * Possible device properties: - * In general, a device will have a single mboard. - * In certain mimo applications, multiple boards - * will be present in the interface for configuration. - */ - enum device_prop_t{ - DEVICE_PROP_NAME, //ro, std::string - DEVICE_PROP_MBOARD, //ro, wax::obj - DEVICE_PROP_MBOARD_NAMES, //ro, prop_names_t - DEVICE_PROP_MAX_RX_SAMPLES, //ro, size_t - DEVICE_PROP_MAX_TX_SAMPLES //ro, size_t - }; - - /*! - * Possible device mboard properties: - * The general mboard properties are listed below. - * Custom properties can be identified with a string - * and discovered though the others property. - */ - enum mboard_prop_t{ - MBOARD_PROP_NAME, //ro, std::string - MBOARD_PROP_OTHERS, //ro, prop_names_t - MBOARD_PROP_CLOCK_RATE, //ro, freq_t - MBOARD_PROP_RX_DSP, //ro, wax::obj - MBOARD_PROP_RX_DSP_NAMES, //ro, prop_names_t - MBOARD_PROP_TX_DSP, //ro, wax::obj - MBOARD_PROP_TX_DSP_NAMES, //ro, prop_names_t - MBOARD_PROP_RX_DBOARD, //ro, wax::obj - MBOARD_PROP_RX_DBOARD_NAMES, //ro, prop_names_t - MBOARD_PROP_TX_DBOARD, //ro, wax::obj - MBOARD_PROP_TX_DBOARD_NAMES, //ro, prop_names_t - MBOARD_PROP_CLOCK_CONFIG, //rw, clock_config_t - MBOARD_PROP_TIME_NOW, //wo, time_spec_t - MBOARD_PROP_TIME_NEXT_PPS //wo, time_spec_t - }; - - /*! - * Possible device dsp properties: - * A dsp can have a wide range of possible properties. - * A ddc would have a properties "decim", "freq", "taps"... - * Other properties could be gains, complex scalars, enables... - * For this reason the only required properties of a dsp is a name - * and a property to get list of other possible properties. - */ - enum dsp_prop_t{ - DSP_PROP_NAME, //ro, std::string - DSP_PROP_OTHERS //ro, prop_names_t - }; - - /*! - * Possible device dboard properties - */ - enum dboard_prop_t{ - DBOARD_PROP_NAME, //ro, std::string - DBOARD_PROP_SUBDEV, //ro, wax::obj - DBOARD_PROP_SUBDEV_NAMES, //ro, prop_names_t - DBOARD_PROP_USED_SUBDEVS //ro, prop_names_t - //DBOARD_PROP_CODEC //ro, wax::obj //----> not sure, dont have to deal with yet - }; - - /*! ------ not dealing with yet, commented out ------------ - * Possible device codec properties: - * A codec is expected to have a rate and gain elements. - * Other properties can be discovered through the others prop. - */ - /*enum codec_prop_t{ - CODEC_PROP_NAME, //ro, std::string - CODEC_PROP_OTHERS, //ro, prop_names_t - CODEC_PROP_GAIN, //rw, gain_t - CODEC_PROP_GAIN_RANGE, //ro, gain_range_t - CODEC_PROP_GAIN_NAMES, //ro, prop_names_t - //CODEC_PROP_CLOCK_RATE //ro, freq_t //----> not sure we care to know - };*/ - - /*! - * Possible device subdev properties - */ - enum subdev_prop_t{ - SUBDEV_PROP_NAME, //ro, std::string - SUBDEV_PROP_OTHERS, //ro, prop_names_t - SUBDEV_PROP_GAIN, //rw, gain_t - SUBDEV_PROP_GAIN_RANGE, //ro, gain_range_t - SUBDEV_PROP_GAIN_NAMES, //ro, prop_names_t - SUBDEV_PROP_FREQ, //rw, freq_t - SUBDEV_PROP_FREQ_RANGE, //ro, freq_range_t - SUBDEV_PROP_ANTENNA, //rw, std::string - SUBDEV_PROP_ANTENNA_NAMES, //ro, prop_names_t - SUBDEV_PROP_ENABLED, //rw, bool - SUBDEV_PROP_QUADRATURE, //ro, bool - SUBDEV_PROP_IQ_SWAPPED, //ro, bool - SUBDEV_PROP_SPECTRUM_INVERTED, //ro, bool - SUBDEV_PROP_LO_INTERFERES //ro, bool - //SUBDEV_PROP_RSSI, //ro, gain_t //----> not on all boards, use named prop - //SUBDEV_PROP_BANDWIDTH //rw, freq_t //----> not on all boards, use named prop - }; - -} //namespace uhd - -#endif /* INCLUDED_UHD_PROPS_HPP */ diff --git a/host/include/uhd/usrp/CMakeLists.txt b/host/include/uhd/usrp/CMakeLists.txt index bab01fdeb..d0f385f13 100644 --- a/host/include/uhd/usrp/CMakeLists.txt +++ b/host/include/uhd/usrp/CMakeLists.txt @@ -17,10 +17,20 @@ INSTALL(FILES + #### props headers ### + dboard_props.hpp + device_props.hpp + dsp_props.hpp + mboard_props.hpp + subdev_props.hpp + + #### dboard headers ### dboard_base.hpp dboard_id.hpp dboard_interface.hpp dboard_manager.hpp + + ### usrp headers ### usrp1e.hpp usrp2.hpp DESTINATION ${INCLUDE_DIR}/uhd/usrp diff --git a/host/include/uhd/usrp/dboard_interface.hpp b/host/include/uhd/usrp/dboard_interface.hpp index 8ff0c5d2f..b3bab131d 100644 --- a/host/include/uhd/usrp/dboard_interface.hpp +++ b/host/include/uhd/usrp/dboard_interface.hpp @@ -62,10 +62,10 @@ public: //possible atr registers enum atr_reg_t{ - ATR_REG_IDLE = 'i', - ATR_REG_TXONLY = 't', - ATR_REG_RXONLY = 'r', - ATR_REG_BOTH = 'b' + ATR_REG_IDLE = 'i', + ATR_REG_TX_ONLY = 't', + ATR_REG_RX_ONLY = 'r', + ATR_REG_FULL_DUPLEX = 'f' }; //structors diff --git a/host/include/uhd/usrp/dboard_manager.hpp b/host/include/uhd/usrp/dboard_manager.hpp index c7c091220..ed8ee73ef 100644 --- a/host/include/uhd/usrp/dboard_manager.hpp +++ b/host/include/uhd/usrp/dboard_manager.hpp @@ -19,7 +19,7 @@ #define INCLUDED_UHD_USRP_DBOARD_MANAGER_HPP #include -#include +#include #include #include #include diff --git a/host/include/uhd/usrp/dboard_props.hpp b/host/include/uhd/usrp/dboard_props.hpp new file mode 100644 index 000000000..08c4eef6a --- /dev/null +++ b/host/include/uhd/usrp/dboard_props.hpp @@ -0,0 +1,38 @@ +// +// Copyright 2010 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 +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +#ifndef INCLUDED_UHD_USRP_DBOARD_PROPS_HPP +#define INCLUDED_UHD_USRP_DBOARD_PROPS_HPP + +#include + +namespace uhd{ namespace usrp{ + + /*! + * Possible device dboard properties + */ + enum dboard_prop_t{ + DBOARD_PROP_NAME, //ro, std::string + DBOARD_PROP_SUBDEV, //ro, wax::obj + DBOARD_PROP_SUBDEV_NAMES, //ro, prop_names_t + DBOARD_PROP_USED_SUBDEVS //ro, prop_names_t + //DBOARD_PROP_CODEC //ro, wax::obj //----> not sure, dont have to deal with yet + }; + +}} //namespace + +#endif /* INCLUDED_UHD_USRP_DBOARD_PROPS_HPP */ diff --git a/host/include/uhd/usrp/device_props.hpp b/host/include/uhd/usrp/device_props.hpp new file mode 100644 index 000000000..dcfa26240 --- /dev/null +++ b/host/include/uhd/usrp/device_props.hpp @@ -0,0 +1,57 @@ +// +// Copyright 2010 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 +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +#ifndef INCLUDED_UHD_USRP_DEVICE_PROPS_HPP +#define INCLUDED_UHD_USRP_DEVICE_PROPS_HPP + +#include + +namespace uhd{ namespace usrp{ + + /*! + * Possible device properties: + * In general, a device will have a single mboard. + * In certain mimo applications, multiple boards + * will be present in the interface for configuration. + */ + enum device_prop_t{ + DEVICE_PROP_NAME, //ro, std::string + DEVICE_PROP_MBOARD, //ro, wax::obj + DEVICE_PROP_MBOARD_NAMES, //ro, prop_names_t + DEVICE_PROP_MAX_RX_SAMPLES, //ro, size_t + DEVICE_PROP_MAX_TX_SAMPLES //ro, size_t + }; + + //////////////////////////////////////////////////////////////////////// + /*! ------ not dealing with yet, commented out ------------ + * Possible device codec properties: + * A codec is expected to have a rate and gain elements. + * Other properties can be discovered through the others prop. + */ + /*enum codec_prop_t{ + CODEC_PROP_NAME, //ro, std::string + CODEC_PROP_OTHERS, //ro, prop_names_t + CODEC_PROP_GAIN, //rw, gain_t + CODEC_PROP_GAIN_RANGE, //ro, gain_range_t + CODEC_PROP_GAIN_NAMES, //ro, prop_names_t + //CODEC_PROP_CLOCK_RATE //ro, freq_t //----> not sure we care to know + };*/ + + +}} //namespace + +#endif /* INCLUDED_UHD_USRP_DEVICE_PROPS_HPP */ diff --git a/host/include/uhd/usrp/dsp_props.hpp b/host/include/uhd/usrp/dsp_props.hpp new file mode 100644 index 000000000..ef3f771df --- /dev/null +++ b/host/include/uhd/usrp/dsp_props.hpp @@ -0,0 +1,40 @@ +// +// Copyright 2010 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 +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +#ifndef INCLUDED_UHD_USRP_DSP_PROPS_HPP +#define INCLUDED_UHD_USRP_DSP_PROPS_HPP + +#include + +namespace uhd{ namespace usrp{ + + /*! + * Possible device dsp properties: + * A dsp can have a wide range of possible properties. + * A ddc would have a properties "decim", "freq", "taps"... + * Other properties could be gains, complex scalars, enables... + * For this reason the only required properties of a dsp is a name + * and a property to get list of other possible properties. + */ + enum dsp_prop_t{ + DSP_PROP_NAME, //ro, std::string + DSP_PROP_OTHERS //ro, prop_names_t + }; + +}} //namespace + +#endif /* INCLUDED_UHD_USRP_DSP_PROPS_HPP */ diff --git a/host/include/uhd/usrp/mboard_props.hpp b/host/include/uhd/usrp/mboard_props.hpp new file mode 100644 index 000000000..ddb95ef0d --- /dev/null +++ b/host/include/uhd/usrp/mboard_props.hpp @@ -0,0 +1,50 @@ +// +// Copyright 2010 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 +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +#ifndef INCLUDED_UHD_USRP_MBOARD_PROPS_HPP +#define INCLUDED_UHD_USRP_MBOARD_PROPS_HPP + +#include + +namespace uhd{ namespace usrp{ + + /*! + * Possible device mboard properties: + * The general mboard properties are listed below. + * Custom properties can be identified with a string + * and discovered though the others property. + */ + enum mboard_prop_t{ + MBOARD_PROP_NAME, //ro, std::string + MBOARD_PROP_OTHERS, //ro, prop_names_t + MBOARD_PROP_CLOCK_RATE, //ro, double + MBOARD_PROP_RX_DSP, //ro, wax::obj + MBOARD_PROP_RX_DSP_NAMES, //ro, prop_names_t + MBOARD_PROP_TX_DSP, //ro, wax::obj + MBOARD_PROP_TX_DSP_NAMES, //ro, prop_names_t + MBOARD_PROP_RX_DBOARD, //ro, wax::obj + MBOARD_PROP_RX_DBOARD_NAMES, //ro, prop_names_t + MBOARD_PROP_TX_DBOARD, //ro, wax::obj + MBOARD_PROP_TX_DBOARD_NAMES, //ro, prop_names_t + MBOARD_PROP_CLOCK_CONFIG, //rw, clock_config_t + MBOARD_PROP_TIME_NOW, //wo, time_spec_t + MBOARD_PROP_TIME_NEXT_PPS //wo, time_spec_t + }; + +}} //namespace + +#endif /* INCLUDED_UHD_USRP_MBOARD_PROPS_HPP */ diff --git a/host/include/uhd/usrp/subdev_props.hpp b/host/include/uhd/usrp/subdev_props.hpp new file mode 100644 index 000000000..667f34f9c --- /dev/null +++ b/host/include/uhd/usrp/subdev_props.hpp @@ -0,0 +1,49 @@ +// +// Copyright 2010 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 +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +#ifndef INCLUDED_UHD_USRP_SUBDEV_PROPS_HPP +#define INCLUDED_UHD_USRP_SUBDEV_PROPS_HPP + +#include + +namespace uhd{ namespace usrp{ + + /*! + * Possible device subdev properties + */ + enum subdev_prop_t{ + SUBDEV_PROP_NAME, //ro, std::string + SUBDEV_PROP_OTHERS, //ro, prop_names_t + SUBDEV_PROP_GAIN, //rw, float + SUBDEV_PROP_GAIN_RANGE, //ro, gain_range_t + SUBDEV_PROP_GAIN_NAMES, //ro, prop_names_t + SUBDEV_PROP_FREQ, //rw, double + SUBDEV_PROP_FREQ_RANGE, //ro, freq_range_t + SUBDEV_PROP_ANTENNA, //rw, std::string + SUBDEV_PROP_ANTENNA_NAMES, //ro, prop_names_t + SUBDEV_PROP_ENABLED, //rw, bool + SUBDEV_PROP_QUADRATURE, //ro, bool + SUBDEV_PROP_IQ_SWAPPED, //ro, bool + SUBDEV_PROP_SPECTRUM_INVERTED, //ro, bool + SUBDEV_PROP_LO_INTERFERES //ro, bool + //SUBDEV_PROP_RSSI, //ro, float //----> not on all boards, use named prop + //SUBDEV_PROP_BANDWIDTH //rw, double //----> not on all boards, use named prop + }; + +}} //namespace + +#endif /* INCLUDED_UHD_USRP_SUBDEV_PROPS_HPP */ diff --git a/host/include/uhd/utils/CMakeLists.txt b/host/include/uhd/utils/CMakeLists.txt index 1b673f44a..2bb72e31d 100644 --- a/host/include/uhd/utils/CMakeLists.txt +++ b/host/include/uhd/utils/CMakeLists.txt @@ -19,6 +19,7 @@ INSTALL(FILES algorithm.hpp assert.hpp gain_handler.hpp + props.hpp safe_main.hpp static.hpp tune_helper.hpp diff --git a/host/include/uhd/utils/props.hpp b/host/include/uhd/utils/props.hpp new file mode 100644 index 000000000..fdbc17d1c --- /dev/null +++ b/host/include/uhd/utils/props.hpp @@ -0,0 +1,48 @@ +// +// Copyright 2010 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 +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +#ifndef INCLUDED_UHD_USRP_PROPS_COMMON_HPP +#define INCLUDED_UHD_USRP_PROPS_COMMON_HPP + +#include +#include +#include +#include +#include + +namespace uhd{ + + //typedef for handling named properties + typedef std::vector prop_names_t; + typedef boost::tuple named_prop_t; + + /*! + * Utility function to separate a named property into its components. + * \param key a reference to the prop object + * \param name a reference to the name object + */ + inline UHD_API named_prop_t //must be exported as part of the api to work (TODO move guts to cpp file) + extract_named_prop(const wax::obj &key, const std::string &name = ""){ + if (key.type() == typeid(named_prop_t)){ + return key.as(); + } + return named_prop_t(key, name); + } + +} //namespace uhd + +#endif /* INCLUDED_UHD_USRP_PROPS_COMMON_HPP */ diff --git a/host/lib/gain_handler.cpp b/host/lib/gain_handler.cpp index daf629f0b..36e2e8ed3 100644 --- a/host/lib/gain_handler.cpp +++ b/host/lib/gain_handler.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/host/lib/simple_device.cpp b/host/lib/simple_device.cpp index 25beb45a9..801516353 100644 --- a/host/lib/simple_device.cpp +++ b/host/lib/simple_device.cpp @@ -18,12 +18,16 @@ #include #include #include -#include +#include +#include +#include +#include #include #include #include using namespace uhd; +using namespace uhd::usrp; /*********************************************************************** * Helper Functions diff --git a/host/lib/tune_helper.cpp b/host/lib/tune_helper.cpp index 1e5c4cd0d..381685578 100644 --- a/host/lib/tune_helper.cpp +++ b/host/lib/tune_helper.cpp @@ -17,10 +17,11 @@ #include #include -#include +#include #include using namespace uhd; +using namespace uhd::usrp; /*********************************************************************** * Tune Helper Function diff --git a/host/lib/usrp/dboard/db_basic_and_lf.cpp b/host/lib/usrp/dboard/db_basic_and_lf.cpp index 977eb3d49..be4e646ed 100644 --- a/host/lib/usrp/dboard/db_basic_and_lf.cpp +++ b/host/lib/usrp/dboard/db_basic_and_lf.cpp @@ -15,7 +15,7 @@ // along with this program. If not, see . // -#include +#include #include #include #include diff --git a/host/lib/usrp/dboard_manager.cpp b/host/lib/usrp/dboard_manager.cpp index 5c063d51d..3a5cf3a35 100644 --- a/host/lib/usrp/dboard_manager.cpp +++ b/host/lib/usrp/dboard_manager.cpp @@ -16,6 +16,7 @@ // #include +#include #include #include #include diff --git a/host/lib/usrp/usrp2/dboard_impl.cpp b/host/lib/usrp/usrp2/dboard_impl.cpp index 29fb32eeb..30883cd50 100644 --- a/host/lib/usrp/usrp2/dboard_impl.cpp +++ b/host/lib/usrp/usrp2/dboard_impl.cpp @@ -18,6 +18,8 @@ #include "usrp2_impl.hpp" #include "usrp2_regs.hpp" +#include +#include #include #include diff --git a/host/lib/usrp/usrp2/dboard_interface.cpp b/host/lib/usrp/usrp2/dboard_interface.cpp index 4160ad467..dcd6453a8 100644 --- a/host/lib/usrp/usrp2/dboard_interface.cpp +++ b/host/lib/usrp/usrp2/dboard_interface.cpp @@ -114,8 +114,8 @@ boost::uint16_t usrp2_dboard_interface::read_gpio(gpio_bank_t bank){ void usrp2_dboard_interface::set_atr_reg(gpio_bank_t bank, atr_reg_t reg, boost::uint16_t value){ //map the atr reg to an offset in register space static const uhd::dict reg_to_addr = boost::assign::map_list_of - (ATR_REG_IDLE, FR_ATR_IDLE) (ATR_REG_TXONLY, FR_ATR_TX) - (ATR_REG_RXONLY, FR_ATR_RX) (ATR_REG_BOTH, FR_ATR_FULL) + (ATR_REG_IDLE, FR_ATR_IDLE) (ATR_REG_TX_ONLY, FR_ATR_TX) + (ATR_REG_RX_ONLY, FR_ATR_RX) (ATR_REG_FULL_DUPLEX, FR_ATR_FULL) ; ASSERT_THROW(reg_to_addr.has_key(reg)); diff --git a/host/lib/usrp/usrp2/dsp_impl.cpp b/host/lib/usrp/usrp2/dsp_impl.cpp index d50c1ad56..d70248682 100644 --- a/host/lib/usrp/usrp2/dsp_impl.cpp +++ b/host/lib/usrp/usrp2/dsp_impl.cpp @@ -17,12 +17,14 @@ #include "usrp2_impl.hpp" #include "usrp2_regs.hpp" +#include #include #include #include #include using namespace uhd; +using namespace uhd::usrp; static const size_t default_decim = 16; static const size_t default_interp = 16; diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp index 7b658b22d..7594c85fa 100644 --- a/host/lib/usrp/usrp2/mboard_impl.cpp +++ b/host/lib/usrp/usrp2/mboard_impl.cpp @@ -17,11 +17,13 @@ #include "usrp2_impl.hpp" #include "usrp2_regs.hpp" +#include #include #include #include using namespace uhd; +using namespace uhd::usrp; /*********************************************************************** * Helper Methods diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp index e89fe8a63..b3a22e175 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.cpp +++ b/host/lib/usrp/usrp2/usrp2_impl.cpp @@ -16,6 +16,7 @@ // #include +#include #include #include #include diff --git a/host/test/gain_handler_test.cpp b/host/test/gain_handler_test.cpp index 76b065ce2..72d26e1c2 100644 --- a/host/test/gain_handler_test.cpp +++ b/host/test/gain_handler_test.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include diff --git a/host/utils/uhd_find_devices.cpp b/host/utils/uhd_find_devices.cpp index b328216d0..6c945cbca 100644 --- a/host/utils/uhd_find_devices.cpp +++ b/host/utils/uhd_find_devices.cpp @@ -17,7 +17,6 @@ #include #include -#include #include #include #include diff --git a/host/utils/usrp2_burner.cpp b/host/utils/usrp2_burner.cpp index b24425316..9c1bf72fe 100644 --- a/host/utils/usrp2_burner.cpp +++ b/host/utils/usrp2_burner.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include #include @@ -56,7 +56,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ //create a usrp2 device uhd::device::sptr u2_dev = uhd::usrp::usrp2::make(device_addr); //FIXME usees the default mboard for now (until the mimo link is supported) - wax::obj u2_mb = (*u2_dev)[uhd::DEVICE_PROP_MBOARD]; + wax::obj u2_mb = (*u2_dev)[uhd::usrp::DEVICE_PROP_MBOARD]; std::cout << std::endl; //fetch and print current settings -- cgit v1.2.3