#include <usrp_basic.h>


Public Member Functions | |
| virtual | ~usrp_basic () |
| long | fpga_master_clock_freq () const |
| return frequency of master oscillator on USRP | |
| int | usb_data_rate () const |
| void | set_verbose (bool on) |
| bool | write_eeprom (int i2c_addr, int eeprom_offset, const std::string buf) |
| Write EEPROM on motherboard or any daughterboard. | |
| std::string | read_eeprom (int i2c_addr, int eeprom_offset, int len) |
| Read EEPROM on motherboard or any daughterboard. | |
| bool | write_i2c (int i2c_addr, const std::string buf) |
| Write to I2C peripheral. | |
| std::string | read_i2c (int i2c_addr, int len) |
| Read from I2C peripheral. | |
| bool | set_adc_offset (int which, int offset) |
| Set ADC offset correction. | |
| bool | set_dac_offset (int which, int offset, int offset_pin) |
| Set DAC offset correction. | |
| bool | set_adc_buffer_bypass (int which, bool bypass) |
| Control ADC input buffer. | |
| std::string | serial_number () |
| return the usrp's serial number. | |
| bool | _set_led (int which, bool on) |
| bool | _write_fpga_reg (int regno, int value) |
| Write FPGA register. | |
| bool | _read_fpga_reg (int regno, int *value) |
| Read FPGA register. | |
| int | _read_fpga_reg (int regno) |
| Read FPGA register. | |
| bool | _write_fpga_reg_masked (int regno, int value, int mask) |
| Write FPGA register with mask. | |
| bool | _write_9862 (int which_codec, int regno, unsigned char value) |
| Write AD9862 register. | |
| bool | _read_9862 (int which_codec, int regno, unsigned char *value) const |
| Read AD9862 register. | |
| int | _read_9862 (int which_codec, int regno) const |
| Read AD9862 register. | |
| bool | _write_spi (int optional_header, int enables, int format, std::string buf) |
| Write data to SPI bus peripheral. | |
| std::string | _read_spi (int optional_header, int enables, int format, int len) |
| 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 Attributes | |
| static const int | READ_FAILED = -99999 |
| magic value used on alternate register read interfaces | |
Protected Member Functions | |
| usrp_basic (int which_board, struct usb_dev_handle *open_interface(struct usb_device *dev), const std::string fpga_filename="", const std::string firmware_filename="") | |
| void | set_usb_data_rate (int usb_data_rate) |
| advise usrp_basic of usb data rate (bytes/sec) | |
| bool | write_aux_dac (int slot, int which_dac, int value) |
| Write auxiliary digital to analog converter. | |
| bool | read_aux_adc (int slot, int which_adc, int *value) |
| Read auxiliary analog to digital converter. | |
| int | read_aux_adc (int slot, int which_adc) |
| Read auxiliary analog to digital converter. | |
Protected Attributes | |
| struct usb_dev_handle * | d_udh |
| int | d_usb_data_rate |
| int | d_bytes_per_poll |
| bool | d_verbose |
| unsigned int | d_fpga_shadows [MAX_REGS] |
Static Protected Attributes | |
| static const int | MAX_REGS = 128 |
| usrp_basic::usrp_basic | ( | int | which_board, | |
| struct usb_dev_handle * | open_interfacestruct usb_device *dev, | |||
| const std::string | fpga_filename = "", |
|||
| const std::string | firmware_filename = "" | |||
| ) | [protected] |
| virtual usrp_basic::~usrp_basic | ( | ) | [virtual] |
| int usrp_basic::_read_9862 | ( | int | which_codec, | |
| int | regno | |||
| ) | const |
Read AD9862 register.
| which_codec | 0 or 1 | |
| regno | 6-bit register number |
| bool usrp_basic::_read_9862 | ( | int | which_codec, | |
| int | regno, | |||
| unsigned char * | value | |||
| ) | const |
Read AD9862 register.
| which_codec | 0 or 1 | |
| regno | 6-bit register number | |
| value | 8-bit value |
| int usrp_basic::_read_fpga_reg | ( | int | regno | ) |
Read FPGA register.
| regno | 7-bit register number |
| bool usrp_basic::_read_fpga_reg | ( | int | regno, | |
| int * | value | |||
| ) |
Read FPGA register.
| regno | 7-bit register number | |
| value | 32-bit value |
| std::string usrp_basic::_read_spi | ( | int | optional_header, | |
| int | enables, | |||
| int | format, | |||
| int | len | |||
| ) |
| bool usrp_basic::_set_led | ( | int | which, | |
| bool | on | |||
| ) |
| bool usrp_basic::_write_9862 | ( | int | which_codec, | |
| int | regno, | |||
| unsigned char | value | |||
| ) |
Write AD9862 register.
| which_codec | 0 or 1 | |
| regno | 6-bit register number | |
| value | 8-bit value |
| bool usrp_basic::_write_fpga_reg | ( | int | regno, | |
| int | value | |||
| ) |
Write FPGA register.
| regno | 7-bit register number | |
| value | 32-bit value |
| bool usrp_basic::_write_fpga_reg_masked | ( | int | regno, | |
| int | value, | |||
| int | mask | |||
| ) |
Write FPGA register with mask.
| regno | 7-bit register number | |
| value | 16-bit value | |
| mask | 16-bit value |
| bool usrp_basic::_write_spi | ( | int | optional_header, | |
| int | enables, | |||
| int | format, | |||
| std::string | buf | |||
| ) |
Write data to SPI bus peripheral.
| optional_header | 0,1 or 2 bytes to write before buf. | |
| enables | bitmask of peripherals to write. See usrp_spi_defs.h | |
| format | transaction format. See usrp_spi_defs.h SPI_FMT_* | |
| buf | the data to write |
format specifies that optional_header bytes are present, they are written to the peripheral immediately prior to writing buf.
| long usrp_basic::fpga_master_clock_freq | ( | ) | const [inline] |
return frequency of master oscillator on USRP
Referenced by usrp_basic_tx::converter_rate(), and usrp_basic_rx::converter_rate().
| int usrp_basic::read_aux_adc | ( | int | slot, | |
| int | which_adc | |||
| ) | [protected] |
Read auxiliary analog to digital converter.
| slot | 2-bit slot number. E.g., SLOT_TX_A | |
| which_adc | [0,1] |
Reimplemented in usrp_basic_rx, and usrp_basic_tx.
| bool usrp_basic::read_aux_adc | ( | int | slot, | |
| int | which_adc, | |||
| int * | value | |||
| ) | [protected] |
Read auxiliary analog to digital converter.
| slot | 2-bit slot number. E.g., SLOT_TX_A | |
| which_adc | [0,1] | |
| value | return 12-bit value [0,4095] |
Reimplemented in usrp_basic_rx, and usrp_basic_tx.
| std::string usrp_basic::read_eeprom | ( | int | i2c_addr, | |
| int | eeprom_offset, | |||
| int | len | |||
| ) |
Read EEPROM on motherboard or any daughterboard.
| i2c_addr | I2C bus address of EEPROM | |
| eeprom_offset | byte offset in EEPROM to begin reading | |
| len | number of bytes to read |
| std::string usrp_basic::read_i2c | ( | int | i2c_addr, | |
| int | len | |||
| ) |
Read from I2C peripheral.
| i2c_addr | I2C bus address (7-bits) | |
| len | number of bytes to read |
| std::string usrp_basic::serial_number | ( | ) |
return the usrp's serial number.
| bool usrp_basic::set_adc_buffer_bypass | ( | int | which, | |
| bool | bypass | |||
| ) |
| bool usrp_basic::set_adc_offset | ( | int | which, | |
| int | offset | |||
| ) |
Set ADC offset correction.
| which | which ADC[0,3]: 0 = RX_A I, 1 = RX_A Q... | |
| offset | 16-bit value to subtract from raw ADC input. |
| bool usrp_basic::set_dac_offset | ( | int | which, | |
| int | offset, | |||
| int | offset_pin | |||
| ) |
Set DAC offset correction.
| which | which DAC[0,3]: 0 = TX_A I, 1 = TX_A Q... | |
| offset | 10-bit offset value (ambiguous format: See AD9862 datasheet). | |
| offset_pin | 1-bit value. If 0 offset applied to -ve differential pin; If 1 offset applied to +ve differential pin. |
| void usrp_basic::set_usb_data_rate | ( | int | usb_data_rate | ) | [protected] |
advise usrp_basic of usb data rate (bytes/sec)
N.B., this doesn't tweak any hardware. Derived classes should call this to inform us of the data rate whenever it's first set or if it changes.
| usb_data_rate | bytes/sec |
| void usrp_basic::set_verbose | ( | bool | on | ) | [inline] |
References d_verbose.
| bool usrp_basic::start | ( | ) |
Start data transfers. Called in base class to derived class order.
Reimplemented in usrp_basic_rx, usrp_basic_tx, usrp_standard_rx, and usrp_standard_tx.
| bool usrp_basic::stop | ( | ) |
Stop data transfers. Called in base class to derived class order.
Reimplemented in usrp_basic_rx, usrp_basic_tx, usrp_standard_rx, and usrp_standard_tx.
| int usrp_basic::usb_data_rate | ( | ) | const [inline] |
| bool usrp_basic::write_aux_dac | ( | int | slot, | |
| int | which_dac, | |||
| int | value | |||
| ) | [protected] |
Write auxiliary digital to analog converter.
| slot | Which Tx or Rx slot to write. N.B., SLOT_TX_A and SLOT_RX_A share the same AUX DAC's. SLOT_TX_B and SLOT_RX_B share the same AUX DAC's. | |
| which_dac | [0,3] RX slots must use only 0 and 1. TX slots must use only 2 and 3. | |
| value | [0,4095] |
Reimplemented in usrp_basic_rx, and usrp_basic_tx.
| bool usrp_basic::write_eeprom | ( | int | i2c_addr, | |
| int | eeprom_offset, | |||
| const std::string | buf | |||
| ) |
Write EEPROM on motherboard or any daughterboard.
| i2c_addr | I2C bus address of EEPROM | |
| eeprom_offset | byte offset in EEPROM to begin writing | |
| buf | the data to write |
| bool usrp_basic::write_i2c | ( | int | i2c_addr, | |
| const std::string | buf | |||
| ) |
Write to I2C peripheral.
| i2c_addr | I2C bus address (7-bits) | |
| buf | the data to write |
int usrp_basic::d_bytes_per_poll [protected] |
unsigned int usrp_basic::d_fpga_shadows[MAX_REGS] [protected] |
struct usb_dev_handle* usrp_basic::d_udh [read, protected] |
int usrp_basic::d_usb_data_rate [protected] |
Referenced by usb_data_rate().
bool usrp_basic::d_verbose [protected] |
Referenced by set_verbose().
const int usrp_basic::MAX_REGS = 128 [static, protected] |
const int usrp_basic::READ_FAILED = -99999 [static] |
magic value used on alternate register read interfaces
1.5.8