GNU Radio 3.4.2 C++ API
usrp_standard_tx Class Reference

The C++ interface the transmit side of the USRPThis is the recommended interface to USRP transmit functionality for applications that use the USRP but not GNU Radio. More...

#include <usrp_standard.h>

Inheritance diagram for usrp_standard_tx:

List of all members.

Public Types

enum  coarse_mod_t {
  CM_NEG_FDAC_OVER_4, CM_NEG_FDAC_OVER_8, CM_OFF, CM_POS_FDAC_OVER_8,
  CM_POS_FDAC_OVER_4
}

Public Member Functions

 ~usrp_standard_tx ()
virtual bool set_interp_rate (unsigned int rate)
 Set interpolator rate. rate must be in [4, 512] and a multiple of 4.
bool set_nchannels (int nchannels)
 Set number of active channels. nchannels must be 1 or 2.
bool set_mux (int mux)
 Set output mux configuration.
int determine_tx_mux_value (const usrp_subdev_spec &ss)
int determine_tx_mux_value (const usrp_subdev_spec &ss_a, const usrp_subdev_spec &ss_b)
virtual bool set_tx_freq (int channel, double freq)
 set the frequency of the digital up converter.
unsigned int interp_rate () const
double tx_freq (int channel) const
int nchannels () const
int mux () const
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.
bool start ()
 Start data transfers. Called in base class to derived class order.
bool stop ()
 Stop data transfers. Called in base class to derived class order.

Static Public Member Functions

static usrp_standard_tx_sptr make (int which_board, unsigned int interp_rate, int nchan=1, int mux=-1, int fusb_block_size=0, int fusb_nblocks=0, const std::string fpga_filename="", const std::string firmware_filename="")
 invokes constructor, returns shared_ptr or shared_ptr equivalent of 0 if trouble

Protected Member Functions

virtual bool set_coarse_modulator (int channel, coarse_mod_t cm)
usrp_standard_tx::coarse_mod_t coarse_modulator (int channel) const
 usrp_standard_tx (int which_board, unsigned int interp_rate, int nchan=1, int mux=-1, int fusb_block_size=0, int fusb_nblocks=0, const std::string fpga_filename="", const std::string firmware_filename="")
bool write_hw_mux_reg ()

Protected Attributes

unsigned int d_interp_rate
int d_nchan
int d_sw_mux
int d_hw_mux
double d_tx_freq [MAX_CHAN]
coarse_mod_t d_coarse_mod [MAX_CHAN]
unsigned char d_tx_modulator_shadow [MAX_CHAN]

Static Protected Attributes

static const int MAX_CHAN = 2

Detailed Description

The C++ interface the transmit side of the USRP

This is the recommended interface to USRP transmit functionality for applications that use the USRP but not GNU Radio.

Uses digital upconverter (coarse & fine modulators) in AD9862...


Member Enumeration Documentation

Enumerator:
CM_NEG_FDAC_OVER_4 
CM_NEG_FDAC_OVER_8 
CM_OFF 
CM_POS_FDAC_OVER_8 
CM_POS_FDAC_OVER_4 

Constructor & Destructor Documentation

usrp_standard_tx::usrp_standard_tx ( int  which_board,
unsigned int  interp_rate,
int  nchan = 1,
int  mux = -1,
int  fusb_block_size = 0,
int  fusb_nblocks = 0,
const std::string  fpga_filename = "",
const std::string  firmware_filename = "" 
) [protected]
usrp_standard_tx::~usrp_standard_tx ( )

Member Function Documentation

usrp_standard_tx::coarse_mod_t usrp_standard_tx::coarse_modulator ( int  channel) const [protected]
int usrp_standard_tx::determine_tx_mux_value ( const usrp_subdev_spec ss)

Determine the appropriate Tx mux value as a function of the subdevice choosen and the characteristics of the respective daughterboard.

int usrp_standard_tx::determine_tx_mux_value ( const usrp_subdev_spec ss_a,
const usrp_subdev_spec ss_b 
)
unsigned int usrp_standard_tx::interp_rate ( ) const
static usrp_standard_tx_sptr usrp_standard_tx::make ( int  which_board,
unsigned int  interp_rate,
int  nchan = 1,
int  mux = -1,
int  fusb_block_size = 0,
int  fusb_nblocks = 0,
const std::string  fpga_filename = "",
const std::string  firmware_filename = "" 
) [static]

invokes constructor, returns shared_ptr or shared_ptr equivalent of 0 if trouble

Parameters:
which_boardWhich USRP board on usb (not particularly useful; use 0)
interp_rateinterpolation factor
nchannumber of channels
muxTx mux setting,
See also:
set_mux
Parameters:
fusb_block_sizefast usb xfer block size. Must be a multiple of 512. Use zero for a reasonable default.
fusb_nblocksnumber of fast usb URBs to allocate. Use zero for a reasonable default.
fpga_filenameName of rbf file to load
firmware_filenameName of ihx file to load
int usrp_standard_tx::mux ( ) const
int usrp_standard_tx::nchannels ( ) const
virtual bool usrp_standard_tx::set_coarse_modulator ( int  channel,
coarse_mod_t  cm 
) [protected, virtual]
virtual bool usrp_standard_tx::set_interp_rate ( unsigned int  rate) [virtual]

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

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

bool usrp_standard_tx::set_mux ( int  mux)

Set output mux configuration.

     3                   2                   1                       
   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  +-------------------------------+-------+-------+-------+-------+
  |                               | DAC3  | DAC2  | DAC1  |  DAC0 |
  +-------------------------------+-------+-------+-------+-------+
  There are two interpolators with complex inputs and outputs.
  There are four DACs.
  Each 4-bit DACx field specifies the source for the DAC and
  whether or not that DAC is enabled.  Each subfield is coded
  like this:
     3 2 1 0
    +-+-----+
    |E|  N  |
    +-+-----+
  Where E is set if the DAC is enabled, and N specifies which
  interpolator output is connected to this DAC.
   N   which interp output
  ---  -------------------
   0   chan 0 I
   1   chan 0 Q
   2   chan 1 I
   3   chan 1 Q
 
bool usrp_standard_tx::set_nchannels ( int  nchannels)

Set number of active channels. nchannels must be 1 or 2.

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

virtual bool usrp_standard_tx::set_tx_freq ( int  channel,
double  freq 
) [virtual]

set the frequency of the digital up converter.

channel must be in the range [0,1]. 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_standard_tx::start ( )

Start data transfers. Called in base class to derived class order.

Reimplemented from usrp_basic_tx.

bool usrp_standard_tx::stop ( )

Stop data transfers. Called in base class to derived class order.

Reimplemented from usrp_basic_tx.

bool usrp_standard_tx::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_standard_tx::tx_freq ( int  channel) const
bool usrp_standard_tx::write_hw_mux_reg ( ) [protected]

Member Data Documentation

int usrp_standard_tx::d_hw_mux [protected]
unsigned int usrp_standard_tx::d_interp_rate [protected]
int usrp_standard_tx::d_nchan [protected]
int usrp_standard_tx::d_sw_mux [protected]
const int usrp_standard_tx::MAX_CHAN = 2 [static, protected]

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