Commit graph

18 commits

Author SHA1 Message Date
Martin Braun
77511533a6 python: Move multi_usrp_python to its own module
This helps with recompilation times of UHD.
No functional changes.
2020-10-12 15:10:47 -05:00
Cristina Fuentes
2e64cb1b28 multi_usrp: Add get_mb_controller() API call 2020-09-24 15:16:45 -05:00
Martin Braun
b9f9ca2d0f uhd: Add APIs for getting the available power range
The previously added APIs for getting/setting power reference levels was
missing an option to read back the currently available power levels
(minimum and maximum power levels).
This adds getters for TX and RX power ranges to multi_usrp and
radio_control. The power API is thus now more similar to the gain API,
which always had getters for gain ranges.
2020-08-17 16:22:35 -05:00
Martin Braun
e4291f1ddc multi_usrp: Add get_radio_control() API call
This is an advanced API call that allows direct underlying
access to the radio_control object for RFNoC devices.
2020-07-16 15:17:26 -05:00
Martin Braun
91378ee07f uhd: Add reference power level API to multi_usrp and radio_control
This adds the has_* API calls to the Python API.
2020-05-11 16:00:05 -05:00
Martin Braun
a63682f981 uhd: Add reference power level API to multi_usrp and radio_control
This adds the following API calls:

- multi_usrp::has_{rx,tx}_power_reference()
- multi_usrp::set_{rx,tx}_power_reference()
- multi_usrp::get_{rx,tx}_power_reference()
- radio_control::has_{rx,tx}_power_reference()
- radio_control::set_{rx,tx}_power_reference()
- radio_control::get_{rx,tx}_power_reference()

It also adds a manual page explaining the philosophy of the API.

Note that this does not actually add this feature to any device
implementation. Calling the new API calls will thus result in
`uhd::not_implemented_error` exceptions being thrown. This commit is to
lock down the API and ABI.
2020-04-17 07:59:50 -05:00
Martin Braun
876d4150aa uhd: Apply clang-format against all .cpp and .hpp files in host/
Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of
files that clang-format gets applied against.
2020-03-03 08:51:32 -06:00
eklai
d7304cc724 x300: add front-panel GPIO source control
Adds a ZPU register to control the FP GPIO source. These are 2bits
per GPIO pin, totalling 24 bits. 0 corresponds to RF-A, 1 corresponds
to RF-B. The following Python code will control the upper 6 bits of the
front-panel GPIO from the B-side radio on an X300:

>>> import uhd
>>> U = uhd.usrp.MultiUSRP("type=x300")
>>> U.get_gpio_src_banks()
['FP0']
>>> U.get_gpio_src("FP0")
['RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA',
'RFA', 'RFA']
>>> U.set_gpio_src("FP0", ['RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA',
                           'RFB', 'RFB', 'RFB', 'RFB', 'RFB', 'RFB'])
>>> U.get_gpio_src("FP0")
['RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFB', 'RFB', 'RFB', 'RFB',
'RFB', 'RFB']
>>> # Make all GPIOs outputs:
>>> U.set_gpio_attr("FP0A", "DDR", 0xFFF)
>>> U.set_gpio_attr("FP0B", "DDR", 0xFFF)
>>> # Control all GPIOs from software (not ATR):
>>> U.set_gpio_attr("FP0A", "CTRL", 0x000)
>>> U.set_gpio_attr("FP0B", "CTRL", 0x000)
>>> # Bottom 3 pins go high from radio A
>>> U.set_gpio_attr("FP0A", "OUT", 0x007)
>>> # Top 3 pins go high from radio B
>>> U.set_gpio_attr("FP0B", "OUT", 0xE00)

Amends the gpio.cpp example to allow switching the source.

Co-authored-by: Brent Stapleton <brent.stapleton@ettus.com>
2020-02-18 07:21:24 -06:00
Brent Stapleton
23f4f8cf4e rfnoc: Add multi_usrp_rfnoc, modify multi_usrp
This adds a separate version of multi_usrp for RFNoC devices. It is
compatible with RFNoC devices only, and prefers C++ APIs over property
tree usage. The factory of multi_usrp is modified such that it picks the
correct version, users of multi_usrp don't care about this change.

This also introduces some API changes:
- Removing redundant GPIO functions. Now all GPIO control, setting, and
  readback is done with uint32_t's.
- Adding getter/setter for GPIO source. This was done to simplify the
  other GPIO settings, as the source for each pin is not always a
  binary. The CTRL mode, for example, can either be ATR or GPIO.
  However, the source can be controlled by various radios or "PS" or
  some other source.
- Removing the mask from the RFNoC radio controllers' set_gpio_attr().
- Adding state caching to gpio_atr_3000, and a getter for it. Whenever
  an attribute is set, that value is cached, and can now be retreieved.
- Remove low-level register API. Since UHD 3.10, there is no USRP that
  implements that API.
Modifying the filter API in the following ways:
- Splitting filter API getter/setter/list into separate RX and TX
  functions
- Adding channel numbers as an argument
- The filter name will no longer be a property tree path, but rather a
  filter name. For RFNoC devices, this will take the form
  `BLOCK_ID:FILTER_NAME`. For non-RFNoC devices, this will just be the
  filter name (e.g. `HB_1`)
- Removing search mask from listing function. Users can do their own
  searching

Co-Authored-By: Martin Braun <martin.braun@ettus.com>
2019-11-26 11:49:42 -08:00
Martin Braun
00c3dc29c2 python: Make multi_usrp::get_*_usrp_info() return a Python dict
By using the conversion ability to std::map<>, we can make the Python
versions of get_?x_usrp_info() return a dict in Python.
Sample Python session:

>>> import uhd
>>> U = uhd.usrp.MultiUsrp(args)
>>> U.get_usrp_rx_info()
{'mboard_id': 'B200', 'rx_subdev_name': 'FE-RX2', ...}
2019-11-04 09:57:49 -08:00
erickshepherdNI
3a9b18da5c python: fix set_command_time default mboard
Fixup for the Python API's default mboard value in
multi_usrp::set_command_time.
2019-10-04 11:28:49 -07:00
Martin Braun
692ddc71b1 python: Replace Boost.Python with PyBind11
This does not change the Python API itself, but it is still
a significant change. Most importantly, it removes the dependency on
Boost.Python.
2019-02-22 16:56:52 -08:00
Martin Braun
52138314a4 uhd: Replace all usage of boost::noncopyable with uhd::noncopyable
This fixes the build errors that occur due to switching locations of
noncopyable.hpp within Boost, and also allows us to remove
boost::noncopyable in one fell swoop.
2019-02-15 11:12:54 -08:00
Brent Stapleton
32457928dd python: Add sync source to Python API
Exposing getters, setters, and options for multi_usrp sync source.
2018-11-29 09:50:02 -08:00
Vidush
589f98f74b Python: Bind Gain Profile Functions 2018-06-22 13:02:42 -07:00
Vidush
fbe00af768 fixup! python: Separating exposed Python data structures 2018-06-21 17:27:24 -07:00
Vidush
c214583053 Python: Add tx_lo Functions 2018-06-20 19:02:32 -05:00
Paul David
e74cf7635b python: Separating exposed Python data structures
- Separating exposed Python data structures into logical sections
- Exposes all of the multi_usrp API
- Adds a layer of Python for documentation and adding helper methods
- Adds improvements and fixes to the MultiUSRP object
- Includes additional exposed data structures (like time_spec_t, etc.)
- Add code to release the Python GIL during long C++ calls
2018-06-20 19:02:32 -05:00