aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-07-02 10:48:43 -0700
committerJosh Blum <josh@joshknows.com>2010-07-05 13:45:17 -0700
commit09ad8e1337c76ae9ca8bbf18791519fa786a286a (patch)
tree6b0c5e2bcc9c7be3ea7831b562b65f8324f5ca0b /host/include
parent6469d2419f8564c37f8fd6870aedbc990f06e108 (diff)
downloaduhd-09ad8e1337c76ae9ca8bbf18791519fa786a286a.tar.gz
uhd-09ad8e1337c76ae9ca8bbf18791519fa786a286a.tar.bz2
uhd-09ad8e1337c76ae9ca8bbf18791519fa786a286a.zip
uhd: filled in mimo usrp rx and tx methods
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/usrp/mimo_usrp.hpp40
-rw-r--r--host/include/uhd/utils/algorithm.hpp29
2 files changed, 69 insertions, 0 deletions
diff --git a/host/include/uhd/usrp/mimo_usrp.hpp b/host/include/uhd/usrp/mimo_usrp.hpp
index 8820c91c1..483feca29 100644
--- a/host/include/uhd/usrp/mimo_usrp.hpp
+++ b/host/include/uhd/usrp/mimo_usrp.hpp
@@ -94,10 +94,50 @@ public:
/*******************************************************************
* RX methods
******************************************************************/
+ virtual void set_rx_rate_all(double rate) = 0;
+ virtual double get_rx_rate_all(void) = 0;
+
+ virtual tune_result_t set_rx_freq(size_t chan, double freq) = 0;
+ virtual tune_result_t set_rx_freq(size_t chan, double freq, double lo_off) = 0;
+ virtual freq_range_t get_rx_freq_range(size_t chan) = 0;
+
+ virtual void set_rx_gain(size_t chan, float gain) = 0;
+ virtual float get_rx_gain(size_t chan) = 0;
+ virtual gain_range_t get_rx_gain_range(size_t chan) = 0;
+
+ virtual void set_rx_antenna(size_t chan, const std::string &ant) = 0;
+ virtual std::string get_rx_antenna(size_t chan) = 0;
+ virtual std::vector<std::string> get_rx_antennas(size_t chan) = 0;
+
+ virtual bool get_rx_lo_locked(size_t chan) = 0;
+
+ /*!
+ * Read the RSSI value from a usrp device.
+ * Or throw if the dboard does not support an RSSI readback.
+ * \param chan which mimo channel 0 to N-1
+ * \return the rssi in dB
+ */
+ virtual float read_rssi(size_t chan) = 0;
/*******************************************************************
* TX methods
******************************************************************/
+ virtual void set_tx_rate_all(double rate) = 0;
+ virtual double get_tx_rate_all(void) = 0;
+
+ virtual tune_result_t set_tx_freq(size_t chan, double freq) = 0;
+ virtual tune_result_t set_tx_freq(size_t chan, double freq, double lo_off) = 0;
+ virtual freq_range_t get_tx_freq_range(size_t chan) = 0;
+
+ virtual void set_tx_gain(size_t chan, float gain) = 0;
+ virtual float get_tx_gain(size_t chan) = 0;
+ virtual gain_range_t get_tx_gain_range(size_t chan) = 0;
+
+ virtual void set_tx_antenna(size_t chan, const std::string &ant) = 0;
+ virtual std::string get_tx_antenna(size_t chan) = 0;
+ virtual std::vector<std::string> get_tx_antennas(size_t chan) = 0;
+
+ virtual bool get_tx_lo_locked(size_t chan) = 0;
};
diff --git a/host/include/uhd/utils/algorithm.hpp b/host/include/uhd/utils/algorithm.hpp
index 08977a69f..b52edc6b5 100644
--- a/host/include/uhd/utils/algorithm.hpp
+++ b/host/include/uhd/utils/algorithm.hpp
@@ -83,6 +83,35 @@ namespace std{
}
/*!
+ * Count the number of appearances of a value in a range.
+ *
+ * Uses std::count to count the appearances in the range.
+ *
+ * \param range the elements to iterate through
+ * \param value the value to count in the range
+ * \return the number of appearances of the value
+ */
+ template<typename Range, typename T> inline
+ size_t count(const Range &range, const T &value){
+ return std::count(boost::begin(range), boost::end(range), value);
+ }
+
+ /*!
+ * Are the ranges equal (are their elements equivalent)?
+ *
+ * Uses std::equal to search the iterable for an element.
+ *
+ * \param range1 the first range of elements
+ * \param range2 the second range of elements
+ * \return true when the elements are equivalent
+ */
+ template<typename Range> inline
+ bool equal(const Range &range1, const Range &range2){
+ return (boost::size(range1) == boost::size(range2)) and
+ std::equal(boost::begin(range1), boost::end(range1), boost::begin(range2));
+ }
+
+ /*!
* A templated signum implementation.
* \param n the comparable to process
* \return -1 when n negative, +1 when n positive, otherwise 0