summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-01-27 00:19:55 -0800
committerJosh Blum <josh@joshknows.com>2010-01-27 00:19:55 -0800
commitfc1bffcfd9761c1f60cf322bb58e7f9c8096a5c0 (patch)
tree9a926b084f836c6dba9fe8eafe0c583b4c780b5a /include
parenta98e387578a3aceb15e2bcce4a9cc54d78c30dda (diff)
downloaduhd-fc1bffcfd9761c1f60cf322bb58e7f9c8096a5c0.tar.gz
uhd-fc1bffcfd9761c1f60cf322bb58e7f9c8096a5c0.tar.bz2
uhd-fc1bffcfd9761c1f60cf322bb58e7f9c8096a5c0.zip
Added boost system (needed with asio) and date time (will need for threading/sleeping).
Added to dboard interface to get clock rates. Added OTHERS properties and some documentation type notes. Added more TODOs to the utils.
Diffstat (limited to 'include')
-rw-r--r--include/usrp_uhd/device.hpp6
-rw-r--r--include/usrp_uhd/props.hpp33
-rw-r--r--include/usrp_uhd/usrp/dboard/interface.hpp13
-rw-r--r--include/usrp_uhd/utils.hpp2
4 files changed, 40 insertions, 14 deletions
diff --git a/include/usrp_uhd/device.hpp b/include/usrp_uhd/device.hpp
index 32d58b21f..3ef4a79cf 100644
--- a/include/usrp_uhd/device.hpp
+++ b/include/usrp_uhd/device.hpp
@@ -26,9 +26,9 @@ public:
typedef boost::shared_ptr<device> sptr;
//argument types for send and recv raw methods
- //the send args is an array of buffers
- //the recv args is a callback that takes a buffer
- typedef std::vector<boost::asio::const_buffer> send_args_t;
+ //the send args is convertable to a boost asio buffer
+ //the recv args is a callback that takes a boost asio buffer
+ typedef boost::asio::const_buffer send_args_t;
typedef boost::function<bool(const boost::asio::const_buffer &)> recv_args_t;
//structors
diff --git a/include/usrp_uhd/props.hpp b/include/usrp_uhd/props.hpp
index 6e416192c..426554a53 100644
--- a/include/usrp_uhd/props.hpp
+++ b/include/usrp_uhd/props.hpp
@@ -62,7 +62,10 @@ namespace usrp_uhd{
typedef boost::tuple<wax::type, std::string> named_prop_t;
/*!
- * Possible device properties.
+ * Possible device properties:
+ * In general, a device will have a single mboard.
+ * In certain mimo applications, multiple boards
+ * will be present in the interface for configuration.
*/
enum device_prop_t{
DEVICE_PROP_NAME, //ro, std::string
@@ -71,10 +74,14 @@ namespace usrp_uhd{
};
/*!
- * Possible device mboard properties
+ * Possible device mboard properties:
+ * The general mboard properties are listed below.
+ * Custom properties can be identified with a string
+ * and discovered though the others property.
*/
enum mboard_prop_t{
MBOARD_PROP_NAME, //ro, std::string
+ MBOARD_PROP_OTHERS, //ro, prop_names_t
MBOARD_PROP_MTU, //ro, size_t
MBOARD_PROP_CLOCK_RATE, //ro, freq_t
MBOARD_PROP_RX_DSP, //ro, wax::obj
@@ -95,15 +102,16 @@ namespace usrp_uhd{
};
/*!
- * Possible device dsp properties
+ * Possible device dsp properties:
+ * A dsp can have a wide range of possible properties.
+ * A ddc would have a properties "decim", "freq", "taps"...
+ * Other properties could be gains, complex scalars, enables...
+ * For this reason the only required properties of a dsp is a name
+ * and a property to get list of other possible properties.
*/
enum dsp_prop_t{
DSP_PROP_NAME, //ro, std::string
- DSP_PROP_FREQ, //rw, freq_t
- DSP_PROP_TAPS, //rw, *_vec_t
- DSP_PROP_RATE, //rw, *_scalar_t, decim/interp
- DSP_PROP_SCALAR, //rw, *_scalar_t
- DSP_PROP_ENABLED //rw, bool or time_spec_t
+ DSP_PROP_OTHERS //ro, prop_names_t
};
/*!
@@ -117,10 +125,13 @@ namespace usrp_uhd{
};
/*!
- * Possible device codec properties
+ * Possible device codec properties:
+ * A codec is expected to have a rate and gain elements.
+ * Other properties can be discovered through the others prop.
*/
enum codec_prop_t{
CODEC_PROP_NAME, //ro, std::string
+ CODEC_PROP_OTHERS, //ro, prop_names_t
CODEC_PROP_GAIN, //rw, gain_t
CODEC_PROP_GAIN_MAX, //ro, gain_t
CODEC_PROP_GAIN_MIN, //ro, gain_t
@@ -134,6 +145,7 @@ namespace usrp_uhd{
*/
enum subdev_prop_t{
SUBDEV_PROP_NAME, //ro, std::string
+ SUBDEV_PROP_OTHERS, //ro, prop_names_t
SUBDEV_PROP_GAIN, //rw, gain_t
SUBDEV_PROP_GAIN_MAX, //ro, gain_t
SUBDEV_PROP_GAIN_MIN, //ro, gain_t
@@ -150,8 +162,7 @@ namespace usrp_uhd{
SUBDEV_PROP_SPECTRUM_INVERTED, //ro, bool
SUBDEV_PROP_IS_TX, //ro, bool
SUBDEV_PROP_RSSI, //ro, gain_t
- SUBDEV_PROP_BANDWIDTH, //rw, freq_t
- SUBDEV_PROP_CLOCK_RATE //ro, freq_t
+ SUBDEV_PROP_BANDWIDTH //rw, freq_t
};
} //namespace usrp_uhd
diff --git a/include/usrp_uhd/usrp/dboard/interface.hpp b/include/usrp_uhd/usrp/dboard/interface.hpp
index 7af45f7a2..20623ab1a 100644
--- a/include/usrp_uhd/usrp/dboard/interface.hpp
+++ b/include/usrp_uhd/usrp/dboard/interface.hpp
@@ -134,6 +134,19 @@ public:
* \return the data read if sucessful, else a zero length string.
*/
virtual std::string read_spi(spi_dev_t dev, spi_latch_t latch, size_t len) = 0;
+
+ /*!
+ * \brief Get the rate of the rx dboard clock.
+ * \return the clock rate
+ */
+ virtual double get_rx_clock_rate(void) = 0;
+
+ /*!
+ * \brief Get the rate of the tx dboard clock.
+ * \return the clock rate
+ */
+ virtual double get_tx_clock_rate(void) = 0;
+
};
}}} //namespace
diff --git a/include/usrp_uhd/utils.hpp b/include/usrp_uhd/utils.hpp
index 6fe5bd4d4..a45473ab4 100644
--- a/include/usrp_uhd/utils.hpp
+++ b/include/usrp_uhd/utils.hpp
@@ -21,6 +21,8 @@ std::vector<Key> get_map_keys(const std::map<Key, T> &m){
return v;
}
+//TODO implement a set and get gains that takes a wx obj ptr, and gain properties
+
//TODO check name in vector of names
//TODO optionally extract a name from the named_prop_t