From 77e9cbb40fc22de20f9cd13655fd9c9fce4f40f6 Mon Sep 17 00:00:00 2001 From: Jon Kiser Date: Mon, 2 Feb 2015 17:14:33 -0800 Subject: e300/docs: updated manual with E3x0 audio jack pinout --- host/docs/res/TRRS.png | Bin 0 -> 2955 bytes host/docs/usrp_e3x0.dox | 5 +++++ 2 files changed, 5 insertions(+) create mode 100755 host/docs/res/TRRS.png diff --git a/host/docs/res/TRRS.png b/host/docs/res/TRRS.png new file mode 100755 index 000000000..78619c869 Binary files /dev/null and b/host/docs/res/TRRS.png differ diff --git a/host/docs/usrp_e3x0.dox b/host/docs/usrp_e3x0.dox index f93326bee..38bf8d926 100644 --- a/host/docs/usrp_e3x0.dox +++ b/host/docs/usrp_e3x0.dox @@ -362,6 +362,11 @@ For more advanced IMU based applications please refer to the Date: Wed, 4 Feb 2015 11:06:31 -0800 Subject: uhd: Added image script outputs to .gitignore --- images/.gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/images/.gitignore b/images/.gitignore index 8947b7a83..6cebd43d7 100644 --- a/images/.gitignore +++ b/images/.gitignore @@ -1,2 +1,7 @@ /build /images +uhdimgs.pyc +uhd-images*.tar.gz +uhd-images*.tar.xz +uhd-images*.zip +uhd-images*.md5 -- cgit v1.2.3 From 38cfd24f7e4cbb4a6811ab6a41507a91e23bd748 Mon Sep 17 00:00:00 2001 From: Ashish Chaudhari Date: Wed, 4 Feb 2015 11:31:47 -0800 Subject: uhd: Fixed cmake variable for images source for packaging - UHD_IMAGES_SRC_DIR is now used to pull in images for packaging --- host/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index 3e01cfe6c..e2937edd3 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -382,16 +382,16 @@ UHD_INSTALL( ) ######################################################################## -# Handle pre-built UHD Images meant for installation +# Handle pre-built UHD Images for packaging ######################################################################## -IF(DEFINED UHD_IMAGES_DIR AND EXISTS "${UHD_IMAGES_DIR}") - FILE(GLOB_RECURSE _image_files "${UHD_IMAGES_DIR}/*") +IF(DEFINED UHD_IMAGES_SRC_DIR AND EXISTS "${UHD_IMAGES_SRC_DIR}") + FILE(GLOB_RECURSE _image_files "${UHD_IMAGES_SRC_DIR}/*") MESSAGE(STATUS "Using images:") FOREACH(_img ${_image_files}) MESSAGE(STATUS " ${_img}") ENDFOREACH(_img) UHD_INSTALL(FILES ${_image_files} DESTINATION ${PKG_DATA_DIR}/images COMPONENT images) -ENDIF(DEFINED UHD_IMAGES_DIR AND EXISTS "${UHD_IMAGES_DIR}") +ENDIF(DEFINED UHD_IMAGES_SRC_DIR AND EXISTS "${UHD_IMAGES_SRC_DIR}") ######################################################################## # Print Summary -- cgit v1.2.3 From 4dc4c3cd700db5b1e66ca2be275bf5f743a75c8e Mon Sep 17 00:00:00 2001 From: Rajib Bhattacharjea Date: Wed, 4 Feb 2015 14:48:04 -0500 Subject: examples: Show set_rx_bandwidth units properly in MHz in all examples Conflicts: host/examples/rx_samples_to_file.cpp --- host/examples/rx_ascii_art_dft.cpp | 4 ++-- host/examples/rx_samples_to_file.cpp | 4 ++-- host/examples/rx_samples_to_udp.cpp | 4 ++-- host/examples/txrx_loopback_to_file.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/host/examples/rx_ascii_art_dft.cpp b/host/examples/rx_ascii_art_dft.cpp index 81208cf8b..c73e57459 100644 --- a/host/examples/rx_ascii_art_dft.cpp +++ b/host/examples/rx_ascii_art_dft.cpp @@ -110,9 +110,9 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ //set the analog frontend filter bandwidth if (vm.count("bw")){ - std::cout << boost::format("Setting RX Bandwidth: %f MHz...") % bw << std::endl; + std::cout << boost::format("Setting RX Bandwidth: %f MHz...") % (bw/1e6) << std::endl; usrp->set_rx_bandwidth(bw); - std::cout << boost::format("Actual RX Bandwidth: %f MHz...") % usrp->get_rx_bandwidth() << std::endl << std::endl; + std::cout << boost::format("Actual RX Bandwidth: %f MHz...") % (usrp->get_rx_bandwidth()/1e6) << std::endl << std::endl; } //set the antenna diff --git a/host/examples/rx_samples_to_file.cpp b/host/examples/rx_samples_to_file.cpp index 4fe438798..975a9da88 100644 --- a/host/examples/rx_samples_to_file.cpp +++ b/host/examples/rx_samples_to_file.cpp @@ -300,9 +300,9 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ //set the analog frontend filter bandwidth if (vm.count("bw")){ - std::cout << boost::format("Setting RX Bandwidth: %f MHz...") % bw << std::endl; + std::cout << boost::format("Setting RX Bandwidth: %f MHz...") % (bw/1e6) << std::endl; usrp->set_rx_bandwidth(bw); - std::cout << boost::format("Actual RX Bandwidth: %f MHz...") % usrp->get_rx_bandwidth() << std::endl << std::endl; + std::cout << boost::format("Actual RX Bandwidth: %f MHz...") % (usrp->get_rx_bandwidth()/1e6) << std::endl << std::endl; } //set the antenna diff --git a/host/examples/rx_samples_to_udp.cpp b/host/examples/rx_samples_to_udp.cpp index 9accdef83..9a8a3f4ac 100644 --- a/host/examples/rx_samples_to_udp.cpp +++ b/host/examples/rx_samples_to_udp.cpp @@ -93,9 +93,9 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ //set the analog frontend filter bandwidth if (vm.count("bw")){ - std::cout << boost::format("Setting RX Bandwidth: %f MHz...") % bw << std::endl; + std::cout << boost::format("Setting RX Bandwidth: %f MHz...") % (bw/1e6) << std::endl; usrp->set_rx_bandwidth(bw); - std::cout << boost::format("Actual RX Bandwidth: %f MHz...") % usrp->get_rx_bandwidth() << std::endl << std::endl; + std::cout << boost::format("Actual RX Bandwidth: %f MHz...") % (usrp->get_rx_bandwidth()/1e6) << std::endl << std::endl; } //set the antenna diff --git a/host/examples/txrx_loopback_to_file.cpp b/host/examples/txrx_loopback_to_file.cpp index f8c8b9785..4eb6daa6c 100644 --- a/host/examples/txrx_loopback_to_file.cpp +++ b/host/examples/txrx_loopback_to_file.cpp @@ -419,9 +419,9 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ //set the receive analog frontend filter bandwidth if (vm.count("rx-bw")){ - std::cout << boost::format("Setting RX Bandwidth: %f MHz...") % rx_bw << std::endl; + std::cout << boost::format("Setting RX Bandwidth: %f MHz...") % (rx_bw/1e6) << std::endl; rx_usrp->set_rx_bandwidth(rx_bw, channel); - std::cout << boost::format("Actual RX Bandwidth: %f MHz...") % rx_usrp->get_rx_bandwidth(channel) << std::endl << std::endl; + std::cout << boost::format("Actual RX Bandwidth: %f MHz...") % (rx_usrp->get_rx_bandwidth(channel)/1e6) << std::endl << std::endl; } } //set the receive antenna -- cgit v1.2.3 From 064634b05c9e94ef11b9a8779d389b97e46fb3de Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Mon, 9 Feb 2015 16:25:45 -0800 Subject: uhd::paths: Fixed empty string in error message --- host/lib/utils/paths.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/host/lib/utils/paths.cpp b/host/lib/utils/paths.cpp index e304555bd..4a95431b8 100644 --- a/host/lib/utils/paths.cpp +++ b/host/lib/utils/paths.cpp @@ -348,6 +348,7 @@ std::string uhd::find_image_path(const std::string &image_name, const std::strin } /* If we made it this far, then we didn't find anything. */ + images_dir = ""; throw uhd::io_error("Could not find path for image: " + image_name + "\n\n" + "Using images directory: " + images_dir -- cgit v1.2.3 From b10c9dd446f0b0567e6b16add0fc8004d465d76e Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Tue, 10 Feb 2015 15:56:50 -0800 Subject: uhd::paths - fixing `get_app_path` to use correct `get_env_var` function Also added new enviornment variable, "UHDCALIBPATH", so that users can use something other than system-required environment paths. --- host/lib/utils/paths.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/host/lib/utils/paths.cpp b/host/lib/utils/paths.cpp index e304555bd..235c2607d 100644 --- a/host/lib/utils/paths.cpp +++ b/host/lib/utils/paths.cpp @@ -173,11 +173,14 @@ std::string uhd::get_tmp_path(void){ } std::string uhd::get_app_path(void){ - const char *appdata_path = std::getenv("APPDATA"); - if (appdata_path != NULL) return appdata_path; + const std::string uhdcalib_path = get_env_var("UHDCALIBPATH"); + if (not uhdcalib_path.empty()) return uhdcalib_path; - const char *home_path = std::getenv("HOME"); - if (home_path != NULL) return home_path; + const std::string appdata_path = get_env_var("APPDATA"); + if (not appdata_path.empty()) return appdata_path; + + const std::string home_path = get_env_var("HOME"); + if (not home_path.empty()) return home_path; return uhd::get_tmp_path(); } -- cgit v1.2.3 From ac958d47e8c7c4e0ee6a010d3e5a592d392e9206 Mon Sep 17 00:00:00 2001 From: Jon Kiser Date: Mon, 2 Feb 2015 11:49:09 -0800 Subject: ad936x: removing gain_offset from rx set_gain --- host/lib/usrp/common/ad9361_ctrl.hpp | 2 +- .../usrp/common/ad9361_driver/ad9361_device.cpp | 25 +++++----------------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/host/lib/usrp/common/ad9361_ctrl.hpp b/host/lib/usrp/common/ad9361_ctrl.hpp index 16e1d23eb..c5718302f 100644 --- a/host/lib/usrp/common/ad9361_ctrl.hpp +++ b/host/lib/usrp/common/ad9361_ctrl.hpp @@ -52,7 +52,7 @@ public: static uhd::meta_range_t get_gain_range(const std::string &which) { if(which[0] == 'R') { - return uhd::meta_range_t(0.0, 73.0, 1.0); + return uhd::meta_range_t(0.0, 76.0, 1.0); } else { return uhd::meta_range_t(0.0, 89.75, 0.25); } diff --git a/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp b/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp index 97b214d7d..d3e53c80f 100644 --- a/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp +++ b/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp @@ -1854,31 +1854,16 @@ double ad9361_device_t::tune(direction_t direction, const double value) /* Set the gain of RX1, RX2, TX1, or TX2. * - * Note that the 'value' passed to this function is the actual gain value, - * _not_ the gain index. This is the opposite of the eval software's GUI! - * Also note that the RX chains are done in terms of gain, and the TX chains - * are done in terms of attenuation. */ + * Note that the 'value' passed to this function is the gain index + * for RX. Also note that the RX chains are done in terms of gain, and + * the TX chains are done in terms of attenuation. */ double ad9361_device_t::set_gain(direction_t direction, chain_t chain, const double value) { boost::lock_guard lock(_mutex); if (direction == RX) { - /* Indexing the gain tables requires an offset from the requested - * amount of total gain in dB: - * < 1300MHz: dB + 5 - * >= 1300MHz and < 4000MHz: dB + 3 - * >= 4000MHz and <= 6000MHz: dB + 14 - */ - int gain_offset = 0; - if (_rx_freq < 1300e6) { - gain_offset = 5; - } else if (_rx_freq < 4000e6) { - gain_offset = 3; - } else { - gain_offset = 14; - } - int gain_index = static_cast(value + gain_offset); + int gain_index = static_cast(value); /* Clip the gain values to the proper min/max gain values. */ if (gain_index > 76) @@ -1894,7 +1879,7 @@ double ad9361_device_t::set_gain(direction_t direction, chain_t chain, const dou _io_iface->poke8(0x10c, gain_index); } - return gain_index - gain_offset; + return gain_index; } else { /* Setting the below bits causes a change in the TX attenuation word * to immediately take effect. */ -- cgit v1.2.3 From 08267a8c0264e08fe6631ce2ede0ec2c2933463f Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Wed, 11 Feb 2015 16:28:35 -0800 Subject: Creating the $UHD_CONFIG_DIR env var, here used for custom cal data storage. This is a renaming of the previously created $UHDCALIBPATH. --- host/docs/calibration.dox | 18 +++++++++++++----- host/lib/utils/paths.cpp | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/host/docs/calibration.dox b/host/docs/calibration.dox index 603ae22e4..eecb7af5c 100644 --- a/host/docs/calibration.dox +++ b/host/docs/calibration.dox @@ -57,15 +57,23 @@ daughterboard's EEPROM: : \subsection calibration_data Calibration Data -Calibration files are stored in the user's home/application directory. -They can easily be moved from machine to another by copying the "cal" -directory. Re-running a calibration utility will replace the existing -calibration file. The old calibration file will be renamed so it may be -recovered by the user. +By default, calibration files are stored in the user's home/application +directory: - **Linux:** `${HOME}/.uhd/cal/` - **Windows:** `%APPDATA%\.uhd\cal\` +If you would like to specify a custom directory, you can do so with the +`$UHD_CONFIG_DIR` environment variable: + +- **Custom (any OS):** `${UHD_CONFIG_DIR}/.uhd/cal/` + +Calibration files can easily be moved from one machine to another by copying the +"cal" directory. Re-running a calibration utility will replace the existing +calibration file. The old calibration file will be renamed so it may be +recovered by the user. + + \subsection ignore_cal_file Ignoring Calibration Files At runtime, the user can choose to ignore a daughterboard's calibration file by adding "ignore-cal-file" to the arguments. With the UHD API, it can be done as follows: diff --git a/host/lib/utils/paths.cpp b/host/lib/utils/paths.cpp index 235c2607d..88bd25fbd 100644 --- a/host/lib/utils/paths.cpp +++ b/host/lib/utils/paths.cpp @@ -173,7 +173,7 @@ std::string uhd::get_tmp_path(void){ } std::string uhd::get_app_path(void){ - const std::string uhdcalib_path = get_env_var("UHDCALIBPATH"); + const std::string uhdcalib_path = get_env_var("UHD_CONFIG_DIR"); if (not uhdcalib_path.empty()) return uhdcalib_path; const std::string appdata_path = get_env_var("APPDATA"); -- cgit v1.2.3