#include <uhd/rfnoc/mb_controller.hpp>
Classes | |
class | timekeeper |
Public Types | |
using | sptr = std::shared_ptr< mb_controller > |
using | sync_source_t = device_addr_t |
using | sync_source_updater_t = std::function< void(const sync_source_t &sync_source)> |
Public Member Functions | |
~mb_controller () override=default | |
size_t | get_num_timekeepers () const |
Returns the number of timekeepers, which equals the number of timebases. More... | |
timekeeper::sptr | get_timekeeper (const size_t tk_idx) const |
Return a reference to the tk_idx-th timekeeper on this motherboard. More... | |
virtual void | init () |
virtual std::string | get_mboard_name () const =0 |
virtual void | set_time_source (const std::string &source)=0 |
virtual std::string | get_time_source () const =0 |
virtual std::vector< std::string > | get_time_sources () const =0 |
virtual void | set_clock_source (const std::string &source)=0 |
virtual std::string | get_clock_source () const =0 |
virtual std::vector< std::string > | get_clock_sources () const =0 |
virtual void | set_sync_source (const std::string &clock_source, const std::string &time_source)=0 |
virtual void | set_sync_source (const uhd::device_addr_t &sync_source)=0 |
virtual uhd::device_addr_t | get_sync_source () const =0 |
virtual std::vector< uhd::device_addr_t > | get_sync_sources ()=0 |
virtual void | set_clock_source_out (const bool enb)=0 |
virtual void | set_time_source_out (const bool enb)=0 |
virtual uhd::sensor_value_t | get_sensor (const std::string &name)=0 |
virtual std::vector< std::string > | get_sensor_names ()=0 |
virtual uhd::usrp::mboard_eeprom_t | get_eeprom ()=0 |
virtual bool | synchronize (std::vector< mb_controller::sptr > &mb_controllers, const uhd::time_spec_t &time_spec=uhd::time_spec_t(0.0), const bool quiet=false) |
virtual std::vector< std::string > | get_gpio_banks () const |
virtual std::vector< std::string > | get_gpio_srcs (const std::string &bank) const |
virtual std::vector< std::string > | get_gpio_src (const std::string &bank) |
virtual void | set_gpio_src (const std::string &bank, const std::vector< std::string > &src) |
virtual void | register_sync_source_updater (sync_source_updater_t callback_f) |
Public Member Functions inherited from uhd::features::discoverable_feature_getter_iface | |
virtual | ~discoverable_feature_getter_iface ()=default |
template<typename T > | |
T & | get_feature () |
Retrieves a feature of the specified type. More... | |
template<typename T > | |
bool | has_feature () |
Determines whether a given feature exists. More... | |
virtual std::vector< std::string > | enumerate_features ()=0 |
Enumerate all discoverable features present on the device. More... | |
Protected Member Functions | |
void | register_timekeeper (const size_t idx, timekeeper::sptr tk) |
A default block controller for blocks that can't be found in the registry
using uhd::rfnoc::mb_controller::sptr = std::shared_ptr<mb_controller> |
using uhd::rfnoc::mb_controller::sync_source_updater_t = std::function<void(const sync_source_t& sync_source)> |
Callback function for changing sync sources
When a sync source is changed, the sync source callback function is called to notify any registrants of the update
|
overridedefault |
|
pure virtual |
Get the currently set clock source
|
pure virtual |
Get a list of possible clock sources
|
pure virtual |
Return the motherboard EEPROM data
|
virtual |
Return the list of GPIO banks that are controlled by this MB controller
Note that this list may be empty. Only if the MB controller has any control over GPIOs, do the get listed here.
|
virtual |
Return the current sources for a given GPIO bank
|
virtual |
Return a list of possible sources to drive GPIOs
Sources can be "PS", for when an embedded device can drive the pins from software, "Radio#0", if a radio block can drive them, and so on.
|
pure virtual |
Get canonical name for this USRP motherboard
size_t uhd::rfnoc::mb_controller::get_num_timekeepers | ( | ) | const |
Returns the number of timekeepers, which equals the number of timebases.
|
pure virtual |
Get a motherboard sensor value
name | the name of the sensor |
|
pure virtual |
Get a list of possible motherboard sensor names
|
pure virtual |
Get the currently set sync source
|
pure virtual |
Get a list of available sync sources
|
pure virtual |
Get the currently set time source
|
pure virtual |
Get a list of possible time sources.
timekeeper::sptr uhd::rfnoc::mb_controller::get_timekeeper | ( | const size_t | tk_idx | ) | const |
Return a reference to the tk_idx-th
timekeeper on this motherboard.
|
inlinevirtual |
Run initializations of this motherboard that have to occur post-block init
|
virtual |
Register a callback function to update sync sources
This callback alerts those registered that a change has occurred to a sync source, whether that be the clock_source, time_source, or both via sync_source.
callback_f | The function to call when a sync source is updated |
|
protected |
Stash away a timekeeper. This needs to be called by the implementer of mb_controller.
|
pure virtual |
Set the clock source for the USRP device
This sets the source of the frequency reference, typically a 10 MHz signal. In order to frequency-align multiple USRPs, it is necessary to connect all of them to a common reference and provide them with the same clock source. Typical values for source
are 'internal', 'external'. Refer to the specific device manual for a full list of options.
If the value for for source
is not available for this device, it will throw an exception. Calling get_clock_sources() will return a valid list of options for this method.
Side effects: Some devices only support certain combinations of time and clock source. It is possible that the underlying device implementation will change the time source when the clock source changes and vice versa. Reading back the current values of clock and time source using get_clock_source() and get_time_source() is the only certain way of knowing which clock and time source are currently selected.
This function does not force a re-initialization of the underlying hardware when the value does not change. Consider the following snippet:
See also:
source | a string representing the time source |
uhd::value_error | if source is an invalid option |
|
pure virtual |
Send the clock source to an output connector
This call is only applicable on devices with reference outputs. By default, the reference output will be enabled for ease of use. This call may be used to enable or disable the output.
enb | true to output the clock source. |
|
virtual |
Set the source for GPIO pins on a given bank.
uhd::key_error | if the bank does not exist |
uhd::value_error | if the source does not exist |
uhd::not_implemented_error | if the current motherboard does not support this feature |
|
pure virtual |
Set the reference/synchronization sources for the USRP device
This is a shorthand for calling set_sync_source(device_addr_t("clock_source=$CLOCK_SOURCE,time_source=$TIME_SOURCE"))
clock_source | A string representing the clock source |
time_source | A string representing the time source |
uhd::value_error | if the sources don't actually exist |
|
pure virtual |
Set the reference/synchronization sources for the USRP device
Typically, this will set both clock and time source in a single call. For some USRPs, this may be significantly faster than calling set_time_source() and set_clock_source() individually.
Example:
This function does not force a re-initialization of the underlying hardware when the value does not change. See also set_time_source() and set_clock_source() for more details.
sync_source | A dictionary representing the various source settings. |
uhd::value_error | if the sources don't actually exist or if the combination of clock and time source is invalid. |
|
pure virtual |
Set the time source for the USRP device
This sets the method of time synchronization, typically a pulse per second signal. In order to time-align multiple USRPs, it is necessary to connect all of them to a common reference and provide them with the same time source. Typical values for source
are 'internal', 'external'. Refer to the specific device manual for a full list of options.
If the value for for source
is not available for this device, it will throw an exception. Calling get_time_sources() will return a valid list of options for this method.
Side effects: Some devices only support certain combinations of time and clock source. It is possible that the underlying device implementation will change the clock source when the time source changes and vice versa. Reading back the current values of clock and time source using get_clock_source() and get_time_source() is the only certain way of knowing which clock and time source are currently selected.
This function does not force a re-initialization of the underlying hardware when the value does not change. Consider the following snippet:
See also:
source | a string representing the time source |
uhd::value_error | if source is an invalid option |
|
pure virtual |
Send the time source to an output connector
This call is only applicable on devices with PPS outputs. By default, the PPS output will be enabled for ease of use. This call may be used to enable or disable the output.
enb | true to output the time source. |
|
virtual |
Synchronize a list of motherboards in time and frequency
Note: When a uhd::rfnoc_graph is instantiated, this method is called on all motherboards.
The exact steps taken when calling this method are hardware-specific, but primarily can be split in three steps in a specific order:
mb_controllers | A list of motherboard controllers to synchronize. Any motherboard controllers that could not be synchronized because they're incompatible with this motherboard controller are removed from the list. On return, the list should be (ideally) identical to its value at call time. |
time_spec | Time specification to synchronize mb_controllers to |
quiet | If true, don't print any errors or warnings if synchronization fails. During initialization of uhd::rfnoc_graph, UHD will call synchronize() on all motherboards with quiet set to true. |
mb_controllers
could be synchronized.