diff options
author | Ben Hilburn <ben.hilburn@ettus.com> | 2014-03-14 10:58:39 -0700 |
---|---|---|
committer | Ben Hilburn <ben.hilburn@ettus.com> | 2014-03-14 10:58:39 -0700 |
commit | bb90f235d65700aa6019a8f6cd38e67e984740f3 (patch) | |
tree | b3d4856602d5340402a718f3961408e9fea83326 /host/lib/usrp/x300/x300_impl.hpp | |
parent | c34a548633d6e53479083175e99b127e638839b4 (diff) | |
parent | b8d583b3b19c7030c6ecfcc284651755efe0326f (diff) | |
download | uhd-bb90f235d65700aa6019a8f6cd38e67e984740f3.tar.gz uhd-bb90f235d65700aa6019a8f6cd38e67e984740f3.tar.bz2 uhd-bb90f235d65700aa6019a8f6cd38e67e984740f3.zip |
Merge branch 'origin/martin/subdev_spec_bug_B'
Diffstat (limited to 'host/lib/usrp/x300/x300_impl.hpp')
-rw-r--r-- | host/lib/usrp/x300/x300_impl.hpp | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/host/lib/usrp/x300/x300_impl.hpp b/host/lib/usrp/x300/x300_impl.hpp index 1fb3676a0..0fe63e4a5 100644 --- a/host/lib/usrp/x300/x300_impl.hpp +++ b/host/lib/usrp/x300/x300_impl.hpp @@ -82,8 +82,8 @@ static const double X300_DEFAULT_SYSREF_RATE = 10e6; #define X300_XB_DST_E0 0 #define X300_XB_DST_E1 1 -#define X300_XB_DST_R0 2 -#define X300_XB_DST_R1 3 +#define X300_XB_DST_R0 2 // Radio 0 -> Slot A +#define X300_XB_DST_R1 3 // Radio 1 -> Slot B #define X300_XB_DST_CE0 4 #define X300_XB_DST_CE1 5 #define X300_XB_DST_CE2 5 @@ -191,12 +191,13 @@ private: i2c_core_100_wb32::sptr zpu_i2c; //perifs in each radio - radio_perifs_t radio_perifs[2]; + radio_perifs_t radio_perifs[2]; //!< This is hardcoded s.t. radio_perifs[0] points to slot A and [1] to B uhd::usrp::dboard_eeprom_t db_eeproms[8]; - - //per mboard frontend mapping - uhd::usrp::subdev_spec_t rx_fe_map; - uhd::usrp::subdev_spec_t tx_fe_map; + //! Return the index of a radio component, given a slot name. This means DSPs, radio_perifs + size_t get_radio_index(const std::string &slot_name) { + UHD_ASSERT_THROW(slot_name == "A" or slot_name == "B"); + return slot_name == "A" ? 0 : 1; + } //other perifs on mboard x300_clock_ctrl::sptr clock; @@ -222,7 +223,20 @@ private: void register_loopback_self_test(uhd::wb_iface::sptr iface); - void setup_radio(const size_t, const size_t which_radio, const std::string &db_name); + /*! \brief Initialize the radio component on a given slot. + * + * Call this function once per slot (A and B) and motherboard to initialize all the radio components. + * This will: + * - Reset and init DACs and ADCs + * - Setup controls for DAC, ADC, SPI and LEDs + * - Self test ADC + * - Sync DACs (for MIMO) + * - Initialize the property tree for control objects etc. (gain, rate...) + * + * \param mb_i Motherboard index + * \param slot_name Slot name (A or B). + */ + void setup_radio(const size_t, const std::string &slot_name); size_t _sid_framer; struct sid_config_t @@ -288,8 +302,15 @@ private: void set_rx_fe_corrections(const uhd::fs_path &mb_path, const std::string &fe_name, const double lo_freq); - void update_rx_subdev_spec(const size_t, const uhd::usrp::subdev_spec_t &spec); - void update_tx_subdev_spec(const size_t, const uhd::usrp::subdev_spec_t &spec); + /*! Update the IQ MUX settings for the radio peripheral according to given subdev spec. + * + * Also checks if the given subdev is valid for this device and updates the channel to DSP mapping. + * + * \param tx_rx "tx" or "rx", depending where you're setting the subdev spec + * \param mb_i Mainboard index number. + * \param spec Subdev spec + */ + void update_subdev_spec(const std::string &tx_rx, const size_t mb_i, const uhd::usrp::subdev_spec_t &spec); void set_tick_rate(mboard_members_t &, const double); void update_tick_rate(mboard_members_t &, const double); |