USRP Hardware Driver and USRP Manual  Version: 3.11.0.HEAD-0-ga1b5c4ae
UHD and USRP Manual
uhd::device3 Class Referenceabstract

Extends uhd::device for third-generation USRP devices. More...

#include <uhd/device3.hpp>

Inheritance diagram for uhd::device3:
uhd::device

Public Types

typedef boost::shared_ptr< device3sptr
 
- Public Types inherited from uhd::device
enum  device_filter_t { ANY, USRP, CLOCK }
 Device type, used as a filter in make. More...
 
typedef boost::shared_ptr< devicesptr
 
typedef boost::function< device_addrs_t(const device_addr_t &)> find_t
 
typedef boost::function< sptr(const device_addr_t &)> make_t
 

Public Member Functions

virtual rfnoc::graph::sptr create_graph (const std::string &name="")=0
 
void clear ()
 
bool has_block (const rfnoc::block_id_t &block_id) const
 Checks if an RFNoC block exists on the device. More...
 
template<typename T >
bool has_block (const rfnoc::block_id_t &block_id) const
 
rfnoc::block_ctrl_base::sptr get_block_ctrl (const rfnoc::block_id_t &block_id) const
 Returns a block controller class for an RFNoC block. More...
 
template<typename T >
boost::shared_ptr< T > get_block_ctrl (const rfnoc::block_id_t &block_id) const
 
std::vector< rfnoc::block_id_t > find_blocks (const std::string &block_id_hint) const
 
template<typename T >
std::vector< rfnoc::block_id_t > find_blocks (const std::string &block_id_hint) const
 
- Public Member Functions inherited from uhd::device
virtual ~device (void)=0
 
virtual rx_streamer::sptr get_rx_stream (const stream_args_t &args)=0
 Make a new receive streamer from the streamer arguments. More...
 
virtual tx_streamer::sptr get_tx_stream (const stream_args_t &args)=0
 Make a new transmit streamer from the streamer arguments. More...
 
virtual bool recv_async_msg (async_metadata_t &async_metadata, double timeout=0.1)=0
 
uhd::property_tree::sptr get_tree (void) const
 Get access to the underlying property structure. More...
 
device_filter_t get_device_type () const
 Get device type. More...
 

Static Public Member Functions

static sptr make (const device_addr_t &hint, const size_t which=0)
 Same as uhd::device::make(), but will fail if not actually a device3. More...
 
- Static Public Member Functions inherited from uhd::device
static void register_device (const find_t &find, const make_t &make, const device_filter_t filter)
 
static device_addrs_t find (const device_addr_t &hint, device_filter_t filter=ANY)
 Find devices attached to the host. More...
 
static sptr make (const device_addr_t &hint, device_filter_t filter=ANY, size_t which=0)
 Create a new device from the device address hint. More...
 

Protected Attributes

std::vector< rfnoc::block_ctrl_base::sptr > _rfnoc_block_ctrl
 List of all RFNoC blocks available on this device. More...
 
boost::mutex _block_ctrl_mutex
 Mutex to protect access to members. More...
 
- Protected Attributes inherited from uhd::device
uhd::property_tree::sptr _tree
 
device_filter_t _type
 

Detailed Description

Extends uhd::device for third-generation USRP devices.

Generation-3 devices are characterized by the following traits:

  • They support RFNoC (RF Network-on-Chip).
  • Data transport uses the compressed VITA (CVITA/CHDR) data format.

Member Typedef Documentation

◆ sptr

typedef boost::shared_ptr<device3> uhd::device3::sptr

Member Function Documentation

◆ clear()

void uhd::device3::clear ( )

Reset blocks after a stream.

TODO write docs

◆ create_graph()

virtual rfnoc::graph::sptr uhd::device3::create_graph ( const std::string &  name = "")
pure virtual

◆ find_blocks() [1/2]

std::vector<rfnoc::block_id_t> uhd::device3::find_blocks ( const std::string &  block_id_hint) const

Returns the block ids of all blocks that match the specified hint Uses block_ctrl_base::match() internally. If no matching block is found, it returns an empty vector.

To access specialized block controller classes (i.e. derived from block_ctrl_base), use the templated version of this function, e.g.

// Assume DEV is a device3::sptr
null_block_ctrl::sptr null_block = DEV->find_blocks<null_block_ctrl>("NullSrcSink");
Note
this access is not thread safe if peformed during block enumeration

◆ find_blocks() [2/2]

template<typename T >
std::vector<rfnoc::block_id_t> uhd::device3::find_blocks ( const std::string &  block_id_hint) const
inline

Type-cast version of find_blocks().

◆ get_block_ctrl() [1/2]

rfnoc::block_ctrl_base::sptr uhd::device3::get_block_ctrl ( const rfnoc::block_id_t &  block_id) const

Returns a block controller class for an RFNoC block.

If the given block ID is not valid (i.e. such a block does not exist on this device), it will throw a uhd::lookup_error.

Parameters
block_idCanonical block name (e.g. "0/FFT_1").
Note
this access is not thread safe if peformed during block enumeration

◆ get_block_ctrl() [2/2]

template<typename T >
boost::shared_ptr<T> uhd::device3::get_block_ctrl ( const rfnoc::block_id_t &  block_id) const
inline

Same as get_block_ctrl(), but with a type cast.

If you have a block controller class that is derived from block_ctrl_base, use this function to access its specific methods. If the given block ID is not valid (i.e. such a block does not exist on this device) or if the type does not match, it will throw a uhd::lookup_error.

// Assume DEV is a device3::sptr
uhd::rfnoc::my_block_ctrl::sptr block_controller = get_block_ctrl<my_block_ctrl>("0/MyBlock_0");
block_controller->my_own_block_method();
Note
this access is not thread safe if peformed during block enumeration

◆ has_block() [1/2]

bool uhd::device3::has_block ( const rfnoc::block_id_t &  block_id) const

Checks if an RFNoC block exists on the device.

Parameters
block_idCanonical block name (e.g. "0/FFT_1").
Returns
true if a block with the specified id exists
Note
this access is not thread safe if peformed during block enumeration

◆ has_block() [2/2]

template<typename T >
bool uhd::device3::has_block ( const rfnoc::block_id_t &  block_id) const
inline

Same as has_block(), but with a type check.

Returns
true if a block of type T with the specified id exists
Note
this access is not thread safe if peformed during block enumeration

◆ make()

static sptr uhd::device3::make ( const device_addr_t hint,
const size_t  which = 0 
)
static

Same as uhd::device::make(), but will fail if not actually a device3.

Member Data Documentation

◆ _block_ctrl_mutex

boost::mutex uhd::device3::_block_ctrl_mutex
protected

Mutex to protect access to members.

◆ _rfnoc_block_ctrl

std::vector< rfnoc::block_ctrl_base::sptr > uhd::device3::_rfnoc_block_ctrl
protected

List of all RFNoC blocks available on this device.


The documentation for this class was generated from the following file: