#include <usrp_standard.h>


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_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="") |
| 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 () |
Assumes digital down converter in FPGA
| anonymous enum |
| 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 | ( | ) |
| unsigned int usrp_standard_rx::decim_rate | ( | ) | const |
| unsigned int usrp_standard_rx::format | ( | ) | const |
| static bool usrp_standard_rx::format_bypass_halfband | ( | unsigned int | format | ) | [static] |
| static int usrp_standard_rx::format_shift | ( | unsigned int | format | ) | [static] |
| static bool usrp_standard_rx::format_want_q | ( | unsigned int | format | ) | [static] |
| static int usrp_standard_rx::format_width | ( | unsigned int | format | ) | [static] |
| 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
| 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. |
| static unsigned int usrp_standard_rx::make_format | ( | int | width = 16, |
|
| int | shift = 0, |
|||
| bool | want_q = true, |
|||
| bool | bypass_halfband = false | |||
| ) | [static] |
| int usrp_standard_rx::mux | ( | ) | const |
| int usrp_standard_rx::nchannels | ( | ) | const |
| 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.
| channel | which ddc channel [0, 3] | |
| phase | 32-bit integer phase value. |
| 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 ()
| bool usrp_standard_rx::set_format | ( | unsigned int | format | ) |
Specify Rx data format.
| format | format specifier |
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.
| bool usrp_standard_rx::set_fpga_mode | ( | int | mode | ) |
set fpga mode
| 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
| 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 ()
| 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.
| bool usrp_standard_rx::start | ( | ) |
Start data transfers. Called in base class to derived class order.
Reimplemented from usrp_basic_rx.
| bool usrp_standard_rx::stop | ( | ) |
| bool usrp_standard_rx::write_hw_mux_reg | ( | ) | [protected] |
1.5.8