33 USB_debug(
"Invalid USB device descriptor (NULL POINTER)\n");
36 USB_debug(
" Length = %2d%s\n", desc->bLength,
37 desc->bLength == USB_DT_DEVICE_SIZE ?
"" :
" (!!!)");
38 USB_debug(
" DescriptorType = %02x\n", desc->bDescriptorType);
39 USB_debug(
" USB version = %x.%02x\n",
40 desc->bcdUSB >> 8, desc->bcdUSB & 0xff);
41 USB_debug(
" Vendor:Product = %04x:%04x\n",
42 desc->idVendor, desc->idProduct);
43 USB_debug(
" MaxPacketSize0 = %d\n", desc->bMaxPacketSize0);
44 USB_debug(
" NumConfigurations = %d\n", desc->bNumConfigurations);
45 USB_debug(
" Device version = %x.%02x\n",
46 desc->bcdDevice >> 8, desc->bcdDevice & 0xff);
47 USB_debug(
" Device Class:SubClass:Protocol = %02x:%02x:%02x\n",
48 desc->bDeviceClass, desc->bDeviceSubClass, desc->bDeviceProtocol);
49 switch (desc->bDeviceClass)
52 USB_debug(
" Per-interface classes\n");
55 USB_debug(
" Audio device class\n");
58 USB_debug(
" Communications class\n");
61 USB_debug(
" Human Interface Devices class\n");
63 case USB_CLASS_PRINTER:
64 USB_debug(
" Printer device class\n");
66 case USB_CLASS_MASS_STORAGE:
67 USB_debug(
" Mass Storage device class\n");
70 USB_debug(
" Hub device class\n");
72 case USB_CLASS_VENDOR_SPEC:
73 USB_debug(
" Vendor class\n");
76 USB_debug(
" Unknown class\n");
84 USB_debug(
"Configuration:\n");
85 USB_debug(
" bLength = %4d%s\n", desc->bLength,
86 desc->bLength == USB_DT_CONFIG_SIZE ?
"" :
" (!!!)");
87 USB_debug(
" bDescriptorType = %02x\n", desc->bDescriptorType);
88 USB_debug(
" wTotalLength = %04x\n", desc->wTotalLength);
89 USB_debug(
" bNumInterfaces = %02x\n", desc->bNumInterfaces);
90 USB_debug(
" bConfigurationValue = %02x\n", desc->bConfigurationValue);
91 USB_debug(
" iConfiguration = %02x\n", desc->iConfiguration);
92 USB_debug(
" bmAttributes = %02x\n", desc->bmAttributes);
93 USB_debug(
" MaxPower = %4dmA\n", desc->MaxPower * 2);
100 USB_debug(
" Interface: %d\n", desc->bInterfaceNumber);
101 USB_debug(
" Alternate Setting: %2d\n", desc->bAlternateSetting);
102 USB_debug(
" bLength = %4d%s\n", desc->bLength,
103 desc->bLength == USB_DT_INTERFACE_SIZE ?
"" :
" (!!!)");
104 USB_debug(
" bDescriptorType = %02x\n", desc->bDescriptorType);
105 USB_debug(
" bInterfaceNumber = %02x\n", desc->bInterfaceNumber);
106 USB_debug(
" bAlternateSetting = %02x\n", desc->bAlternateSetting);
107 USB_debug(
" bNumEndpoints = %02x\n", desc->bNumEndpoints);
108 USB_debug(
" bInterface Class:SubClass:Protocol = %02x:%02x:%02x\n",
109 desc->bInterfaceClass, desc->bInterfaceSubClass, desc->bInterfaceProtocol);
110 USB_debug(
" iInterface = %02x\n", desc->iInterface);
118 char *LengthCommentString = (desc->bLength ==
119 USB_DT_ENDPOINT_AUDIO_SIZE) ?
" (Audio)" : (desc->bLength ==
120 USB_DT_ENDPOINT_SIZE) ?
"" :
" (!!!)";
121 char *EndpointType[4] = {
"Control",
"Isochronous",
"Bulk",
"Interrupt" };
123 USB_debug(
" Endpoint:\n");
124 USB_debug(
" bLength = %4d%s\n",
125 desc->bLength, LengthCommentString);
126 USB_debug(
" bDescriptorType = %02x\n", desc->bDescriptorType);
127 USB_debug(
" bEndpointAddress = %02x (%s)\n", desc->bEndpointAddress,
128 (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
129 USB_ENDPOINT_XFER_CONTROL ?
"i/o" :
130 (desc->bEndpointAddress & USB_ENDPOINT_DIR_MASK) ?
"in" :
"out");
131 USB_debug(
" bmAttributes = %02x (%s)\n", desc->bmAttributes,
132 EndpointType[USB_ENDPOINT_XFERTYPE_MASK & desc->bmAttributes]);
133 USB_debug(
" wMaxPacketSize = %04x\n", desc->wMaxPacketSize);
134 USB_debug(
" bInterval = %02x\n", desc->bInterval);
137 if (desc->bLength == USB_DT_ENDPOINT_AUDIO_SIZE)
139 USB_debug(
" bRefresh = %02x\n", desc->bRefresh);
140 USB_debug(
" bSynchAddress = %02x\n", desc->bSynchAddress);
147void usbh_print_usb_string(
USB_DEV_T *dev,
char *
id,
int index)
153 if (usbh_translate_string(dev, index, buf, 256) > 0)
154 USB_debug(
"%s: %s\n",
id, buf);
159void usbh_dump_urb(
URB_T *purb)
161 USB_debug (
"urb :0x%x\n", (
int)purb);
162 USB_debug (
"next :0x%x\n", (
int)purb->
next);
163 USB_debug (
"dev :0x%x\n", (
int)purb->
dev);
164 USB_debug (
"pipe :0x%08x\n", purb->
pipe);
165 USB_debug (
"status :%d\n", purb->
status);
170 USB_debug (
"setup_packet :0x%x\n", (
int)purb->
setup_packet);
171 USB_debug (
"start_frame :%d\n", purb->
start_frame);
173 USB_debug (
"interval :%d\n", purb->
interval);
174 USB_debug (
"error_count :%d\n", purb->
error_count);
175 USB_debug (
"complete :0x%x\n", (
int)purb->
complete);
NUC472/NUC442 peripheral access layer header file. This file contains all the peripheral register's d...
int transfer_buffer_length
void(* complete)(struct urb_t *)
HIDDEN_SYMBOLS struct usb_device USB_DEV_T
USB Host core driver header file.