diff options
-rw-r--r-- | host/include/uhd/usrp/dboard_manager.hpp | 21 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_rfx.cpp | 24 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_wbx.cpp | 3 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_xcvr2450.cpp | 3 | ||||
-rw-r--r-- | host/lib/usrp/dboard_manager.cpp | 13 | ||||
-rw-r--r-- | host/utils/uhd_burn_db_eeprom.cpp | 12 |
6 files changed, 44 insertions, 32 deletions
diff --git a/host/include/uhd/usrp/dboard_manager.hpp b/host/include/uhd/usrp/dboard_manager.hpp index b84fee4e7..e5831d4cf 100644 --- a/host/include/uhd/usrp/dboard_manager.hpp +++ b/host/include/uhd/usrp/dboard_manager.hpp @@ -40,7 +40,7 @@ public: typedef dboard_base::sptr(*dboard_ctor_t)(dboard_base::ctor_args_t); /*! - * Register a dboard into the system. + * Register a rx or tx dboard into the system. * For single subdevice boards, omit subdev_names. * \param dboard_id the dboard id (rx or tx) * \param dboard_ctor the dboard constructor function pointer @@ -48,7 +48,24 @@ public: * \param subdev_names the names of the subdevs on this dboard */ static void register_dboard( - dboard_id_t dboard_id, + const dboard_id_t &dboard_id, + dboard_ctor_t dboard_ctor, + const std::string &name, + const prop_names_t &subdev_names = prop_names_t(1, "") + ); + + /*! + * Register an xcvr dboard into the system. + * For single subdevice boards, omit subdev_names. + * \param rx_dboard_id the rx unit dboard id + * \param tx_dboard_id the tx unit dboard id + * \param dboard_ctor the dboard constructor function pointer + * \param name the canonical name for the dboard represented + * \param subdev_names the names of the subdevs on this dboard + */ + static void register_dboard( + const dboard_id_t &rx_dboard_id, + const dboard_id_t &tx_dboard_id, dboard_ctor_t dboard_ctor, const std::string &name, const prop_names_t &subdev_names = prop_names_t(1, "") diff --git a/host/lib/usrp/dboard/db_rfx.cpp b/host/lib/usrp/dboard/db_rfx.cpp index 2585dfa8d..deb71546d 100644 --- a/host/lib/usrp/dboard/db_rfx.cpp +++ b/host/lib/usrp/dboard/db_rfx.cpp @@ -137,25 +137,21 @@ static dboard_base::sptr make_rfx_flex1200(dboard_base::ctor_args_t args){ return dboard_base::sptr(new rfx_xcvr(args, freq_range_t(1150e6, 1450e6), true, true)); } +static dboard_base::sptr make_rfx_flex2200(dboard_base::ctor_args_t args){ + return dboard_base::sptr(new rfx_xcvr(args, freq_range_t(2000e6, 2400e6), false, false)); +} + static dboard_base::sptr make_rfx_flex2400(dboard_base::ctor_args_t args){ return dboard_base::sptr(new rfx_xcvr(args, freq_range_t(2300e6, 2900e6), false, false)); } UHD_STATIC_BLOCK(reg_rfx_dboards){ - dboard_manager::register_dboard(0x0024, &make_rfx_flex400, "Flex 400 Rx MIMO B"); - dboard_manager::register_dboard(0x0028, &make_rfx_flex400, "Flex 400 Tx MIMO B"); - - dboard_manager::register_dboard(0x0025, &make_rfx_flex900, "Flex 900 Rx MIMO B"); - dboard_manager::register_dboard(0x0029, &make_rfx_flex900, "Flex 900 Tx MIMO B"); - - dboard_manager::register_dboard(0x0034, &make_rfx_flex1800, "Flex 1800 Rx MIMO B"); - dboard_manager::register_dboard(0x0035, &make_rfx_flex1800, "Flex 1800 Tx MIMO B"); - - dboard_manager::register_dboard(0x0026, &make_rfx_flex1200, "Flex 1200 Rx MIMO B"); - dboard_manager::register_dboard(0x002a, &make_rfx_flex1200, "Flex 1200 Tx MIMO B"); - - dboard_manager::register_dboard(0x0027, &make_rfx_flex2400, "Flex 2400 Rx MIMO B"); - dboard_manager::register_dboard(0x002b, &make_rfx_flex2400, "Flex 2400 Tx MIMO B"); + dboard_manager::register_dboard(0x0024, 0x0028, &make_rfx_flex400, "Flex 400 MIMO B"); + dboard_manager::register_dboard(0x0025, 0x0029, &make_rfx_flex900, "Flex 900 MIMO B"); + dboard_manager::register_dboard(0x0034, 0x0035, &make_rfx_flex1800, "Flex 1800 MIMO B"); + dboard_manager::register_dboard(0x0026, 0x002a, &make_rfx_flex1200, "Flex 1200 MIMO B"); + dboard_manager::register_dboard(0x002c, 0x002d, &make_rfx_flex2200, "Flex 2200 MIMO B"); + dboard_manager::register_dboard(0x0027, 0x002b, &make_rfx_flex2400, "Flex 2400 MIMO B"); } /*********************************************************************** diff --git a/host/lib/usrp/dboard/db_wbx.cpp b/host/lib/usrp/dboard/db_wbx.cpp index 95dcb3802..6879dfb8a 100644 --- a/host/lib/usrp/dboard/db_wbx.cpp +++ b/host/lib/usrp/dboard/db_wbx.cpp @@ -154,8 +154,7 @@ static dboard_base::sptr make_wbx(dboard_base::ctor_args_t args){ } UHD_STATIC_BLOCK(reg_wbx_dboards){ - dboard_manager::register_dboard(0x0052, &make_wbx, "WBX RX"); - dboard_manager::register_dboard(0x0053, &make_wbx, "WBX TX"); + dboard_manager::register_dboard(0x0052, 0x0053, &make_wbx, "WBX"); } /*********************************************************************** diff --git a/host/lib/usrp/dboard/db_xcvr2450.cpp b/host/lib/usrp/dboard/db_xcvr2450.cpp index 974a378bd..f5ff200ac 100644 --- a/host/lib/usrp/dboard/db_xcvr2450.cpp +++ b/host/lib/usrp/dboard/db_xcvr2450.cpp @@ -158,8 +158,7 @@ static dboard_base::sptr make_xcvr2450(dboard_base::ctor_args_t args){ UHD_STATIC_BLOCK(reg_xcvr2450_dboard){ //register the factory function for the rx and tx dbids - dboard_manager::register_dboard(0x0060, &make_xcvr2450, "XCVR2450 TX"); - dboard_manager::register_dboard(0x0061, &make_xcvr2450, "XCVR2450 RX"); + dboard_manager::register_dboard(0x0061, 0x0060, &make_xcvr2450, "XCVR2450"); } /*********************************************************************** diff --git a/host/lib/usrp/dboard_manager.cpp b/host/lib/usrp/dboard_manager.cpp index 35ddfc4ee..31af11ed0 100644 --- a/host/lib/usrp/dboard_manager.cpp +++ b/host/lib/usrp/dboard_manager.cpp @@ -43,7 +43,7 @@ typedef uhd::dict<dboard_id_t, args_t> id_to_args_map_t; UHD_SINGLETON_FCN(id_to_args_map_t, get_id_to_args_map) void dboard_manager::register_dboard( - dboard_id_t dboard_id, + const dboard_id_t &dboard_id, dboard_ctor_t dboard_ctor, const std::string &name, const prop_names_t &subdev_names @@ -57,6 +57,17 @@ void dboard_manager::register_dboard( get_id_to_args_map()[dboard_id] = args_t(dboard_ctor, name, subdev_names); } +void dboard_manager::register_dboard( + const dboard_id_t &rx_dboard_id, + const dboard_id_t &tx_dboard_id, + dboard_ctor_t dboard_ctor, + const std::string &name, + const prop_names_t &subdev_names +){ + register_dboard(rx_dboard_id, dboard_ctor, name, subdev_names); + register_dboard(tx_dboard_id, dboard_ctor, name, subdev_names); +} + std::string dboard_id_t::to_pp_string(void) const{ std::string name = "unknown"; if (get_id_to_args_map().has_key(*this)){ diff --git a/host/utils/uhd_burn_db_eeprom.cpp b/host/utils/uhd_burn_db_eeprom.cpp index dfd9decba..ba7aa6cec 100644 --- a/host/utils/uhd_burn_db_eeprom.cpp +++ b/host/utils/uhd_burn_db_eeprom.cpp @@ -32,16 +32,6 @@ using namespace uhd; using namespace uhd::usrp; namespace po = boost::program_options; -//used with lexical cast to parse a hex string -template <class T> struct to_hex{ - T value; - operator T() const {return value;} - friend std::istream& operator>>(std::istream& in, to_hex& out){ - in >> std::hex >> out.value; - return in; - } -}; - int UHD_SAFE_MAIN(int argc, char *argv[]){ //command line variables std::string args, db_name, unit; @@ -55,7 +45,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ ("args", po::value<std::string>(&args)->default_value(""), "device address args [default = \"\"]") ("db", po::value<std::string>(&db_name)->default_value(""), "dboard name [default = \"\"]") ("unit", po::value<std::string>(&unit)->default_value(""), "which unit [RX or TX]") - ("id", po::value<std::string>(), "dboard id to burn (hex string), omit for readback") + ("id", po::value<std::string>(), "dboard id to burn, omit for readback") ; po::variables_map vm; |