Universal Software Radio Peripheral
|
#include "usrp_primsi.h"
#include "usrp_commands.h"
#include <usb.h>
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <ad9862.h>
#include <assert.h>
#include "md5.h"
Functions | |
struct usb_device * | _get_usb_device (struct usb_dev_handle *udh) |
struct usb_device_descriptor | _get_usb_device_descriptor (struct usb_device *q) |
int | _get_usb_string_descriptor (struct usb_dev_handle *udh, int index, unsigned char *data, int length) |
int | _usb_control_transfer (struct usb_dev_handle *udh, int request_type, int request, int value, int index, unsigned char *data, int length, unsigned int timeout) |
void | usrp_one_time_init (libusb_context **ctx) |
initialize libusb; Behavior differs depending on libusb version | |
void | usrp_deinit (libusb_context *ctx) |
deinitialize libusb | |
void | usrp_rescan () |
struct usb_device * | usrp_find_device (int nth, bool fx2_ok_p, libusb_context *ctx) |
locate Nth (zero based) USRP device in system. Return pointer or 0 if not found. | |
struct usb_dev_handle * | usrp_open_interface (struct usb_device *dev, int interface, int altinterface) |
bool | usrp_close_interface (struct usb_dev_handle *udh) |
close interface. | |
int | write_cmd (struct usb_dev_handle *udh, int request, int value, int index, unsigned char *bytes, int len) |
struct usb_device* _get_usb_device | ( | struct usb_dev_handle * | udh | ) | [read] |
Referenced by usrp_read_fpga_reg(), usrp_serial_number(), and usrp_write_fpga_reg().
struct usb_device_descriptor _get_usb_device_descriptor | ( | struct usb_device * | q | ) | [read] |
Referenced by usrp_fx2_p(), usrp_hw_rev(), usrp_serial_number(), and usrp_usrp_p().
int _get_usb_string_descriptor | ( | struct usb_dev_handle * | udh, |
int | index, | ||
unsigned char * | data, | ||
int | length | ||
) |
Referenced by usrp_serial_number().
int _usb_control_transfer | ( | struct usb_dev_handle * | udh, |
int | request_type, | ||
int | request, | ||
int | value, | ||
int | index, | ||
unsigned char * | data, | ||
int | length, | ||
unsigned int | timeout | ||
) |
Referenced by usrp_get_hash(), and usrp_set_hash().
bool usrp_close_interface | ( | struct usb_dev_handle * | udh | ) |
close interface.
void usrp_deinit | ( | libusb_context * | ctx | ) |
deinitialize libusb
libusb-0.1: No effect
libusb-1.0: Deinitialize context ctx
struct usb_device* usrp_find_device | ( | int | nth, |
bool | fx2_ok_p = false , |
||
libusb_context * | ctx = NULL |
||
) | [read] |
locate Nth (zero based) USRP device in system. Return pointer or 0 if not found.
The following kinds of devices are considered USRPs:
unconfigured USRP (no firwmare loaded) configured USRP (firmware loaded) unconfigured Cypress FX2 (only if fx2_ok_p is true)
References usrp_fx2_p(), usrp_one_time_init(), and usrp_usrp_p().
void usrp_one_time_init | ( | libusb_context ** | ctx = NULL | ) |
initialize libusb; Behavior differs depending on libusb version
libusb-0.12
Probe busses and devices. The argument is ignored and defaults to NULL. Safe to call more than once.
libusb-1.0
If an location to a libusb_context is passed in, create and write in the new context. If no argument is provided, initialize libusb with the default (NULL) context.
Generally _not_ safe to call more than once with non-NULL argument since a new context will be created each time.
struct usb_dev_handle* usrp_open_interface | ( | struct usb_device * | dev, |
int | interface, | ||
int | altinterface | ||
) | [read] |
Referenced by usrp_open_cmd_interface(), usrp_open_rx_interface(), and usrp_open_tx_interface().
void usrp_rescan | ( | ) |
int write_cmd | ( | struct usb_dev_handle * | udh, |
int | request, | ||
int | value, | ||
int | index, | ||
unsigned char * | bytes, | ||
int | len | ||
) |
Referenced by _usrp_get_status(), usrp_i2c_read(), usrp_i2c_write(), usrp_set_led(), usrp_spi_read(), and usrp_spi_write().