aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/usrp2_clk_regs.hpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-11-11 17:40:01 -0800
committerJosh Blum <josh@joshknows.com>2010-11-11 17:40:01 -0800
commit476afe68f5c37a3e10a1208b0150732d7770a023 (patch)
tree73ea72533375d32ac35bcfff578ac0d774a89343 /host/lib/usrp/usrp2/usrp2_clk_regs.hpp
parent478f8174601350ad0edd52bb985657037b181a2d (diff)
downloaduhd-476afe68f5c37a3e10a1208b0150732d7770a023.tar.gz
uhd-476afe68f5c37a3e10a1208b0150732d7770a023.tar.bz2
uhd-476afe68f5c37a3e10a1208b0150732d7770a023.zip
usrp2: made enums for the rev types and implemented in code
Diffstat (limited to 'host/lib/usrp/usrp2/usrp2_clk_regs.hpp')
-rw-r--r--host/lib/usrp/usrp2/usrp2_clk_regs.hpp31
1 files changed, 19 insertions, 12 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_clk_regs.hpp b/host/lib/usrp/usrp2/usrp2_clk_regs.hpp
index d5f80a919..6c46d0a35 100644
--- a/host/lib/usrp/usrp2/usrp2_clk_regs.hpp
+++ b/host/lib/usrp/usrp2/usrp2_clk_regs.hpp
@@ -18,31 +18,38 @@
#ifndef INCLUDED_USRP2_CLK_REGS_HPP
#define INCLUDED_USRP2_CLK_REGS_HPP
-#include "usrp2_regs.hpp"
+#include "usrp2_iface.hpp"
class usrp2_clk_regs_t {
public:
usrp2_clk_regs_t(void) { ; }
- usrp2_clk_regs_t(boost::uint16_t hw_rev) {
+ usrp2_clk_regs_t(usrp2_iface::rev_type rev) {
test = 0;
fpga = 1;
- adc = (hw_rev >= usrp2_rev_nums(N2XX)) ? 2 : 4;
dac = 3;
- serdes = (hw_rev >= usrp2_rev_nums(N2XX)) ? 4 : 2; //only used by usrp2+
- tx_db = (hw_rev >= usrp2_rev_nums(N2XX)) ? 5 : 6;
-
- switch(hw_rev) {
- case usrp2_rev_nums(USRP2_REV3):
+
+ switch(rev) {
+ case usrp2_iface::USRP2_REV3:
exp = 2;
+ adc = 4;
+ serdes = 2;
+ tx_db = 6;
break;
- case usrp2_rev_nums(USRP2_REV4):
+ case usrp2_iface::USRP2_REV4:
exp = 5;
+ adc = 4;
+ serdes = 2;
+ tx_db = 6;
break;
- case usrp2_rev_nums(N2XX):
+ case usrp2_iface::USRP_N200:
+ case usrp2_iface::USRP_N210:
exp = 6;
+ adc = 2;
+ serdes = 4;
+ tx_db = 5;
break;
- default:
- throw std::runtime_error("Unknown hardware revision");
+ case usrp2_iface::USRP_NXXX:
+ //dont throw, it may be unitialized
break;
}