diff options
Diffstat (limited to 'host')
-rw-r--r-- | host/include/uhd/CMakeLists.txt | 1 | ||||
-rw-r--r-- | host/include/uhd/deprecated.hpp | 148 | ||||
-rw-r--r-- | host/include/uhd/device.hpp | 2 | ||||
-rw-r--r-- | host/include/uhd/types/io_type.hpp | 78 | ||||
-rw-r--r-- | host/include/uhd/types/otw_type.hpp | 71 | ||||
-rw-r--r-- | host/include/uhd/usrp/CMakeLists.txt | 2 | ||||
-rw-r--r-- | host/include/uhd/usrp/mboard_iface.hpp | 71 | ||||
-rw-r--r-- | host/include/uhd/usrp/single_usrp.hpp | 30 | ||||
-rw-r--r-- | host/lib/deprecated.cpp | 50 | ||||
-rw-r--r-- | host/lib/types/types.cpp | 47 |
10 files changed, 204 insertions, 296 deletions
diff --git a/host/include/uhd/CMakeLists.txt b/host/include/uhd/CMakeLists.txt index 6ca6d43cc..08483346c 100644 --- a/host/include/uhd/CMakeLists.txt +++ b/host/include/uhd/CMakeLists.txt @@ -29,6 +29,7 @@ INSTALL(FILES exception.hpp property_tree.ipp property_tree.hpp + streamer.hpp version.hpp wax.hpp DESTINATION ${INCLUDE_DIR}/uhd diff --git a/host/include/uhd/deprecated.hpp b/host/include/uhd/deprecated.hpp index 0a49cc423..0f4965bc6 100644 --- a/host/include/uhd/deprecated.hpp +++ b/host/include/uhd/deprecated.hpp @@ -171,3 +171,151 @@ namespace wax{ } //namespace wax #endif /* INCLUDED_WAX_HPP */ + +// +// Copyright 2010 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_UHD_TYPES_OTW_TYPE_HPP +#define INCLUDED_UHD_TYPES_OTW_TYPE_HPP + +#include <uhd/config.hpp> + +namespace uhd{ + + /*! + * Description for over-the-wire integers: + * The DSP units in the FPGA deal with signed 16-bit integers. + * The width and shift define the translation between OTW and DSP, + * defined by the following relation: otw_int = dsp_int >> shift + * + * Note: possible combinations of width, shift, and byteorder + * depend on the internals of the FPGA. Not all are supported! + */ + struct UHD_API otw_type_t{ + + /*! + * Width of an over-the-wire integer in bits. + */ + size_t width; //in bits + + /*! + * Shift of an over-the-wire integer in bits. + * otw_int = dsp_int >> shift + * dsp_int = otw_int << shift + */ + size_t shift; //in bits + + /*! + * Constants for byte order (borrowed from numpy's dtype) + */ + enum /*bo_t*/ { + BO_NATIVE = int('='), + BO_LITTLE_ENDIAN = int('<'), + BO_BIG_ENDIAN = int('>'), + BO_NOT_APPLICABLE = int('|') + } byteorder; + + /*! + * Get the sample size of this otw type. + * \return the size of a sample in bytes + */ + size_t get_sample_size(void) const; + + otw_type_t(void); + }; + +} //namespace uhd + +#endif /* INCLUDED_UHD_TYPES_OTW_TYPE_HPP */ + +// +// Copyright 2010-2011 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_UHD_TYPES_IO_TYPE_HPP +#define INCLUDED_UHD_TYPES_IO_TYPE_HPP + +#include <uhd/config.hpp> + +namespace uhd{ + + /*! + * The Input/Output configuration struct: + * Used to specify the IO type with device send/recv. + */ + class UHD_API io_type_t{ + public: + + /*! + * Built in IO types known to the system. + */ + enum tid_t{ + //! Custom type (technically unsupported by implementation) + CUSTOM_TYPE = int('?'), + //! Complex floating point (64-bit floats) range [-1.0, +1.0] + COMPLEX_FLOAT64 = int('d'), + //! Complex floating point (32-bit floats) range [-1.0, +1.0] + COMPLEX_FLOAT32 = int('f'), + //! Complex signed integer (16-bit integers) range [-32768, +32767] + COMPLEX_INT16 = int('s'), + //! Complex signed integer (8-bit integers) range [-128, 127] + COMPLEX_INT8 = int('b') + }; + + /*! + * The size of this io type in bytes. + */ + const size_t size; + + /*! + * The type id of this io type. + * Good for using with switch statements. + */ + const tid_t tid; + + /*! + * Create an io type from a built-in type id. + * \param tid a type id known to the system + */ + io_type_t(tid_t tid); + + /*! + * Create an io type from attributes. + * The tid will be set to custom. + * \param size the size in bytes + */ + io_type_t(size_t size); + + }; + +} //namespace uhd + +#endif /* INCLUDED_UHD_TYPES_IO_TYPE_HPP */ + diff --git a/host/include/uhd/device.hpp b/host/include/uhd/device.hpp index 18545427c..0ea5259b5 100644 --- a/host/include/uhd/device.hpp +++ b/host/include/uhd/device.hpp @@ -19,9 +19,9 @@ #define INCLUDED_UHD_DEVICE_HPP #include <uhd/config.hpp> +#include <uhd/deprecated.hpp> #include <uhd/types/device_addr.hpp> #include <uhd/types/metadata.hpp> -#include <uhd/types/io_type.hpp> #include <uhd/types/ref_vector.hpp> #include <boost/utility.hpp> #include <boost/shared_ptr.hpp> diff --git a/host/include/uhd/types/io_type.hpp b/host/include/uhd/types/io_type.hpp index ace643abc..e0ee4187b 100644 --- a/host/include/uhd/types/io_type.hpp +++ b/host/include/uhd/types/io_type.hpp @@ -1,76 +1,2 @@ -// -// Copyright 2010-2011 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_UHD_TYPES_IO_TYPE_HPP -#define INCLUDED_UHD_TYPES_IO_TYPE_HPP - -#include <uhd/config.hpp> - -namespace uhd{ - - /*! - * The Input/Output configuration struct: - * Used to specify the IO type with device send/recv. - */ - class UHD_API io_type_t{ - public: - - /*! - * Built in IO types known to the system. - */ - enum tid_t{ - //! Custom type (technically unsupported by implementation) - CUSTOM_TYPE = int('?'), - //! Complex floating point (64-bit floats) range [-1.0, +1.0] - COMPLEX_FLOAT64 = int('d'), - //! Complex floating point (32-bit floats) range [-1.0, +1.0] - COMPLEX_FLOAT32 = int('f'), - //! Complex signed integer (16-bit integers) range [-32768, +32767] - COMPLEX_INT16 = int('s'), - //! Complex signed integer (8-bit integers) range [-128, 127] - COMPLEX_INT8 = int('b') - }; - - /*! - * The size of this io type in bytes. - */ - const size_t size; - - /*! - * The type id of this io type. - * Good for using with switch statements. - */ - const tid_t tid; - - /*! - * Create an io type from a built-in type id. - * \param tid a type id known to the system - */ - io_type_t(tid_t tid); - - /*! - * Create an io type from attributes. - * The tid will be set to custom. - * \param size the size in bytes - */ - io_type_t(size_t size); - - }; - -} //namespace uhd - -#endif /* INCLUDED_UHD_TYPES_IO_TYPE_HPP */ +//The IO type API has been deprecated in favor of the streamer interface +#include <uhd/deprecated.hpp> diff --git a/host/include/uhd/types/otw_type.hpp b/host/include/uhd/types/otw_type.hpp index 11a6af38e..6dc634fc8 100644 --- a/host/include/uhd/types/otw_type.hpp +++ b/host/include/uhd/types/otw_type.hpp @@ -1,69 +1,2 @@ -// -// Copyright 2010 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_UHD_TYPES_OTW_TYPE_HPP -#define INCLUDED_UHD_TYPES_OTW_TYPE_HPP - -#include <uhd/config.hpp> - -namespace uhd{ - - /*! - * Description for over-the-wire integers: - * The DSP units in the FPGA deal with signed 16-bit integers. - * The width and shift define the translation between OTW and DSP, - * defined by the following relation: otw_int = dsp_int >> shift - * - * Note: possible combinations of width, shift, and byteorder - * depend on the internals of the FPGA. Not all are supported! - */ - struct UHD_API otw_type_t{ - - /*! - * Width of an over-the-wire integer in bits. - */ - size_t width; //in bits - - /*! - * Shift of an over-the-wire integer in bits. - * otw_int = dsp_int >> shift - * dsp_int = otw_int << shift - */ - size_t shift; //in bits - - /*! - * Constants for byte order (borrowed from numpy's dtype) - */ - enum /*bo_t*/ { - BO_NATIVE = int('='), - BO_LITTLE_ENDIAN = int('<'), - BO_BIG_ENDIAN = int('>'), - BO_NOT_APPLICABLE = int('|') - } byteorder; - - /*! - * Get the sample size of this otw type. - * \return the size of a sample in bytes - */ - size_t get_sample_size(void) const; - - otw_type_t(void); - }; - -} //namespace uhd - -#endif /* INCLUDED_UHD_TYPES_OTW_TYPE_HPP */ +//The OTW type API has been deprecated in favor of the streamer interface +#include <uhd/deprecated.hpp> diff --git a/host/include/uhd/usrp/CMakeLists.txt b/host/include/uhd/usrp/CMakeLists.txt index ba38a67ea..d7b936fc2 100644 --- a/host/include/uhd/usrp/CMakeLists.txt +++ b/host/include/uhd/usrp/CMakeLists.txt @@ -31,9 +31,7 @@ INSTALL(FILES subdev_spec.hpp ### interfaces ### - single_usrp.hpp multi_usrp.hpp - mboard_iface.hpp DESTINATION ${INCLUDE_DIR}/uhd/usrp COMPONENT headers diff --git a/host/include/uhd/usrp/mboard_iface.hpp b/host/include/uhd/usrp/mboard_iface.hpp deleted file mode 100644 index bbee8f2de..000000000 --- a/host/include/uhd/usrp/mboard_iface.hpp +++ /dev/null @@ -1,71 +0,0 @@ -// -// Copyright 2010-2011 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_UHD_USRP_MBOARD_IFACE_HPP -#define INCLUDED_UHD_USRP_MBOARD_IFACE_HPP - -#include <uhd/types/serial.hpp> -#include <uhd/usrp/mboard_eeprom.hpp> -#include <boost/shared_ptr.hpp> -#include <boost/utility.hpp> -#include <boost/cstdint.hpp> -#include <utility> -#include <string> - -namespace uhd{ namespace usrp{ - -/*! - * The mboard interface class: - * Provides a set of functions to implementation layer. - * Including spi, peek, poke, control... - */ -class mboard_iface : public uhd::i2c_iface, public uhd::spi_iface, public uhd::uart_iface { -public: - typedef boost::shared_ptr<mboard_iface> sptr; - /*! - * Write a register (32 bits) - * \param addr the address - * \param data the 32bit data - */ - virtual void poke32(boost::uint32_t addr, boost::uint32_t data) = 0; - - /*! - * Read a register (32 bits) - * \param addr the address - * \return the 32bit data - */ - virtual boost::uint32_t peek32(boost::uint32_t addr) = 0; - - /*! - * Write a register (16 bits) - * \param addr the address - * \param data the 16bit data - */ - virtual void poke16(boost::uint32_t addr, boost::uint16_t data) = 0; - - /*! - * Read a register (16 bits) - * \param addr the address - * \return the 16bit data - */ - virtual boost::uint16_t peek16(boost::uint32_t addr) = 0; - -}; - -}} - -#endif //INCLUDED_UHD_USRP_DBOARD_IFACE_HPP diff --git a/host/include/uhd/usrp/single_usrp.hpp b/host/include/uhd/usrp/single_usrp.hpp deleted file mode 100644 index 0520db162..000000000 --- a/host/include/uhd/usrp/single_usrp.hpp +++ /dev/null @@ -1,30 +0,0 @@ -// -// Copyright 2010-2011 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_UHD_USRP_SINGLE_USRP_HPP -#define INCLUDED_UHD_USRP_SINGLE_USRP_HPP - -#include <uhd/usrp/multi_usrp.hpp> - -namespace uhd{ namespace usrp{ - - //! Multi-USRP is a superset of Single-USRP - typedef multi_usrp single_usrp; - -}} - -#endif /* INCLUDED_UHD_USRP_SINGLE_USRP_HPP */ diff --git a/host/lib/deprecated.cpp b/host/lib/deprecated.cpp index eeaba03cb..dd4cc02ad 100644 --- a/host/lib/deprecated.cpp +++ b/host/lib/deprecated.cpp @@ -153,3 +153,53 @@ void wax::obj::get(const obj &, obj &){ void wax::obj::set(const obj &, const obj &){ throw uhd::type_error("Cannot call set on wax obj base class"); } + +#include <uhd/types/otw_type.hpp> +#include <uhd/types/io_type.hpp> +#include <boost/cstdint.hpp> +#include <stdexcept> +#include <complex> +#include <vector> + +using namespace uhd; + +/*********************************************************************** + * otw type + **********************************************************************/ +size_t otw_type_t::get_sample_size(void) const{ + return (this->width * 2) / 8; +} + +otw_type_t::otw_type_t(void): + width(0), + shift(0), + byteorder(BO_NATIVE) +{ + /* NOP */ +} + +/*********************************************************************** + * io type + **********************************************************************/ +static std::vector<size_t> get_tid_size_table(void){ + std::vector<size_t> table(128, 0); + table[size_t(io_type_t::COMPLEX_FLOAT64)] = sizeof(std::complex<double>); + table[size_t(io_type_t::COMPLEX_FLOAT32)] = sizeof(std::complex<float>); + table[size_t(io_type_t::COMPLEX_INT16)] = sizeof(std::complex<boost::int16_t>); + table[size_t(io_type_t::COMPLEX_INT8)] = sizeof(std::complex<boost::int8_t>); + return table; +} + +static const std::vector<size_t> tid_size_table(get_tid_size_table()); + +io_type_t::io_type_t(tid_t tid): + size(tid_size_table[size_t(tid) & 0x7f]), tid(tid) +{ + /* NOP */ +} + +io_type_t::io_type_t(size_t size): + size(size), tid(CUSTOM_TYPE) +{ + /* NOP */ +} diff --git a/host/lib/types/types.cpp b/host/lib/types/types.cpp index 7c65d2997..1a3e7e860 100644 --- a/host/lib/types/types.cpp +++ b/host/lib/types/types.cpp @@ -17,12 +17,6 @@ #include <uhd/types/stream_cmd.hpp> #include <uhd/types/metadata.hpp> -#include <uhd/types/otw_type.hpp> -#include <uhd/types/io_type.hpp> -#include <boost/cstdint.hpp> -#include <stdexcept> -#include <complex> -#include <vector> using namespace uhd; @@ -48,44 +42,3 @@ tx_metadata_t::tx_metadata_t(void): { /* NOP */ } - -/*********************************************************************** - * otw type - **********************************************************************/ -size_t otw_type_t::get_sample_size(void) const{ - return (this->width * 2) / 8; -} - -otw_type_t::otw_type_t(void): - width(0), - shift(0), - byteorder(BO_NATIVE) -{ - /* NOP */ -} - -/*********************************************************************** - * io type - **********************************************************************/ -static std::vector<size_t> get_tid_size_table(void){ - std::vector<size_t> table(128, 0); - table[size_t(io_type_t::COMPLEX_FLOAT64)] = sizeof(std::complex<double>); - table[size_t(io_type_t::COMPLEX_FLOAT32)] = sizeof(std::complex<float>); - table[size_t(io_type_t::COMPLEX_INT16)] = sizeof(std::complex<boost::int16_t>); - table[size_t(io_type_t::COMPLEX_INT8)] = sizeof(std::complex<boost::int8_t>); - return table; -} - -static const std::vector<size_t> tid_size_table(get_tid_size_table()); - -io_type_t::io_type_t(tid_t tid): - size(tid_size_table[size_t(tid) & 0x7f]), tid(tid) -{ - /* NOP */ -} - -io_type_t::io_type_t(size_t size): - size(size), tid(CUSTOM_TYPE) -{ - /* NOP */ -} |