usrp_standard_rx Class Reference

standard usrp RX class. More...

#include <usrp_standard.h>

Inheritance diagram for usrp_standard_rx:

Inheritance graph
[legend]
Collaboration diagram for usrp_standard_rx:

Collaboration graph
[legend]

List of all members.

Public Types

enum  { FPGA_MODE_NORMAL = 0x00, FPGA_MODE_LOOPBACK = 0x01, FPGA_MODE_COUNTING = 0x02, FPGA_MODE_COUNTING_32BIT = 0x04 }

Public Member Functions

 ~usrp_standard_rx ()
bool set_decim_rate (unsigned int rate)
 Set decimator rate. rate MUST BE EVEN and in [8, 256].
bool set_nchannels (int nchannels)
 Set number of active channels. nchannels must be 1, 2 or 4.
bool set_mux (int mux)
 Set input mux configuration.
bool set_rx_freq (int channel, double freq)
 set the frequency of the digital down converter.
bool set_fpga_mode (int mode)
 set fpga mode
bool set_ddc_phase (int channel, int phase)
 Set the digital down converter phase register.
bool set_format (unsigned int format)
 Specify Rx data format.
unsigned int decim_rate () const
double rx_freq (int channel) const
int nchannels () const
int mux () const
unsigned int format () 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_rxmake (int which_board, unsigned int decim_rate, int nchan=1, int mux=-1, int mode=0, 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
static unsigned int make_format (int width=16, int shift=0, bool want_q=true, bool bypass_halfband=false)
static int format_width (unsigned int format)
static int format_shift (unsigned int format)
static bool format_want_q (unsigned int format)
static bool format_bypass_halfband (unsigned int format)

Protected Member Functions

 usrp_standard_rx (int which_board, unsigned int decim_rate, int nchan=1, int mux=-1, int mode=0, int fusb_block_size=0, int fusb_nblocks=0, const std::string fpga_filename="", const std::string firmware_filename="")
bool write_hw_mux_reg ()


Detailed Description

standard usrp RX class.

Assumes digital down converter in FPGA


Member Enumeration Documentation

anonymous enum

Enumerator:
FPGA_MODE_NORMAL 
FPGA_MODE_LOOPBACK 
FPGA_MODE_COUNTING 
FPGA_MODE_COUNTING_32BIT 


Constructor & Destructor Documentation

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

usrp_standard_rx::~usrp_standard_rx (  ) 


Member Function Documentation

unsigned int usrp_standard_rx::decim_rate (  )  const

unsigned int usrp_standard_rx::format (  )  const

bool usrp_standard_rx::format_bypass_halfband ( unsigned int  format  )  [static]

int usrp_standard_rx::format_shift ( unsigned int  format  )  [static]

bool usrp_standard_rx::format_want_q ( unsigned int  format  )  [static]

int usrp_standard_rx::format_width ( unsigned int  format  )  [static]

usrp_standard_rx * usrp_standard_rx::make ( int  which_board,
unsigned int  decim_rate,
int  nchan = 1,
int  mux = -1,
int  mode = 0,
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_rx().

Referenced by main().

unsigned int usrp_standard_rx::make_format ( int  width = 16,
int  shift = 0,
bool  want_q = true,
bool  bypass_halfband = false 
) [static]

Referenced by main(), and usrp_standard_rx().

int usrp_standard_rx::mux (  )  const

int usrp_standard_rx::nchannels (  )  const

Referenced by set_decim_rate().

double usrp_standard_rx::rx_freq ( int  channel  )  const

bool usrp_standard_rx::set_ddc_phase ( int  channel,
int  phase 
)

Set the digital down converter phase register.

Parameters:
channel which ddc channel [0, 3]
phase 32-bit integer phase value.

References usrp_basic::_write_fpga_reg().

Referenced by usrp_standard_rx().

bool usrp_standard_rx::set_decim_rate ( unsigned int  rate  ) 

Set decimator rate. rate MUST BE EVEN and in [8, 256].

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

References usrp_basic::_write_fpga_reg(), usrp_basic_rx::adc_rate(), usrp_basic_rx::disable_rx(), usrp_standard_common::has_rx_halfband(), nchannels(), usrp_basic_rx::restore_rx(), and usrp_basic::set_usb_data_rate().

Referenced by usrp_standard_rx().

bool usrp_standard_rx::set_format ( unsigned int  format  ) 

Specify Rx data format.

Parameters:
format format specifier
Rx data format control register

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 +-----------------------------------------+-+-+---------+-------+ | Reserved (Must be zero) |B|Q| WIDTH | SHIFT | +-----------------------------------------+-+-+---------+-------+

SHIFT specifies arithmetic right shift [0, 15] WIDTH specifies bit-width of I & Q samples across the USB [1, 16] (not all valid) Q if set deliver both I & Q, else just I B if set bypass half-band filter.

Right now the acceptable values are:

B Q WIDTH SHIFT 0 1 16 0 0 1 8 8

More valid combos to come.

Default value is 0x00000300 16-bits, 0 shift, deliver both I & Q.

References usrp_basic::_write_fpga_reg().

Referenced by main(), and usrp_standard_rx().

bool usrp_standard_rx::set_fpga_mode ( int  mode  ) 

set fpga mode

References usrp_basic::_write_fpga_reg().

Referenced by usrp_standard_rx().

bool usrp_standard_rx::set_mux ( int  mux  ) 

Set input mux configuration.

This determines which ADC (or constant zero) is connected to each DDC input. There are 4 DDCs. Each has two inputs.

 Mux value:

    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
 +-------+-------+-------+-------+-------+-------+-------+-------+
 |   Q3  |   I3  |   Q2  |   I2  |   Q1  |   I1  |   Q0  |   I0  |
 +-------+-------+-------+-------+-------+-------+-------+-------+

 Each 4-bit I field is either 0,1,2,3
 Each 4-bit Q field is either 0,1,2,3 or 0xf (input is const zero)
 All Q's must be 0xf or none of them may be 0xf
 

References write_hw_mux_reg().

Referenced by usrp_standard_rx().

bool usrp_standard_rx::set_nchannels ( int  nchannels  ) 

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

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

References usrp_standard_common::nddcs(), and write_hw_mux_reg().

Referenced by usrp_standard_rx().

bool usrp_standard_rx::set_rx_freq ( int  channel,
double  freq 
)

set the frequency of the digital down converter.

channel must be in the range [0,3]. freq is the center frequency in Hz. freq may be either negative or postive. The frequency specified is quantized. Use rx_freq to retrieve the actual value used.

References usrp_basic::_write_fpga_reg(), usrp_basic_rx::adc_freq(), and usrp_basic::d_verbose.

Referenced by main(), and usrp_standard_rx().

bool usrp_standard_rx::start (  ) 

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

Reimplemented from usrp_basic_rx.

References usrp_basic_rx::start().

Referenced by main().

bool usrp_standard_rx::stop (  ) 

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

Reimplemented from usrp_basic_rx.

bool usrp_standard_rx::write_hw_mux_reg (  )  [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