diff options
author | Nick Foster <nick@nerdnetworks.org> | 2010-10-12 14:46:41 -0700 |
---|---|---|
committer | Nick Foster <nick@nerdnetworks.org> | 2010-10-12 14:46:41 -0700 |
commit | 5982ec4ee2c6f9efca1c5068e42dc38b822df7dc (patch) | |
tree | 6b15ce5f837ea57cc5c9fdf79e45fdbd2f44d9de /host/lib/usrp/usrp2/usrp2_clk_regs.hpp | |
parent | 3df994e1c784d7037e869610f1417fe64e0e89a8 (diff) | |
download | uhd-5982ec4ee2c6f9efca1c5068e42dc38b822df7dc.tar.gz uhd-5982ec4ee2c6f9efca1c5068e42dc38b822df7dc.tar.bz2 uhd-5982ec4ee2c6f9efca1c5068e42dc38b822df7dc.zip |
USRP2P: This is surprisingly involved. Adding a consistent interface to deal with hardware revisions.
Diffstat (limited to 'host/lib/usrp/usrp2/usrp2_clk_regs.hpp')
-rw-r--r-- | host/lib/usrp/usrp2/usrp2_clk_regs.hpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_clk_regs.hpp b/host/lib/usrp/usrp2/usrp2_clk_regs.hpp index d057fb342..edbdfa15d 100644 --- a/host/lib/usrp/usrp2/usrp2_clk_regs.hpp +++ b/host/lib/usrp/usrp2/usrp2_clk_regs.hpp @@ -18,19 +18,24 @@ #ifndef INCLUDED_USRP2_CLK_REGS_HPP #define INCLUDED_USRP2_CLK_REGS_HPP +#include <uhd/usrp/mboard_rev.hpp> #include "usrp2_regs.hpp" class usrp2_clk_regs_t { public: usrp2_clk_regs_t(void) { ; } - usrp2_clk_regs_t(int hw_rev) { + usrp2_clk_regs_t(uhd::usrp::mboard_rev_t hw_rev) { test = 0; fpga = 1; - adc = (hw_rev>=USRP2P_FIRST_HW_REV) ? 2 : 4; + adc = (hw_rev.is_usrp2p()) ? 2 : 4; dac = 3; - serdes = (hw_rev>=USRP2P_FIRST_HW_REV) ? 4 : 2; //only used by usrp2+ - tx_db = (hw_rev>=USRP2P_FIRST_HW_REV) ? 5 : 6; - exp = (hw_rev>=USRP2P_FIRST_HW_REV) ? 6 : 5; + serdes = (hw_rev.is_usrp2p()) ? 4 : 2; //only used by usrp2+ + tx_db = (hw_rev.is_usrp2p()) ? 5 : 6; + + if(hw_rev.major() == 3) exp = 2; + else if(hw_rev.major() >= 4) exp = 5; + else if(hw_rev.major() > 10) exp = 6; + rx_db = 7; } |