OpenOCD
|
Go to the source code of this file.
Functions | |
int | jtag_libusb_bulk_read (jtag_libusb_device_handle *dev, int ep, char *bytes, int size, int timeout) |
int | jtag_libusb_bulk_write (jtag_libusb_device_handle *dev, int ep, char *bytes, int size, int timeout) |
int | jtag_libusb_choose_interface (struct jtag_libusb_device_handle *devh, unsigned int *usb_read_ep, unsigned int *usb_write_ep, int bclass, int subclass, int protocol) |
Find the first interface optionally matching class, subclass and protocol and claim it. More... | |
void | jtag_libusb_close (jtag_libusb_device_handle *dev) |
int | jtag_libusb_control_transfer (jtag_libusb_device_handle *dev, uint8_t requestType, uint8_t request, uint16_t wValue, uint16_t wIndex, char *bytes, uint16_t size, unsigned int timeout) |
int | jtag_libusb_get_pid (struct jtag_libusb_device *dev, uint16_t *pid) |
static bool | jtag_libusb_match (struct libusb_device_descriptor *dev_desc, const uint16_t vids[], const uint16_t pids[]) |
int | jtag_libusb_open (const uint16_t vids[], const uint16_t pids[], const char *serial, struct jtag_libusb_device_handle **out) |
int | jtag_libusb_set_configuration (jtag_libusb_device_handle *devh, int configuration) |
static bool | string_descriptor_equal (libusb_device_handle *device, uint8_t str_index, const char *string) |
Variables | |
static libusb_device ** | devs |
The usb device list. More... | |
static struct libusb_context * | jtag_libusb_context |
Libusb context. More... | |
int jtag_libusb_bulk_read | ( | jtag_libusb_device_handle * | dev, |
int | ep, | ||
char * | bytes, | ||
int | size, | ||
int | timeout | ||
) |
Definition at line 149 of file libusb1_common.c.
Referenced by jtag_libusb_release_interface().
int jtag_libusb_bulk_write | ( | jtag_libusb_device_handle * | dev, |
int | ep, | ||
char * | bytes, | ||
int | size, | ||
int | timeout | ||
) |
Definition at line 139 of file libusb1_common.c.
Referenced by jtag_libusb_release_interface().
int jtag_libusb_choose_interface | ( | struct jtag_libusb_device_handle * | devh, |
unsigned int * | usb_read_ep, | ||
unsigned int * | usb_write_ep, | ||
int | bclass, | ||
int | subclass, | ||
int | protocol | ||
) |
Find the first interface optionally matching class, subclass and protocol and claim it.
devh | libusb device handle. |
usb_read_ep | A pointer to a variable where the IN endpoint number will be stored. |
usb_write_ep | A pointer to a variable where the OUT endpoint number will be stored. |
bclass | bInterfaceClass to match, or -1 to ignore this field. |
subclass | bInterfaceSubClass to match, or -1 to ignore this field. |
protocol | bInterfaceProtocol to match, or -1 to ignore this field. |
Definition at line 187 of file libusb1_common.c.
References usb_interface_descriptor::bInterfaceClass, usb_interface_descriptor::bInterfaceNumber, usb_interface_descriptor::bInterfaceProtocol, usb_interface_descriptor::bNumEndpoints, config, ERROR_FAIL, ERROR_OK, iface, jtag_libusb_device, jtag_libusb_get_device, and LOG_DEBUG.
Referenced by jtag_libusb_release_interface().
void jtag_libusb_close | ( | jtag_libusb_device_handle * | dev | ) |
Definition at line 116 of file libusb1_common.c.
References jtag_libusb_context.
Referenced by jtag_libusb_release_interface().
int jtag_libusb_control_transfer | ( | jtag_libusb_device_handle * | dev, |
uint8_t | requestType, | ||
uint8_t | request, | ||
uint16_t | wValue, | ||
uint16_t | wIndex, | ||
char * | bytes, | ||
uint16_t | size, | ||
unsigned int | timeout | ||
) |
Definition at line 124 of file libusb1_common.c.
Referenced by jtag_libusb_release_interface().
int jtag_libusb_get_pid | ( | struct jtag_libusb_device * | dev, |
uint16_t * | pid | ||
) |
Definition at line 237 of file libusb1_common.c.
References ERROR_FAIL, and ERROR_OK.
Referenced by jtag_libusb_release_interface().
|
static |
Definition at line 29 of file libusb1_common.c.
Referenced by jtag_libusb_open().
int jtag_libusb_open | ( | const uint16_t | vids[], |
const uint16_t | pids[], | ||
const char * | serial, | ||
struct jtag_libusb_device_handle ** | out | ||
) |
Definition at line 69 of file libusb1_common.c.
References busses, devs, jtag_libusb_context, jtag_libusb_device_handle, jtag_libusb_match(), LOG_ERROR, NULL, string_descriptor_equal(), and usb_init().
Referenced by jtag_libusb_release_interface().
int jtag_libusb_set_configuration | ( | jtag_libusb_device_handle * | devh, |
int | configuration | ||
) |
Definition at line 159 of file libusb1_common.c.
References config, jtag_libusb_device, jtag_libusb_get_device, and NULL.
Referenced by jtag_libusb_release_interface().
|
static |
Definition at line 42 of file libusb1_common.c.
References LOG_DEBUG, and LOG_ERROR.
Referenced by jtag_libusb_open().
|
static |
The usb device list.
Definition at line 27 of file libusb1_common.c.
Referenced by cmsis_dap_usb_open(), discovery_usb_scan(), jlink_init(), and jtag_libusb_open().
|
static |
Libusb context.
Definition at line 26 of file libusb1_common.c.
Referenced by jtag_libusb_close(), and jtag_libusb_open().