usrp_standard_tx Class Reference

standard usrp TX class. More...

#include <usrp_standard.h>

Inheritance diagram for usrp_standard_tx:

Inheritance graph
[legend]
Collaboration diagram for usrp_standard_tx:

Collaboration graph
[legend]

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.
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 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_txmake (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 instance or 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

standard usrp TX class.

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]

References CM_OFF, d_coarse_mod, and MAX_CHAN.

unsigned int usrp_standard_tx::interp_rate (  )  const

References d_interp_rate.

usrp_standard_tx * 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 instance or 0 if trouble

Parameters:
which_board Which USRP board on usb (not particularly useful; use 0)
fusb_block_size fast usb xfer block size. Must be a multiple of 512. Use zero for a reasonable default.
fusb_nblocks number of fast usb URBs to allocate. Use zero for a reasonable default.

References usrp_standard_tx().

Referenced by main().

int usrp_standard_tx::mux (  )  const

References d_sw_mux.

int usrp_standard_tx::nchannels (  )  const

References d_nchan.

Referenced by set_interp_rate().

bool usrp_standard_tx::set_coarse_modulator ( int  channel,
coarse_mod_t  cm 
) [protected, 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 ()

References usrp_basic::_write_fpga_reg(), d_interp_rate, usrp_basic_tx::dac_rate(), usrp_basic_tx::disable_tx(), nchannels(), usrp_basic_tx::restore_tx(), and usrp_basic::set_usb_data_rate().

Referenced by usrp_standard_tx().

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
 

References d_hw_mux, d_sw_mux, and write_hw_mux_reg().

Referenced by usrp_standard_tx().

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 ()

References d_nchan, usrp_standard_common::nducs(), and write_hw_mux_reg().

Referenced by usrp_standard_tx().

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.

References usrp_basic::_write_9862(), CM_NEG_FDAC_OVER_4, CM_NEG_FDAC_OVER_8, CM_OFF, CM_POS_FDAC_OVER_4, CM_POS_FDAC_OVER_8, d_tx_freq, d_tx_modulator_shadow, usrp_basic::d_verbose, usrp_basic_tx::dac_freq(), MAX_CHAN, REG_TX_MODULATOR, REG_TX_NCO_FTW_15_8, REG_TX_NCO_FTW_23_16, REG_TX_NCO_FTW_7_0, set_coarse_modulator(), TX_MODULATOR_ENABLE_NCO, and TX_MODULATOR_NEG_FINE_TUNE.

Referenced by main(), and usrp_standard_tx().

bool usrp_standard_tx::start (  ) 

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

Reimplemented from usrp_basic_tx.

References usrp_basic_tx::start().

Referenced by main().

bool usrp_standard_tx::stop (  ) 

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

Reimplemented from usrp_basic_tx.

double usrp_standard_tx::tx_freq ( int  channel  )  const

References d_tx_freq, and MAX_CHAN.

bool usrp_standard_tx::write_hw_mux_reg (  )  [protected]


Member Data Documentation

int usrp_standard_tx::d_hw_mux [protected]

Referenced by set_mux(), and write_hw_mux_reg().

unsigned int usrp_standard_tx::d_interp_rate [protected]

Referenced by interp_rate(), and set_interp_rate().

int usrp_standard_tx::d_nchan [protected]

int usrp_standard_tx::d_sw_mux [protected]

Referenced by mux(), and set_mux().

Referenced by set_tx_freq(), and tx_freq().

const int usrp_standard_tx::MAX_CHAN = 2 [static, protected]


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

Generated on Thu Mar 5 09:04:26 2009 for Universal Software Radio Peripheral by  doxygen 1.5.8