summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gr-uhd/include/gr_uhd_usrp_sink.h39
-rw-r--r--gr-uhd/include/gr_uhd_usrp_source.h54
-rw-r--r--gr-uhd/lib/gr_uhd_usrp_sink.cc20
-rw-r--r--gr-uhd/lib/gr_uhd_usrp_source.cc28
4 files changed, 125 insertions, 16 deletions
diff --git a/gr-uhd/include/gr_uhd_usrp_sink.h b/gr-uhd/include/gr_uhd_usrp_sink.h
index 8c1056a79..ea703faa8 100644
--- a/gr-uhd/include/gr_uhd_usrp_sink.h
+++ b/gr-uhd/include/gr_uhd_usrp_sink.h
@@ -118,7 +118,7 @@ class GR_UHD_API uhd_usrp_sink : virtual public gr_sync_block{
public:
/*!
- * Set the subdevice specification.
+ * Set the frontend specification.
* \param spec the subdev spec markup string
* \param mboard the motherboard index 0 to M-1
*/
@@ -253,26 +253,53 @@ public:
virtual std::vector<std::string> get_antennas(size_t chan = 0) = 0;
/*!
- * Set the subdevice bandpass filter.
+ * Set the bandpass filter on the RF frontend.
* \param chan the channel index 0 to N-1
* \param bandwidth the filter bandwidth in Hz
*/
virtual void set_bandwidth(double bandwidth, size_t chan = 0) = 0;
/*!
- * Get a daughterboard sensor value.
+ * Set a constant DC offset value.
+ * The value is complex to control both I and Q.
+ * \param offset the dc offset (1.0 is full-scale)
+ * \param chan the channel index 0 to N-1
+ */
+ virtual void set_dc_offset(const std::complex<double> &offset, size_t chan = 0) = 0;
+
+ /*!
+ * Set the RX frontend IQ imbalance correction.
+ * Use this to adjust the magnitude and phase of I and Q.
+ *
+ * \param correction the complex correction (1.0 is full-scale)
+ * \param chan the channel index 0 to N-1
+ */
+ virtual void set_iq_balance(const std::complex<double> &correction, size_t chan = 0) = 0;
+
+ /*!
+ * Get an RF frontend sensor value.
* \param name the name of the sensor
* \param chan the channel index 0 to N-1
* \return a sensor value object
*/
- virtual uhd::sensor_value_t get_dboard_sensor(const std::string &name, size_t chan = 0) = 0;
+ virtual uhd::sensor_value_t get_sensor(const std::string &name, size_t chan = 0) = 0;
/*!
- * Get a list of possible daughterboard sensor names.
+ * Get a list of possible RF frontend sensor names.
* \param chan the channel index 0 to N-1
* \return a vector of sensor names
*/
- virtual std::vector<std::string> get_dboard_sensor_names(size_t chan = 0) = 0;
+ virtual std::vector<std::string> get_sensor_names(size_t chan = 0) = 0;
+
+ //! DEPRECATED use get_sensor
+ uhd::sensor_value_t get_dboard_sensor(const std::string &name, size_t chan = 0){
+ return this->get_sensor(name, chan);
+ }
+
+ //! DEPRECATED use get_sensor_names
+ std::vector<std::string> get_dboard_sensor_names(size_t chan = 0){
+ return this->get_sensor_names(chan);
+ }
/*!
* Get a motherboard sensor value.
diff --git a/gr-uhd/include/gr_uhd_usrp_source.h b/gr-uhd/include/gr_uhd_usrp_source.h
index 7a861e315..5830487bc 100644
--- a/gr-uhd/include/gr_uhd_usrp_source.h
+++ b/gr-uhd/include/gr_uhd_usrp_source.h
@@ -110,7 +110,7 @@ class GR_UHD_API uhd_usrp_source : virtual public gr_sync_block{
public:
/*!
- * Set the subdevice specification.
+ * Set the frontend specification.
* \param spec the subdev spec markup string
* \param mboard the motherboard index 0 to M-1
*/
@@ -245,26 +245,68 @@ public:
virtual std::vector<std::string> get_antennas(size_t chan = 0) = 0;
/*!
- * Set the subdevice bandpass filter.
+ * Set the bandpass filter on the RF frontend.
* \param bandwidth the filter bandwidth in Hz
* \param chan the channel index 0 to N-1
*/
virtual void set_bandwidth(double bandwidth, size_t chan = 0) = 0;
/*!
- * Get a daughterboard sensor value.
+ * Enable/disable the automatic DC offset correction.
+ * The automatic correction subtracts out the long-run average.
+ *
+ * When disabled, the averaging option operation is halted.
+ * Once halted, the average value will be held constant
+ * until the user re-enables the automatic correction
+ * or overrides the value by manually setting the offset.
+ *
+ * \param enb true to enable automatic DC offset correction
+ * \param chan the channel index 0 to N-1
+ */
+ virtual void set_dc_offset(const bool enb, size_t chan = 0) = 0;
+
+ /*!
+ * Set a constant DC offset value.
+ * The value is complex to control both I and Q.
+ * Only set this when automatic correction is disabled.
+ * \param offset the dc offset (1.0 is full-scale)
+ * \param chan the channel index 0 to N-1
+ */
+ virtual void set_dc_offset(const std::complex<double> &offset, size_t chan = 0) = 0;
+
+ /*!
+ * Set the RX frontend IQ imbalance correction.
+ * Use this to adjust the magnitude and phase of I and Q.
+ *
+ * \param correction the complex correction value
+ * \param chan the channel index 0 to N-1
+ */
+ virtual void set_iq_balance(const std::complex<double> &correction, size_t chan = 0) = 0;
+
+ /*!
+ * Get a RF frontend sensor value.
* \param name the name of the sensor
* \param chan the channel index 0 to N-1
* \return a sensor value object
*/
- virtual uhd::sensor_value_t get_dboard_sensor(const std::string &name, size_t chan = 0) = 0;
+ virtual uhd::sensor_value_t get_sensor(const std::string &name, size_t chan = 0) = 0;
/*!
- * Get a list of possible daughterboard sensor names.
+ * Get a list of possible RF frontend sensor names.
* \param chan the channel index 0 to N-1
* \return a vector of sensor names
*/
- virtual std::vector<std::string> get_dboard_sensor_names(size_t chan = 0) = 0;
+ virtual std::vector<std::string> get_sensor_names(size_t chan = 0) = 0;
+
+ //! DEPRECATED use get_sensor
+ uhd::sensor_value_t get_dboard_sensor(const std::string &name, size_t chan = 0){
+ return this->get_sensor(name, chan);
+ }
+
+ //! DEPRECATED use get_sensor_names
+ std::vector<std::string> get_dboard_sensor_names(size_t chan = 0){
+ return this->get_sensor_names(chan);
+ }
/*!
* Get a motherboard sensor value.
diff --git a/gr-uhd/lib/gr_uhd_usrp_sink.cc b/gr-uhd/lib/gr_uhd_usrp_sink.cc
index cd40dac20..cb17119b7 100644
--- a/gr-uhd/lib/gr_uhd_usrp_sink.cc
+++ b/gr-uhd/lib/gr_uhd_usrp_sink.cc
@@ -142,11 +142,27 @@ public:
return _dev->set_tx_bandwidth(bandwidth, chan);
}
- uhd::sensor_value_t get_dboard_sensor(const std::string &name, size_t chan){
+ void set_dc_offset(const std::complex<double> &offset, size_t chan){
+ #ifdef UHD_USRP_MULTI_USRP_FRONTEND_CAL_API
+ return _dev->set_tx_dc_offset(offset, chan);
+ #else
+ throw std::runtime_error("not implemented in this version");
+ #endif
+ }
+
+ void set_iq_balance(const std::complex<double> &correction, size_t chan){
+ #ifdef UHD_USRP_MULTI_USRP_FRONTEND_CAL_API
+ return _dev->set_tx_iq_balance(correction, chan);
+ #else
+ throw std::runtime_error("not implemented in this version");
+ #endif
+ }
+
+ uhd::sensor_value_t get_sensor(const std::string &name, size_t chan){
return _dev->get_tx_sensor(name, chan);
}
- std::vector<std::string> get_dboard_sensor_names(size_t chan){
+ std::vector<std::string> get_sensor_names(size_t chan){
return _dev->get_tx_sensor_names(chan);
}
diff --git a/gr-uhd/lib/gr_uhd_usrp_source.cc b/gr-uhd/lib/gr_uhd_usrp_source.cc
index 4f46fce79..421adafe1 100644
--- a/gr-uhd/lib/gr_uhd_usrp_source.cc
+++ b/gr-uhd/lib/gr_uhd_usrp_source.cc
@@ -146,11 +146,35 @@ public:
return _dev->set_rx_bandwidth(bandwidth, chan);
}
- uhd::sensor_value_t get_dboard_sensor(const std::string &name, size_t chan){
+ void set_dc_offset(const bool enable, size_t chan){
+ #ifdef UHD_USRP_MULTI_USRP_FRONTEND_CAL_API
+ return _dev->set_rx_dc_offset(enable, chan);
+ #else
+ throw std::runtime_error("not implemented in this version");
+ #endif
+ }
+
+ void set_dc_offset(const std::complex<double> &offset, size_t chan){
+ #ifdef UHD_USRP_MULTI_USRP_FRONTEND_CAL_API
+ return _dev->set_rx_dc_offset(offset, chan);
+ #else
+ throw std::runtime_error("not implemented in this version");
+ #endif
+ }
+
+ void set_iq_balance(const std::complex<double> &correction, size_t chan){
+ #ifdef UHD_USRP_MULTI_USRP_FRONTEND_CAL_API
+ return _dev->set_rx_iq_balance(correction, chan);
+ #else
+ throw std::runtime_error("not implemented in this version");
+ #endif
+ }
+
+ uhd::sensor_value_t get_sensor(const std::string &name, size_t chan){
return _dev->get_rx_sensor(name, chan);
}
- std::vector<std::string> get_dboard_sensor_names(size_t chan){
+ std::vector<std::string> get_sensor_names(size_t chan){
return _dev->get_rx_sensor_names(chan);
}