diff options
author | michael-west <michael.west@ettus.com> | 2015-04-02 10:51:27 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2015-04-03 13:43:23 -0700 |
commit | ccf1d5c5e5f5c20ff77f45da3295b9dd5bdb6272 (patch) | |
tree | 6bc08220d844d540f2359262e29da659fc57a577 /host/include | |
parent | da5311407bdabcb7206f8ffb0b77de32d294f083 (diff) | |
download | uhd-ccf1d5c5e5f5c20ff77f45da3295b9dd5bdb6272.tar.gz uhd-ccf1d5c5e5f5c20ff77f45da3295b9dd5bdb6272.tar.bz2 uhd-ccf1d5c5e5f5c20ff77f45da3295b9dd5bdb6272.zip |
uhd: Add ability to get and set command time through dboard_iface.
This creates a wb_iface child class called timed_wb_iface, which
adds support for timed commands.
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/types/wb_iface.hpp | 20 | ||||
-rw-r--r-- | host/include/uhd/usrp/dboard_iface.hpp | 13 |
2 files changed, 32 insertions, 1 deletions
diff --git a/host/include/uhd/types/wb_iface.hpp b/host/include/uhd/types/wb_iface.hpp index c508062e4..e24e9363e 100644 --- a/host/include/uhd/types/wb_iface.hpp +++ b/host/include/uhd/types/wb_iface.hpp @@ -1,5 +1,5 @@ // -// Copyright 2011-2013 Ettus Research LLC +// Copyright 2011-2013,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 @@ -19,6 +19,7 @@ #define INCLUDED_UHD_TYPES_WB_IFACE_HPP #include <uhd/config.hpp> +#include <uhd/types/time_spec.hpp> #include <boost/cstdint.hpp> #include <boost/shared_ptr.hpp> @@ -74,7 +75,24 @@ public: * \return the 16bit data */ virtual boost::uint16_t peek16(const wb_addr_type addr); +}; +class UHD_API timed_wb_iface : public wb_iface +{ +public: + typedef boost::shared_ptr<timed_wb_iface> sptr; + + /*! + * Get the command time. + * \return the command time + */ + virtual time_spec_t get_time(void) = 0; + + /*! + * Set the command time. + * \param t the command time + */ + virtual void set_time(const time_spec_t& t) = 0; }; } //namespace uhd diff --git a/host/include/uhd/usrp/dboard_iface.hpp b/host/include/uhd/usrp/dboard_iface.hpp index b0f92e2ab..f8f318a40 100644 --- a/host/include/uhd/usrp/dboard_iface.hpp +++ b/host/include/uhd/usrp/dboard_iface.hpp @@ -21,6 +21,7 @@ #include <uhd/config.hpp> #include <uhd/utils/pimpl.hpp> #include <uhd/types/serial.hpp> +#include <uhd/types/time_spec.hpp> #include <boost/shared_ptr.hpp> #include <boost/cstdint.hpp> #include <string> @@ -280,6 +281,18 @@ public: */ virtual double get_codec_rate(unit_t unit) = 0; + /*! + * Get the command time. + * \return the command time + */ + virtual uhd::time_spec_t get_command_time(void); + + /*! + * Set the command time. + * \param t the time + */ + virtual void set_command_time(const uhd::time_spec_t& t); + private: UHD_PIMPL_DECL(impl) _impl; |