aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/e3xx/e31x_radio_ctrl_impl.hpp
diff options
context:
space:
mode:
authorSugandha Gupta <sugandha.gupta@ettus.com>2019-01-25 11:34:47 -0800
committerBrent Stapleton <brent.stapleton@ettus.com>2019-05-01 15:17:23 -0700
commit178b35569b1a25180a80a23b945b10b04c9f10f5 (patch)
tree3adb6f78ebd148867a50526c60fe7bf9694a4a72 /host/lib/usrp/dboard/e3xx/e31x_radio_ctrl_impl.hpp
parent8a400f6a30942c9d6d3596f6989720eb4cff058b (diff)
downloaduhd-178b35569b1a25180a80a23b945b10b04c9f10f5.tar.gz
uhd-178b35569b1a25180a80a23b945b10b04c9f10f5.tar.bz2
uhd-178b35569b1a25180a80a23b945b10b04c9f10f5.zip
e310/e320: Move E310 to MPM architecture and refactor
- Turns the E310 into an MPM device (like N3xx, E320) - Factor out common code between E320 and E310, maximize sharing between the two devices - Remove all pre-MPM E310 code that is no longer needed - Modify MPM to remove all existing overlays before applying new ones (this is necessary to enable idle image mode for E310) Co-authored-by: Virendra Kakade <virendra.kakade@ni.com> Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
Diffstat (limited to 'host/lib/usrp/dboard/e3xx/e31x_radio_ctrl_impl.hpp')
-rw-r--r--host/lib/usrp/dboard/e3xx/e31x_radio_ctrl_impl.hpp144
1 files changed, 144 insertions, 0 deletions
diff --git a/host/lib/usrp/dboard/e3xx/e31x_radio_ctrl_impl.hpp b/host/lib/usrp/dboard/e3xx/e31x_radio_ctrl_impl.hpp
new file mode 100644
index 000000000..581a90c8e
--- /dev/null
+++ b/host/lib/usrp/dboard/e3xx/e31x_radio_ctrl_impl.hpp
@@ -0,0 +1,144 @@
+//
+// Copyright 2018 Ettus Research, a National Instruments Company
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+
+#ifndef INCLUDED_LIBUHD_RFNOC_E31X_RADIO_CTRL_IMPL_HPP
+#define INCLUDED_LIBUHD_RFNOC_E31X_RADIO_CTRL_IMPL_HPP
+
+#include "e3xx_constants.hpp"
+#include "e3xx_radio_ctrl_impl.hpp"
+
+namespace uhd {
+ namespace rfnoc {
+
+/*! \brief Provide access to an E31X radio.
+ */
+class e31x_radio_ctrl_impl : public e3xx_radio_ctrl_impl
+{
+public:
+ /************************************************************************
+ * Structors
+ ***********************************************************************/
+ e31x_radio_ctrl_impl(
+ const make_args_t &make_args
+ );
+ virtual ~e31x_radio_ctrl_impl();
+
+protected:
+
+ /**************************************************************************
+ * ATR/ Switches Types
+ *************************************************************************/
+
+ enum tx_sw1_t {
+ TX_SW1_LB_80 = 7,
+ TX_SW1_LB_160 = 6,
+ TX_SW1_LB_225 = 5,
+ TX_SW1_LB_400 = 4,
+ TX_SW1_LB_575 = 3,
+ TX_SW1_LB_1000 = 2,
+ TX_SW1_LB_1700 = 1,
+ TX_SW1_LB_2750 = 0,
+ TX_SW1_HB_5850 = 7
+ };
+
+ enum vctxrx_sw_t {
+ VCTXRX_SW_TX_HB = 3,
+ VCTXRX1_SW_TX_LB = 1,
+ VCTXRX1_SW_RX = 2,
+ VCTXRX2_SW_TX_LB = 2,
+ VCTXRX2_SW_RX = 1,
+ VCTXRX_SW_OFF = 0,
+ };
+
+ enum rx_sw1_t {
+ RX_SW1_LB_B2 = 4,
+ RX_SW1_LB_B3 = 2,
+ RX_SW1_LB_B4 = 0,
+ RX_SW1_LB_B5 = 1,
+ RX_SW1_LB_B6 = 3,
+ RX_SW1_LB_B7 = 5,
+ RX_SW1_OFF = 7
+ };
+
+ enum rx_swc_t {
+ RX_SWC_LB_B2 = 2,
+ RX_SWC_LB_B3 = 3,
+ RX_SWC_LB_B4 = 1,
+ RX_SWC_OFF = 0
+ };
+
+ enum rx_swb_t {
+ RX_SWB_LB_B5 = 2,
+ RX_SWB_LB_B6 = 3,
+ RX_SWB_LB_B7 = 1,
+ RX_SWB_OFF = 0
+ };
+
+ enum vcrx_sw_t {
+ VCRX_SW_LB = 1,
+ VCRX_SW_HB = 2,
+ VCRX_SW_OFF = 0 //or 3
+ };
+
+ // (TX_ENABLEB, TX_ENABLEA)
+ enum tx_bias_t {
+ TX1_BIAS_HB_ON = 1,
+ TX1_BIAS_LB_ON = 2,
+ TX2_BIAS_HB_ON = 1,
+ TX2_BIAS_LB_ON = 2,
+ TX_BIAS_OFF = 0
+ };
+
+ /************************************************************************
+ * API calls
+ ***********************************************************************/
+ virtual bool check_radio_config();
+
+ const std::string get_default_timing_mode()
+ {
+ return TIMING_MODE_1R1T;
+ };
+
+ /*! Run a loopback self test.
+ *
+ * This will write data to the AD936x and read it back again.
+ * If this test fails, it generally means the interface is broken,
+ * so we assume it passes and throw otherwise. Running this requires
+ * a core that we can peek and poke the loopback values into.
+ *
+ * \param iface An interface to the associated radio control core
+ * \param iface The radio control core's address to write the loopback value
+ * \param iface The radio control core's readback address to read back the returned
+ * value
+ *
+ * \throws a uhd::runtime_error if the loopback value didn't match.
+ */
+ void loopback_self_test(std::function<void(uint32_t)> poker_functor,
+ std::function<uint64_t()> peeker_functor);
+
+ uint32_t get_rx_switches(
+ const size_t chan,
+ const double freq,
+ const std::string &ant
+ );
+
+ uint32_t get_tx_switches(
+ const size_t chan,
+ const double freq
+ );
+
+ uint32_t get_idle_switches();
+
+ uint32_t get_tx_led();
+ uint32_t get_rx_led();
+ uint32_t get_txrx_led();
+ uint32_t get_idle_led();
+}; /* class radio_ctrl_impl */
+
+}} /* namespace uhd::rfnoc */
+
+#endif /* INCLUDED_LIBUHD_RFNOC_E31X_RADIO_CTRL_IMPL_HPP */
+// vim: sw=4 et: