summaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2012-02-17 18:18:26 -0800
committerJosh Blum <josh@joshknows.com>2012-02-17 18:18:26 -0800
commit3ddbcb6078593c39cb0e4bc8f9769f818a61466f (patch)
tree408e3f6a64e31b7d830b9f884ecebdaf100a5d2d /host/include
parent1fab7e9d477aa98e489400c25a08358952c69c90 (diff)
parentace4489066d1621a09e70650a00d736f0b03ed8c (diff)
downloaduhd-3ddbcb6078593c39cb0e4bc8f9769f818a61466f.tar.gz
uhd-3ddbcb6078593c39cb0e4bc8f9769f818a61466f.tar.bz2
uhd-3ddbcb6078593c39cb0e4bc8f9769f818a61466f.zip
Merge branch 'next'
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/stream.hpp8
-rw-r--r--host/include/uhd/types/metadata.hpp15
-rw-r--r--host/include/uhd/types/time_spec.hpp28
-rw-r--r--host/include/uhd/usrp/multi_usrp.hpp10
4 files changed, 53 insertions, 8 deletions
diff --git a/host/include/uhd/stream.hpp b/host/include/uhd/stream.hpp
index 352f63e4e..cec2eee79 100644
--- a/host/include/uhd/stream.hpp
+++ b/host/include/uhd/stream.hpp
@@ -79,9 +79,11 @@ struct UHD_API stream_args_t{
* The args parameter is used to pass arbitrary key/value pairs.
* Possible keys used by args (depends on implementation):
*
- * - scalar: an integer scaling factor used with the sc8 wire format.
- * The key/value pair scalar=1024 means that the sample in the DSP
- * was multiplied by 1024 before its upper 8 bits were harvested.
+ * - peak: specifies a fractional sample level to calculate scaling with the sc8 wire format.
+ * When using sc8 samples over the wire, the device must scale samples
+ * (both on the host and in the device) to satisfy the dynamic range needs.
+ * The peak value specifies a fraction of the maximum sample level (1.0 = 100%).
+ * Set peak to max_sample_level/full_scale_level to ensure optimum dynamic range.
*
* - underflow_policy: how the TX DSP should recover from underflow.
* Possible options are "next_burst" or "next_packet".
diff --git a/host/include/uhd/types/metadata.hpp b/host/include/uhd/types/metadata.hpp
index 269c77c7c..788999900 100644
--- a/host/include/uhd/types/metadata.hpp
+++ b/host/include/uhd/types/metadata.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010 Ettus Research LLC
+// Copyright 2010-2012 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
@@ -20,6 +20,7 @@
#include <uhd/config.hpp>
#include <uhd/types/time_spec.hpp>
+#include <boost/cstdint.hpp>
namespace uhd{
@@ -140,13 +141,21 @@ namespace uhd{
EVENT_CODE_UNDERFLOW = 0x2,
//! Packet loss between host and device.
EVENT_CODE_SEQ_ERROR = 0x4,
- //! Packet had time that was late (or too early).
+ //! Packet had time that was late.
EVENT_CODE_TIME_ERROR = 0x8,
//! Underflow occurred inside a packet.
EVENT_CODE_UNDERFLOW_IN_PACKET = 0x10,
//! Packet loss within a burst.
- EVENT_CODE_SEQ_ERROR_IN_BURST = 0x20
+ EVENT_CODE_SEQ_ERROR_IN_BURST = 0x20,
+ //! Some kind of custom user payload
+ EVENT_CODE_USER_PAYLOAD = 0x40
} event_code;
+
+ /*!
+ * A special payload populated by custom FPGA fabric.
+ */
+ boost::uint32_t user_payload[4];
+
};
} //namespace uhd
diff --git a/host/include/uhd/types/time_spec.hpp b/host/include/uhd/types/time_spec.hpp
index 02de20ea1..e7d7d5ab4 100644
--- a/host/include/uhd/types/time_spec.hpp
+++ b/host/include/uhd/types/time_spec.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2011 Ettus Research LLC
+// Copyright 2010-2012 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
@@ -60,7 +60,7 @@ namespace uhd{
time_spec_t(time_t full_secs, double frac_secs = 0);
/*!
- * Create a time_spec_t from whole and fractional seconds.
+ * Create a time_spec_t from whole seconds and fractional ticks.
* Translation from clock-domain specific units.
* \param full_secs the whole/integer seconds count
* \param tick_count the fractional seconds tick count
@@ -69,6 +69,14 @@ namespace uhd{
time_spec_t(time_t full_secs, long tick_count, double tick_rate);
/*!
+ * Create a time_spec_t from a 64-bit tick count.
+ * Translation from clock-domain specific units.
+ * \param ticks an integer count of ticks
+ * \param tick_rate the number of ticks per second
+ */
+ static time_spec_t from_ticks(long long ticks, double tick_rate);
+
+ /*!
* Convert the fractional seconds to clock ticks.
* Translation into clock-domain specific units.
* \param tick_rate the number of ticks per second
@@ -77,6 +85,14 @@ namespace uhd{
long get_tick_count(double tick_rate) const;
/*!
+ * Convert the time spec into a 64-bit tick count.
+ * Translation into clock-domain specific units.
+ * \param tick_rate the number of ticks per second
+ * \return an integer number of ticks
+ */
+ long long to_ticks(const double tick_rate) const;
+
+ /*!
* Get the time as a real-valued seconds count.
* Note: If this time_spec_t represents an absolute time,
* the precision of the fractional seconds may be lost.
@@ -112,6 +128,14 @@ namespace uhd{
//! Implement less_than_comparable interface
UHD_API bool operator<(const time_spec_t &, const time_spec_t &);
+ UHD_INLINE time_t time_spec_t::get_full_secs(void) const{
+ return this->_full_secs;
+ }
+
+ UHD_INLINE double time_spec_t::get_frac_secs(void) const{
+ return this->_frac_secs;
+ }
+
} //namespace uhd
#endif /* INCLUDED_UHD_TYPES_TIME_SPEC_HPP */
diff --git a/host/include/uhd/usrp/multi_usrp.hpp b/host/include/uhd/usrp/multi_usrp.hpp
index 49354f1af..88affa40c 100644
--- a/host/include/uhd/usrp/multi_usrp.hpp
+++ b/host/include/uhd/usrp/multi_usrp.hpp
@@ -24,6 +24,7 @@
#define UHD_USRP_MULTI_USRP_FRONTEND_CAL_API
#define UHD_USRP_MULTI_USRP_COMMAND_TIME_API
#define UHD_USRP_MULTI_USRP_BW_RANGE_API
+#define UHD_USRP_MULTI_USRP_USER_REGS_API
#include <uhd/config.hpp>
#include <uhd/device.hpp>
@@ -338,6 +339,15 @@ public:
*/
virtual std::vector<std::string> get_mboard_sensor_names(size_t mboard = 0) = 0;
+ /*!
+ * Perform write on the user configuration register bus. These only exist if
+ * the user has implemented custom setting registers in the device FPGA.
+ * \param addr 8-bit register address
+ * \param data 32-bit register value
+ * \param mboard which motherboard to set the user register
+ */
+ virtual void set_user_register(const boost::uint8_t addr, const boost::uint32_t data, size_t mboard = ALL_MBOARDS) = 0;
+
/*******************************************************************
* RX methods
******************************************************************/