aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/lib
Commit message (Collapse)AuthorAgeFilesLines
* mpm: ad937x: Fix tuning codeMartin Braun2022-04-111-2/+53
| | | | | | | | | | | | This fixes a known issue (see TODO) that the N300 and N310 have sub-Hz tuning inaccuracies. In fact, these are explained in the corresponding User Guide (UG-992). This commit modifies MPM to return the actual frequency when calling into ad937x_device::tune() or ad937x_device::get_freq(), instead of the nearest integer value. Co-authored-by: Arthur Moraes do Lago <arthurmoraeslago@gmail.com>
* n310: Add Filter API to n310mattprost2022-04-073-17/+70
| | | | | | | | | | Add the Filter API to n3xx specifically for the AD937x device. The TX filter is limited to 32 taps, and the RX filter is limited to 48 taps. This feature requires MPM version 4.2 or later on the device. Co-authored-by: bpadalino <bpadalino@gmail.com> Signed-off-by: mattprost <matt.prost@ni.com>
* n310: Add frontend bandwidth controlmattprost2022-04-071-10/+33
| | | | | | | | | | | | Allow users to control the Mykonos frontend bandwidth settings for Rx and Tx. Note that this operation requires the daughterboard to re-initialize, so it may take some time. Values for frontend filter settings were derived using ADI's AD9371 Filter Wizard. This feature requires MPM version 4.1 or later on the device. Co-authored-by: bpadalino <bpadalino@gmail.com> Signed-off-by: mattprost <matt.prost@ni.com>
* cmake: Replace CMAKE_{SOURCE,BINARY}_DIR with UHD_*_DIRMartin Braun2021-09-104-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | See the CMake 3.8 documentation on these two variables: https://cmake.org/cmake/help/v3.8/variable/PROJECT-NAME_SOURCE_DIR.html https://cmake.org/cmake/help/v3.8/variable/CMAKE_SOURCE_DIR.html Under normal circumstances, these two are identical. For sub-projects (i.e., when building UHD as part of something else that is also a CMake project), only the former is useful. There is no discernible downside of using UHD_SOURCE_DIR over CMAKE_SOURCE_DIR. This was changed using sed: $ sed -i "s/CMAKE_SOURCE_DIR/UHD_SOURCE_DIR/g" \ `ag -l CMAKE_SOURCE_DIR **/{CMakeLists.txt,*.cmake}` $ sed -i "s/CMAKE_BINARY_DIR/UHD_BINARY_DIR/g" \ `ag -l CMAKE_BINARY_DIR **/{CMakeLists.txt,*.cmake}` At the same time, we also replace the CMake variable UHD_HOST_ROOT (used in MPM) with UHD_SOURCE_DIR. There's no reason to have two variables with the same meaning and different names, but more importantly, this means that UHD_SOURCE_DIR is defined even in those cases where MPM calls into CMake files from UHD without any additional patches. Shoutout to GitHub user marcobergamin for bringing this up.
* host: Add static_assert to prevent meta_range_t(0,0)Lane Kolbly2021-07-141-1/+1
| | | | | | | meta_range_t(0,0) actually calls the iterator-based constructor for meta_range_t, which is almost certainly not the intended constructor for that call syntax. Therefore, we add a static_assert to prevent such usage, and fix all failing instances.
* uhd: Add support for the USRP X410Lars Amsel2021-06-1016-9/+12869
| | | | | | | | | | | | | | | | Co-authored-by: Lars Amsel <lars.amsel@ni.com> Co-authored-by: Michael Auchter <michael.auchter@ni.com> Co-authored-by: Martin Braun <martin.braun@ettus.com> Co-authored-by: Paul Butler <paul.butler@ni.com> Co-authored-by: Cristina Fuentes <cristina.fuentes-curiel@ni.com> Co-authored-by: Humberto Jimenez <humberto.jimenez@ni.com> Co-authored-by: Virendra Kakade <virendra.kakade@ni.com> Co-authored-by: Lane Kolbly <lane.kolbly@ni.com> Co-authored-by: Max Köhler <max.koehler@ni.com> Co-authored-by: Andrew Lynch <andrew.lynch@ni.com> Co-authored-by: Grant Meyerhoff <grant.meyerhoff@ni.com> Co-authored-by: Ciro Nishiguchi <ciro.nishiguchi@ni.com> Co-authored-by: Thomas Vogel <thomas.vogel@ni.com>
* mpm: Remove logging for mmap_regs_ifaceMartin Braun2021-04-121-2/+0
| | | | | These are very noisy, and the signal-to-noise ratio suffers when these are enabled.
* mpm: Implement 32 bit register interface with SPIToni Jones2021-03-043-8/+95
| | | | | | | | | Implement SPI transfers which are 12 bytes in length to support access for 32 bit register interfaces. 12 byte transactions are necessary for Titanium MB PS CPLD SPI transactions. This implementation supports 48 bits of TX data per transfer and offsets all flags and data shifts from the end of the TX data portion of the transfer buffer rather than the end of the entire transfer buffer.
* mpm: Apply clang-format against all .cpp and .hpp filesMartin Braun2020-03-034-11/+18
|
* mpm: catalina: Add thread.cpp from UHD to included filesMartin Braun2020-02-101-0/+13
| | | | | This avoids a linker error where set_thread_name and set_thread_priority cannot be found.
* mpm: Add compile flag to fix missing definitionCiro Nishiguchi2020-01-161-0/+4
| | | | | In some environments _GNU_SOURCE must be defined to use O_LARGEFILE.
* uhd: Replace usage of boost smart pointers with C++11 counterpartsMartin Braun2019-11-262-15/+8
| | | | | | | | | | | | | | | | | | | This removes the following Boost constructs: - boost::shared_ptr, boost::weak_ptr - boost::enable_shared_from_this - boost::static_pointer_cast, boost::dynamic_pointer_cast The appropriate includes were also removed. All C++11 versions of these require #include <memory>. Note that the stdlib and Boost versions have the exact same syntax, they only differ in the namespace (boost vs. std). The modifications were all done using sed, with the exception of boost::scoped_ptr, which was replaced by std::unique_ptr. References to boost::smart_ptr were also removed. boost::intrusive_ptr is not removed in this commit, since it does not have a 1:1 mapping to a C++11 construct.
* Remove proto-RFNoC filesMartin Braun2019-11-262-53/+0
| | | | | | | This commit removes all files and parts of files that are used by proto-RFNoC only. uhd: Fix include CMakeLists.txt, add missing files
* mpm: i2cdev: Use O_LARGEFILE to open i2c devicesMartin Braun2019-11-221-1/+2
|
* mpm: i2cdev: Fix formatting and compiler warningsMartin Braun2019-11-221-11/+12
| | | | | | | | - Remove superfluous includes - Fix return value of _open() (was int, now void) => Fewer compiler warnings - Apply clang-format - Add {} to all ifs
* MPM: Fix version string for loggermichael-west2019-10-151-1/+8
| | | | | | | | Added configuration of version.cpp file so @UHD_VERSION@ would be properly replaced by the version string and @UHD_COMPONENT@ would be properly replaced by the component string. Signed-off-by: michael-west <michael.west@ettus.com>
* ad937x: increase default dc offset averaging windowMark Meserve2019-10-101-0/+19
| | | | | | - Fixes an issue where RX with close in signals (<5 kHz) had large discontinuities in IQ data - For <1 kHz, an LO offset should be used
* e310/e320: Move E310 to MPM architecture and refactorSugandha Gupta2019-05-013-1/+84
| | | | | | | | | | | | - Turns the E310 into an MPM device (like N3xx, E320) - Factor out common code between E320 and E310, maximize sharing between the two devices - Remove all pre-MPM E310 code that is no longer needed - Modify MPM to remove all existing overlays before applying new ones (this is necessary to enable idle image mode for E310) Co-authored-by: Virendra Kakade <virendra.kakade@ni.com> Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
* uhd: mpm: update all license header w/ "-or-later"Brent Stapleton2019-03-089-9/+9
| | | | Updating all SPDX license identifiers to include "-or-later"
* mpm: lib: mykonos: adi_ctrl: Remove unused variableMoritz Fischer2019-02-151-2/+0
| | | | | | | Remove unused variable data_word that never gets set, but never read. Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
* mpm: lib: mykonos: ad937x_device: Remove unused variableMoritz Fischer2019-02-151-3/+0
| | | | | | | Remove unused 'coerced_value' variable since nobody reads it ever. Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
* uhd: mpm: apply clang-format to all filesBrent Stapleton2019-01-1624-1725/+1770
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Applying formatting changes to all .cpp and .hpp files in the following directories: ``` find host/examples/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/tests/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/lib/usrp/dboard/neon/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/lib/usrp/dboard/magnesium/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/lib/usrp/device3/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/lib/usrp/mpmd/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/lib/usrp/x300/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/utils/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find mpm/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file ``` Also formatted host/include/, except Cpp03 was used as a the language standard instead of Cpp11. ``` sed -i 's/ Cpp11/ Cpp03/g' .clang-format find host/include/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file ``` Formatting style was designated by the .clang-format file.
* cmake: Update coding style to use lowercase commandsMartin Braun2018-11-148-46/+46
| | | | | | | | | | | | | | | | | Also updates our coding style file. Ancient CMake versions required upper-case commands. Later command names became case-insensitive. Now the preferred style is lower-case. Run the following shell code (with GNU compliant sed): cmake --help-command-list | grep -v "cmake version" | while read c; do echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g' done > convert.sed \ && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' \ '*CMakeLists.txt' | xargs -0 gsed -i -f convert.sed && rm convert.sed (Make sure the backslashes don't get mangled!)
* mpm: i2c: Open and close i2c file descriptor on every accessAlex Williams2018-11-121-22/+42
| | | | | | This will release the i2c device when it's not in use. If MPM hangs on to the i2c devices, we won't be able to cleanly change FPGA images--The kernel hangs up the process until the refcount drops to zero.
* mpm: i2c: Add vector-based transfer functionAlex Williams2018-10-191-0/+18
| | | | This could lead to a less-restricted implementation for use in Python.
* mpm: Add i2c APIs for simple transfersAlex Williams2018-10-196-0/+386
|
* mpm: initial commit of E320 codeBrent Stapleton2018-07-184-2/+137
| | | | Co-authored-by: Sugandha Gupta <sugandha.gupta@ettus.com>
* mpm: ad9371: Accept PID 0x01 as well as 0x03Martin Braun2018-06-281-1/+5
|
* mpm: replace long execution function with async callTrung N Tran2018-04-301-7/+7
| | | | | | - Replace mykonos finish_initialization with async version - Replace myknonos setup_cal with async version - Remove disable_timeout on rpc_server init()
* mpm: Use configurable components for build systemAlex Williams2018-04-182-4/+4
| | | | | For a minimal build, default to off for components unless the MPM_DEVICE or the user requests it specifically.
* mg: fix char printout of arm versionMark Meserve2018-03-081-3/+3
|
* mpm: break up device compilationBrent Stapleton2018-03-052-5/+9
| | | | Breaking up dboard compilation based on the target MPM_DEVICE.
* mpm: Update all license headersMartin Braun2018-02-1923-46/+46
| | | | | - Fix typo in company name (missing 'a') - Updated SPDX license identifier to version 3.0
* mpm: ad937x: implement set_bw_filterTrung N Tran2018-02-083-6/+24
|
* mpm: ad9371: Enable separate RX1/RX2 enable pinsTrung N Tran2018-02-081-2/+2
| | | | | | For each channel, we have individual enable input trigger. Reviewed-by: Martin Braun <martin.braun@ettus.com>
* mpm: ad937x: RefactorMartin Braun2018-01-223-138/+271
| | | | | | - No functional changes - const-ify parameters and local variables where appropriate - Fix long lines and inconsistent formatting
* mpm: mg: Pass deserializer_lane_xbar to ad937x_configTrung N Tran2018-01-126-8/+13
| | | | | | | | | Slot A and Slot B are different in how the JESD lanes are connected. We now pass in different deserializer_lane_xbar config values for each slot. Reviewed-by: Martin Braun <martin.braun@ettus.com> Reviewed-by: Daniel Jepson <daniel.jepson@ettus.com> Reviewed-by: Mark Meserve <mark.meserve@ni.com>
* mpm: Harmonize all license headerMartin Braun2017-12-2229-315/+76
| | | | Now uses SPDX headers everywhere.
* mpm: Add mmap_regs_ifaceMartin Braun2017-12-222-0/+118
| | | | | | | This is a C++-based peek/poke interface into mmaped objects. Useful for better control over UIO devices. Reviewed-By: Brent Stapleton <brent.stapleton@ettus.com>
* mpm: Fix floating-point errors in MCR configurationMartin Braun2017-12-223-83/+114
| | | | | | Use fuzzy comparisons for setting the MCR. Reviewed-By: Trung Tran <trung.tran@ettus.com>
* mpm: Enable TX external LO set through args, simplify codeTrung N Tran2017-12-225-48/+67
| | | | | | | Simplify the process of setting external LO without calling through many API layers. Reviewed-By: Martin Braun <martin.braun@ettus.com>
* mpm: mykonos: Increase SPI speed to 20 MHzTrung N Tran2017-12-221-1/+1
|
* mpm: mykonos: Add API to change master clock rateTrung N Tran2017-12-226-9/+126
|
* mpm: ad937x: Add LO lock APIMartin Braun2017-12-221-0/+11
| | | | | Reviewed-By: Steven Bingler <steven.bingler@ni.com> Reviewed-By: Trung Tran <trung.tran@ettus.com>
* mpm: Minor spidev fixesMartin Braun2017-12-221-18/+5
| | | | Fixes some compiler warnings.
* mpm: lib: ad937x: Change _get_arm_binary_pathMoritz Fischer2017-12-221-1/+1
| | | | | | | The firmware will be installed under /lib/firmware/adi/mykonos-m3.bin, so going forward this is the path we require. Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
* mpm: enable RX external LO set through argsTrung N Tran2017-12-225-5/+50
| | | | | | | | | This change allow user to set RX LO of ad9371 to external or internal from args constructor of usrp device. new args is rx_lo_source value can be either internal or external: If there's no rx_lo_source specified or invalid value, default rx_lo is used; which is internal LO. Usage example: usrp_application --args "rx_lo_source=external"
* mg: enable init and track calibration APITrung Tran2017-12-223-58/+75
| | | | | | | | | | | | | | | | | | | Currently, AD9371 turned on most of the calibration and hard coding the turning on process during bringup time. This change enables users to pass in a mask field for init ARM calibration and tracking arm calibration at the time creating USRP device reference. This mask field can be passed through device arguments of: 1/ init_cals : for init ARM calibration masks. This is defined in AD9371 UG-992 table 65. Default to 0x4DFF 2/ tracking_cals : for tracking calibration masks. This is defined in AD9371 UG-992 table 66. Default to 0xC3 Example of pasing in init calibration and tracking calibration mask usrp_application --args "init_cals=0x4f, tracking_cals=0xC3" NOTE: UHD currently expect user to input the correct init_cals and tracking_cals. There's no mechanism to check if init mask and tracking mask are valid. For example if the init mask field not mask 0x4f, the AD9371 will failed to setup.
* mpm: ad937x: Make log functions go through central loggerMartin Braun2017-12-221-5/+26
| | | | Reviewed-By: Mark Meserve <mark.meserve@ni.com>
* mpm: Add log_buf classMartin Braun2017-12-222-0/+65
| | | | | | | This is a buffer for log messages, designed for getting log messages from C++ back into Python. Reviewed-By: Mark Meserve <mark.meserve@ni.com>