aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorAshish Chaudhari <ashish@ettus.com>2015-09-25 01:42:14 +0000
committerAshish Chaudhari <ashish@ettus.com>2015-09-29 15:53:43 -0700
commite4c9656ac267b05e1a19106fb1594f7ac5c37cc7 (patch)
tree767ae76417fc1db0f05df2ce530fc02136a0a1c2 /host/include
parent9401bdbd214a7842c4ba913595cc79e27124589d (diff)
downloaduhd-e4c9656ac267b05e1a19106fb1594f7ac5c37cc7.tar.gz
uhd-e4c9656ac267b05e1a19106fb1594f7ac5c37cc7.tar.bz2
uhd-e4c9656ac267b05e1a19106fb1594f7ac5c37cc7.zip
usrp3: Added new GPIO ATR 3000 core
- Refactored GPIO ATR definitions - Added new 3000 core with a more efficient API - Added a separate db_gpio_atr core to control the ATR bus - Ported b2xx, e3xx and x3xx to the new core - Minor cleanup
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/usrp/dboard_iface.hpp11
-rw-r--r--host/include/uhd/usrp/gpio_defs.hpp70
-rw-r--r--host/include/uhd/utils/soft_register.hpp4
3 files changed, 75 insertions, 10 deletions
diff --git a/host/include/uhd/usrp/dboard_iface.hpp b/host/include/uhd/usrp/dboard_iface.hpp
index f8f318a40..c3a3a4e00 100644
--- a/host/include/uhd/usrp/dboard_iface.hpp
+++ b/host/include/uhd/usrp/dboard_iface.hpp
@@ -22,6 +22,7 @@
#include <uhd/utils/pimpl.hpp>
#include <uhd/types/serial.hpp>
#include <uhd/types/time_spec.hpp>
+#include <uhd/usrp/gpio_defs.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/cstdint.hpp>
#include <string>
@@ -67,14 +68,6 @@ public:
UNIT_TX = int('t')
};
- //! possible atr registers
- enum atr_reg_t{
- ATR_REG_IDLE = int('i'),
- ATR_REG_TX_ONLY = int('t'),
- ATR_REG_RX_ONLY = int('r'),
- ATR_REG_FULL_DUPLEX = int('f')
- };
-
//! aux dac selection enums (per unit)
enum aux_dac_t{
AUX_DAC_A = int('a'),
@@ -89,6 +82,8 @@ public:
AUX_ADC_B = int('b')
};
+ typedef uhd::usrp::gpio_atr::gpio_atr_reg_t atr_reg_t;
+
/*!
* Get special properties information for this dboard slot.
* This call helps the dboard code to handle implementation
diff --git a/host/include/uhd/usrp/gpio_defs.hpp b/host/include/uhd/usrp/gpio_defs.hpp
new file mode 100644
index 000000000..c32f22f28
--- /dev/null
+++ b/host/include/uhd/usrp/gpio_defs.hpp
@@ -0,0 +1,70 @@
+//
+// Copyright 2011,2014,2015 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 <http://www.gnu.org/licenses/>.
+//
+
+#ifndef INCLUDED_LIBUHD_USRP_GPIO_DEFS_HPP
+#define INCLUDED_LIBUHD_USRP_GPIO_DEFS_HPP
+
+#include <uhd/config.hpp>
+#include <boost/assign.hpp>
+#include <boost/utility.hpp>
+#include <map>
+
+namespace uhd { namespace usrp { namespace gpio_atr {
+
+enum gpio_atr_reg_t {
+ ATR_REG_IDLE = int('i'),
+ ATR_REG_TX_ONLY = int('t'),
+ ATR_REG_RX_ONLY = int('r'),
+ ATR_REG_FULL_DUPLEX = int('f')
+};
+
+enum gpio_atr_mode_t {
+ MODE_ATR = 0, //Output driven by the auto-transmit-receive engine
+ MODE_GPIO = 1 //Output value is static
+};
+
+enum gpio_ddr_t {
+ DDR_INPUT = 0,
+ DDR_OUTPUT = 1
+};
+
+enum gpio_attr_t {
+ GPIO_CTRL,
+ GPIO_DDR,
+ GPIO_OUT,
+ GPIO_ATR_0X,
+ GPIO_ATR_RX,
+ GPIO_ATR_TX,
+ GPIO_ATR_XX
+};
+
+typedef std::map<gpio_attr_t, std::string> gpio_attr_map_t;
+
+static const gpio_attr_map_t gpio_attr_map =
+ boost::assign::map_list_of
+ (GPIO_CTRL, "CTRL")
+ (GPIO_DDR, "DDR")
+ (GPIO_OUT, "OUT")
+ (GPIO_ATR_0X, "ATR_0X")
+ (GPIO_ATR_RX, "ATR_RX")
+ (GPIO_ATR_TX, "ATR_TX")
+ (GPIO_ATR_XX, "ATR_XX")
+;
+
+}}} //namespaces
+
+#endif /* INCLUDED_LIBUHD_USRP_GPIO_DEFS_HPP */
diff --git a/host/include/uhd/utils/soft_register.hpp b/host/include/uhd/utils/soft_register.hpp
index a2c34a4ec..665876e73 100644
--- a/host/include/uhd/utils/soft_register.hpp
+++ b/host/include/uhd/utils/soft_register.hpp
@@ -223,7 +223,7 @@ public:
_soft_copy.mark_clean();
}
} else {
- throw uhd::not_implemented_error("soft_register is not writable.");
+ throw uhd::not_implemented_error("soft_register is not writable or uninitialized.");
}
}
@@ -244,7 +244,7 @@ public:
}
_soft_copy.mark_clean();
} else {
- throw uhd::not_implemented_error("soft_register is not readable.");
+ throw uhd::not_implemented_error("soft_register is not readable or uninitialized.");
}
}