Commit graph

38 commits

Author SHA1 Message Date
Martin Braun
3b080f7ff5 mpm: ad937x: Refactor
- No functional changes
- const-ify parameters and local variables where appropriate
- Fix long lines and inconsistent formatting
2018-01-22 14:57:23 -08:00
Trung N Tran
7ffea3746b mpm: mg: Pass deserializer_lane_xbar to ad937x_config
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>
2018-01-12 16:21:15 -08:00
Martin Braun
8815098747 mpm: Harmonize all license header
Now uses SPDX headers everywhere.
2017-12-22 15:05:58 -08:00
Martin Braun
3cff6298ce mpm: Add mmap_regs_iface
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>
2017-12-22 15:05:58 -08:00
Trung N Tran
b9a0cf1467 mpm: Enable TX external LO set through args, simplify code
Simplify the process of setting external LO without calling through many API
layers.

Reviewed-By: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:05:57 -08:00
Trung N Tran
2467deeb17 mpm: mykonos: Add API to change master clock rate 2017-12-22 15:05:07 -08:00
Martin Braun
688247e545 mpm: ad937x: Add LO lock API
Reviewed-By: Steven Bingler <steven.bingler@ni.com>
Reviewed-By: Trung Tran <trung.tran@ettus.com>
2017-12-22 15:05:07 -08:00
Trung N Tran
db7039f8be mpm: enable RX external LO set through args
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"
2017-12-22 15:05:06 -08:00
Trung Tran
9ea0d6da9e mg: enable init and track calibration API
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.
2017-12-22 15:05:06 -08:00
Martin Braun
5c63a83d22 mpm: Add log_buf class
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>
2017-12-22 15:05:06 -08:00
Mark Meserve
f58a4f20c5 ad937x: address TODOs in adi_ctrl
change error outputs
add comments to some functions
2017-12-22 15:04:01 -08:00
Mark Meserve
64c5bdbc92 ad937x: add missing docstrings to ctrl 2017-12-22 15:04:01 -08:00
Mark Meserve
04b0f414b9 mpm: ad937x: Updated controls 2017-12-22 15:04:01 -08:00
Mark Meserve
01ddd50e55 mpm: spi: Added 16-bit SPI transactions
- Adds convenience method to read 16-bit SPI transactions
- Fixes peek16 in spi_regs_iface to actually use 16-bit transactions
2017-12-22 15:04:01 -08:00
Mark Meserve
309a2f04e3 mg: General fixes
- Make DB probe-able
- Add RPC client
2017-12-22 15:04:00 -08:00
Martin Braun
8ebd4d8e5f mpm: spi: Added 16-bit access to SPI regs 2017-12-22 15:03:53 -08:00
Martin Braun
b39dafa1ee mpm: Enabled selection of SPI mode 2017-12-22 15:03:53 -08:00
Martin Braun
df9ca47ed1 mpm: eiscat: magnesium: Removed C++-only SPI ifaces
- EISCAT is now Python only with the exception of the definition of the
  SPI ifaces
- Magnesium uses a Python-generated SPI iface
- Removed SPI lock from EISCAT dboard
2017-12-22 15:03:52 -08:00
Martin Braun
0e7fe25f42 mpm: eiscat: Added first pass at EISCAT dboard driver 2017-12-22 15:03:52 -08:00
Martin Braun
fcf8715eab mpm: Exposed spi regs iface factory to Python 2017-12-22 15:03:52 -08:00
Martin Braun
cf6619992a mpm: Added peek/poke interface to ad937x_ctrl 2017-12-22 15:03:52 -08:00
Martin Braun
151ba5fb06 mpm: Major refactoring
- Created clean interfaces for SPI and registers
- Severed most links to UHD
- Added a lockable class which allows exposing mutexes into Python
2017-12-22 15:03:52 -08:00
Martin Braun
36365930a6 mpm: Fixed a plethora of SPI-related issues 2017-12-22 15:03:46 -08:00
Derek Kozel
f2f1204ea4 lmk: Update LMK04828 driver with values for Magnesium 2017-12-22 15:03:45 -08:00
Mark Meserve
5a3abf352c ad9371: Added JESD init functionality 2017-12-22 15:03:45 -08:00
Andrej Rode
6a12add156 mpm: mpm reorganization 2017-12-22 15:03:45 -08:00
Mark Meserve
701904882c mpm: Improved ad937x code
- Add gain control pin configuration
- Fixed gcc compilation
- Better docstrings
2017-12-22 15:03:45 -08:00
Mark Meserve
ae21f9b9d3 mpm: fixup for spi and ad937x path changes 2017-12-22 15:03:45 -08:00
Mark Meserve
51586a989e mpm: clean up spi
remove spi_lock
remove ad9371 spi_config types
2017-12-22 15:03:45 -08:00
Mark Meserve
306468d564 ad9371: update jesd default config 2017-12-22 15:03:44 -08:00
Mark Meserve
59d8fcaff2 ad9371: cleanup ctrl
remove device forward declaration
make helper functions local to ad9371_ctrl.cpp
fix UHD include paths
2017-12-22 15:03:44 -08:00
Martin Braun
663b7f05a3 Renamed or moved files (minor cleanup) 2017-12-22 15:03:44 -08:00
Andrej Rode
8ac9014d5c mpm: CMake cleanup, Python code enhancements
- Send user defined data in ping
- Improve rpc_shell, add mpm_debug.py, fix tracebacks in multiprocessing
2017-12-22 15:03:44 -08:00
Martin Braun
6d332e5ca4 mpm: move public includes into include/ 2017-12-22 15:03:44 -08:00
Andrej Rode
ef6326a174 mpm: python refactoring 2017-12-22 15:03:44 -08:00
Andrej Rode
b29246a9e2 mpm: add make factory to lmk04828 spi iface 2017-12-22 15:03:44 -08:00
Mark Meserve
bc4d1bf0ca mpm: Rearchitecture of AD9371 code to use ctrl/device paradigm 2017-12-22 15:03:44 -08:00
Martin Braun
1a4348038d Initial commit for N3xx development.
- Creates mpm/ subdirectory
- First pass at hardware daemon/MPM
- New code for LMK04828, AD9371
- spidev integration

Contributions by:

Martin Braun <martin.braun@ettus.com>
Derek Kozel <derek.kozel@ettus.com>
Mark Meserve <mark.meserve@ni.com>
Andrej Rode <andrej.rode@ettus.com>
2017-12-22 15:03:44 -08:00