GNU Radio 3.4.0 C++ API
usrp_sink_base Class Reference

abstract interface to Universal Software Radio Peripheral Tx path (Rev 1) More...

#include <usrp_sink_base.h>

Inheritance diagram for usrp_sink_base:

List of all members.

Public Member Functions

 ~usrp_sink_base ()
int work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
 just like gr_block::general_work, only this arranges to call consume_each for you
bool set_interp_rate (unsigned int rate)
 Set interpolator rate. rate must be in [4, 1024] and a multiple of 4.
bool set_nchannels (int nchan)
bool set_mux (int mux)
int determine_tx_mux_value (usrp_subdev_spec ss)
int determine_tx_mux_value (usrp_subdev_spec ss_a, usrp_subdev_spec ss_b)
bool set_tx_freq (int channel, double freq)
 set the frequency of the digital up converter.
long dac_rate () const
long dac_freq () const
unsigned int interp_rate () const
int nchannels () const
int mux () const
double tx_freq (int channel) const
int nunderruns () const
bool has_rx_halfband ()
bool has_tx_halfband ()
int nddcs ()
int nducs ()
bool start ()
 Called to enable drivers, etc for i/o devices.
bool stop ()
 Called to disable drivers, etc for i/o devices.
bool tune (int chan, db_base_sptr db, double target_freq, usrp_tune_result *result)
 High-level "tune" method. Works for the single channel case.
usrp_subdev_spec pick_tx_subdevice ()
 Select suitable Tx daughterboard.

Protected Member Functions

 usrp_sink_base (const std::string &name, gr_io_signature_sptr input_signature, int which_board, unsigned int interp_rate, int nchan, int mux, int fusb_block_size, int fusb_nblocks, const std::string fpga_filename, const std::string firmware_filename) throw (std::runtime_error)
virtual void copy_to_usrp_buffer (gr_vector_const_void_star &input_items, int input_index, int input_items_available, int &input_items_consumed, void *usrp_buffer, int usrp_buffer_length, int &bytes_written)=0
 convert between input item format and usrp native format

Detailed Description

abstract interface to Universal Software Radio Peripheral Tx path (Rev 1)


Constructor & Destructor Documentation

usrp_sink_base::usrp_sink_base ( const std::string &  name,
gr_io_signature_sptr  input_signature,
int  which_board,
unsigned int  interp_rate,
int  nchan,
int  mux,
int  fusb_block_size,
int  fusb_nblocks,
const std::string  fpga_filename,
const std::string  firmware_filename 
) throw (std::runtime_error) [protected]
usrp_sink_base::~usrp_sink_base ( )

Member Function Documentation

virtual void usrp_sink_base::copy_to_usrp_buffer ( gr_vector_const_void_star input_items,
int  input_index,
int  input_items_available,
int &  input_items_consumed,
void *  usrp_buffer,
int  usrp_buffer_length,
int &  bytes_written 
) [protected, pure virtual]

convert between input item format and usrp native format

Parameters:
[in]input_itemsstream(s) of input items
[in]input_indexstarting index in input_items
[in]input_items_availablenumber of items available starting at item[index]
[out]input_items_consumednumber of input items consumed by copy
[out]usrp_bufferdestination buffer
[in]usrp_buffer_lengthusrp_buffer length in bytes
[out]bytes_writtennumber of bytes written into usrp_buffer

Implemented in usrp_sink_c, and usrp_sink_s.

long usrp_sink_base::dac_freq ( ) const [inline]
long usrp_sink_base::dac_rate ( ) const [inline]
int usrp_sink_base::determine_tx_mux_value ( usrp_subdev_spec  ss)
int usrp_sink_base::determine_tx_mux_value ( usrp_subdev_spec  ss_a,
usrp_subdev_spec  ss_b 
)
bool usrp_sink_base::has_rx_halfband ( )
bool usrp_sink_base::has_tx_halfband ( )
unsigned int usrp_sink_base::interp_rate ( ) const
int usrp_sink_base::mux ( ) const
int usrp_sink_base::nchannels ( ) const
int usrp_sink_base::nddcs ( )
int usrp_sink_base::nducs ( )
int usrp_sink_base::nunderruns ( ) const [inline]
usrp_subdev_spec usrp_sink_base::pick_tx_subdevice ( )

Select suitable Tx daughterboard.

bool usrp_sink_base::set_interp_rate ( unsigned int  rate)

Set interpolator rate. rate must be in [4, 1024] and a multiple of 4.

The final complex sample rate across the USB is dac_freq () / interp_rate () * nchannels ()

bool usrp_sink_base::set_mux ( int  mux)
bool usrp_sink_base::set_nchannels ( int  nchan)
bool usrp_sink_base::set_tx_freq ( int  channel,
double  freq 
)

set the frequency of the digital up converter.

channel must be 0. freq is the center frequency in Hz. It must be in the range [-44M, 44M]. The frequency specified is quantized. Use tx_freq to retrieve the actual value used.

bool usrp_sink_base::start ( ) [virtual]

Called to enable drivers, etc for i/o devices.

This allows a block to enable an associated driver to begin transfering data just before we start to execute the scheduler. The end result is that this reduces latency in the pipeline when dealing with audio devices, usrps, etc.

Reimplemented from gr_block.

bool usrp_sink_base::stop ( ) [virtual]

Called to disable drivers, etc for i/o devices.

Reimplemented from gr_block.

bool usrp_sink_base::tune ( int  chan,
db_base_sptr  db,
double  target_freq,
usrp_tune_result result 
)

High-level "tune" method. Works for the single channel case.

This method adjusts both the daughterboard LO and the DUC so that DC in the complex baseband samples ends up at RF target_freq.

Parameters:
chanwhich DUC channel we're controlling (usually == which_side).
dbthe daughterboard we're controlling.
target_freqthe RF frequency we want our baseband translated to.
[out]resultdetails how the hardware was configured.
Returns:
true iff everything was successful.
double usrp_sink_base::tx_freq ( int  channel) const
int usrp_sink_base::work ( int  noutput_items,
gr_vector_const_void_star input_items,
gr_vector_void_star output_items 
) [virtual]

just like gr_block::general_work, only this arranges to call consume_each for you

The user must override work to define the signal processing code

Implements gr_sync_block.


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