|
Universal Software Radio Peripheral
|
#include "usrp_primsi.h"#include "usrp_commands.h"#include <libusb-1.0/libusb.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 libusb_device * | _get_usb_device (struct libusb_device_handle *udh) |
| struct libusb_device_descriptor | _get_usb_device_descriptor (struct libusb_device *q) |
| int | _get_usb_string_descriptor (struct libusb_device_handle *udh, int index, unsigned char *data, int length) |
| int | _usb_control_transfer (struct libusb_device_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 (struct libusb_context *ctx) |
| deinitialize libusb | |
| void | usrp_rescan () |
| struct libusb_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 libusb_device_handle * | usrp_open_interface (libusb_device *dev, int interface, int altinterface) |
| bool | usrp_close_interface (libusb_device_handle *udh) |
| close interface. | |
| int | write_cmd (struct libusb_device_handle *udh, int request, int value, int index, unsigned char *bytes, int len) |
| struct libusb_device* _get_usb_device | ( | struct libusb_device_handle * | udh | ) | [read] |
| struct libusb_device_descriptor _get_usb_device_descriptor | ( | struct libusb_device * | q | ) | [read] |
| int _get_usb_string_descriptor | ( | struct libusb_device_handle * | udh, |
| int | index, | ||
| unsigned char * | data, | ||
| int | length | ||
| ) |
| int _usb_control_transfer | ( | struct libusb_device_handle * | udh, |
| int | request_type, | ||
| int | request, | ||
| int | value, | ||
| int | index, | ||
| unsigned char * | data, | ||
| int | length, | ||
| unsigned int | timeout | ||
| ) |
| bool usrp_close_interface | ( | libusb_device_handle * | udh | ) |
close interface.
Referenced by usrp_basic::~usrp_basic(), usrp_load_firmware_nth(), usrp_load_standard_bits(), and main().
| void usrp_deinit | ( | libusb_context * | ctx | ) |
deinitialize libusb
libusb-0.1: No effect
libusb-1.0: Deinitialize context ctx
Referenced by usrp_basic::~usrp_basic().
| struct libusb_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_usrp_p(), and usrp_fx2_p().
Referenced by usrp_basic::usrp_basic(), usrp_load_standard_bits(), and main().
| 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.
Referenced by usrp_basic::usrp_basic(), usrp_find_device(), and main().
| struct libusb_device_handle* usrp_open_interface | ( | libusb_device * | dev, |
| int | interface, | ||
| int | altinterface | ||
| ) | [read] |
| void usrp_rescan | ( | ) |
Referenced by usrp_load_firmware_nth().
| int write_cmd | ( | struct libusb_device_handle * | udh, |
| int | request, | ||
| int | value, | ||
| int | index, | ||
| unsigned char * | bytes, | ||
| int | len | ||
| ) |
1.7.5