📄 usb_descr.c
字号:
0,2, /* bcdUSB USB revision 2.0 */
0, /* bDeviceClass */
0, /* bDeviceSubClass */
0, /* bDeviceProtocol */
8, /* bMaxPacketSize0 */
0x01, /* bNumConfigurations */
0
};
/* USB 2.0 specific descriptor */
U8 hsDeviceQualifierDescriptor[10] =
{
10, /* bLength Length of this descriptor */
USB_DEVICE_QUALIFIER_DESCRIPTOR, /* bDescType This is a DEVICE Qualifier descr */
0,2, /* bcdUSB USB revision 2.0 */
0, /* bDeviceClass */
0, /* bDeviceSubClass */
0, /* bDeviceProtocol */
0x40, /* bMaxPacketSize0 */
0x01, /* bNumConfigurations */
0
};
U8 fsOtherSpeedConfigDescriptor[67] =
{
9,
USB_OTHER_SPEED_CONFIG_DESCRIPTOR, /* bDescriptorType, OTher speed configuration */
0x43, /* wTotalLength */
0x00,
0x02, /* bNumInterfaces */
1, /* bConfigurationValue */
0x04, /* iConfiguration */
0xC0, /* bmAttributes, self powered */
0x0A, /* bMaxPower */
USBDESC_INTF_DESCRIPTOR_SIZE,
USB_INTERFACE_DESCRIPTOR, /* bDescriptorType, interface */
0x00, /* bInterfaceNumber */
0x00, /* bAlternateSetting */
0x01, /* bNumEndpoints: Interrupt endpoint 3 */
0x02, /* bInterfaceClass, Communication Interface Class */
0x02, /* bInterfaceSubClass, Abstract Control Model (ACM) */
0x01, /* bInterfaceProtocol, V.25ter (Common AT) commands */
0x04, /* String index for string describing this iInterface */
/* Header Functional Descriptor */
USBDESC_HDR_FUNC_DESCRIPTOR_SIZE,
CS_INTERFACE, /* bDescriptorType, CS_INTERFACE */
CDC_HDR_FUNC_DESCRIPTOR, /* bDescriptorsubtype: Header Functional Descriptor.
** Beginning of the concatenated set of functional
** descriptors for the interface
*/
0x01, /* bcdCDC 0x0101 */
0x01,
/* Call Management Functional Descriptor */
USBDESC_UNION_FUNC_DESCRIPTOR_SIZE, /* bfunction length */
CS_INTERFACE, /* bDescriptorType CS_INTERFACE */
CDC_CALL_MGMT_FUNC_DESCRIPTOR, /* Functional descriptor, Call Management */
0x03, /* bmCapabilities: Device handles call management
** itself and it can send/receive call management
** information over a data class interface
*/
0x01, /* bDataInterface: interface number of data class interface */
/* Union Functional Descriptor */
USBDESC_UNION_FUNC_DESCRIPTOR_SIZE, /* bfunction length */
CS_INTERFACE, /* bDescriptorType CS_INTERFACE */
CDC_UNION_FUNC_DESCRIPTOR, /* Union descriptor Functional descriptor subtype */
0x00, /* bMasterInterface: Master or controlling interface is interface 0 */
0x01, /* bSlaveInterface0: Interface 1 is first slave interface */
/* Abstract Control Management Functional Descriptor */
USBDESC_ACM_FUNC_DESCRIPTOR_SIZE, /* bfunction length, CDC */
CS_INTERFACE, /* bDescriptorType CS_INTERFACE */
CDC_ACM_FUNC_DESCRIPTOR, /* ACM Functional descriptor subtype */
0x02, /* bmCapabilities: Device supports the request
** combination of SET_LINE_CODING, SET_CONTROL_LINE_STATE,
** GET_LINE_CODING and the notification SERIAL_STATE
*/
USBDESC_EP_DESCRIPTOR_SIZE,
USB_ENDPOINT_DESCRIPTOR, /* bDescriptorType, endpoint */
0x83, /* bEndpointAddress */
0x03, /* bmAttributes: Interrupt endpoint */
0x10, /* wMaxPacketSize */
0x00,
0x0A, /* bInterval: 10ms */
USBDESC_INTF_DESCRIPTOR_SIZE,
USB_INTERFACE_DESCRIPTOR, /* bDescriptorType, interface */
0x01, /* bInterfaceNumber */
0x00, /* bAlternateSetting */
0x02, /* bNumEndpoints: Bulk IN and Bulk OUT */
0x0A, /* bInterfaceClass, Data Interface Class */
0x00, /* bInterfaceSubClass, Abstract Control Model (ACM) */
0x00, /* bInterfaceProtocol, V.25ter (Common AT) commands */
0x05, /* string index for string describing this iInterface */
USBDESC_EP_DESCRIPTOR_SIZE,
USB_ENDPOINT_DESCRIPTOR, /* bDescriptorType, endpoint */
0x01, /* bEndpointAddress */
0x02, /* bmAttributes: Bulk endpoint */
0x20, /* wMaxPacketSize */
0x00,
0x00, /* bInterval, not used */
USBDESC_EP_DESCRIPTOR_SIZE,
USB_ENDPOINT_DESCRIPTOR, /* bDescriptorType, endpoint */
0x82, /* bEndpointAddress */
0x02, /* bmAttributes: Bulk endpoint */
0x10, /* wMaxPacketSize */
0x00,
0x00 /* bInterval, not used */
};
U8 hsOtherSpeedConfigDescriptor[67] =
{
9,
USB_OTHER_SPEED_CONFIG_DESCRIPTOR, /* bDescriptorType, OTher speed configuration */
0x43, /* wTotalLength */
0x00,
0x02, /* bNumInterfaces */
1, /* bConfigurationValue */
0x04, /* iConfiguration */
0xC0, /* bmAttributes, self powered */
0x0A, /* bMaxPower */
USBDESC_INTF_DESCRIPTOR_SIZE,
USB_INTERFACE_DESCRIPTOR, /* bDescriptorType, interface */
0x00, /* bInterfaceNumber */
0x00, /* bAlternateSetting */
0x01, /* bNumEndpoints: Interrupt endpoint 3 */
0x02, /* bInterfaceClass, Communication Interface Class */
0x02, /* bInterfaceSubClass, Abstract Control Model (ACM) */
0x01, /* bInterfaceProtocol, V.25ter (Common AT) commands */
0x04, /* String index for string describing this iInterface */
/* Header Functional Descriptor */
USBDESC_HDR_FUNC_DESCRIPTOR_SIZE,
CS_INTERFACE, /* bDescriptorType, CS_INTERFACE */
CDC_HDR_FUNC_DESCRIPTOR, /* bDescriptorsubtype: Header Functional Descriptor.
** Beginning of the concatenated set of functional
** descriptors for the interface
*/
0x01, /* bcdCDC 0x0101 */
0x01,
/* Call Management Functional Descriptor */
USBDESC_UNION_FUNC_DESCRIPTOR_SIZE, /* bfunction length */
CS_INTERFACE, /* bDescriptorType CS_INTERFACE */
CDC_CALL_MGMT_FUNC_DESCRIPTOR, /* Functional descriptor, Call Management */
0x03, /* bmCapabilities: Device handles call management
** itself and it can send/receive call management
** information over a data class interface
*/
0x01, /* bDataInterface: interface number of data class interface */
/* Union Functional Descriptor */
USBDESC_UNION_FUNC_DESCRIPTOR_SIZE, /* bfunction length */
CS_INTERFACE, /* bDescriptorType CS_INTERFACE */
CDC_UNION_FUNC_DESCRIPTOR, /* Union descriptor Functional descriptor subtype */
0x00, /* bMasterInterface: Master or controlling interface is interface 0 */
0x01, /* bSlaveInterface0: Interface 1 is first slave interface */
/* Abstract Control Management Functional Descriptor */
USBDESC_ACM_FUNC_DESCRIPTOR_SIZE, /* bfunction length, CDC */
CS_INTERFACE, /* bDescriptorType CS_INTERFACE */
CDC_ACM_FUNC_DESCRIPTOR, /* ACM Functional descriptor subtype */
0x02, /* bmCapabilities: Device supports the request
** combination of SET_LINE_CODING, SET_CONTROL_LINE_STATE,
** GET_LINE_CODING and the notification SERIAL_STATE
*/
USBDESC_EP_DESCRIPTOR_SIZE,
USB_ENDPOINT_DESCRIPTOR, /* bDescriptorType, endpoint */
0x83, /* bEndpointAddress */
0x03, /* bmAttributes: Interrupt endpoint */
0x10, /* wMaxPacketSize */
0x00,
0x0A, /* bInterval: 10ms */
USBDESC_INTF_DESCRIPTOR_SIZE,
USB_INTERFACE_DESCRIPTOR, /* bDescriptorType, interface */
0x01, /* bInterfaceNumber */
0x00, /* bAlternateSetting */
0x02, /* bNumEndpoints: Bulk IN and Bulk OUT */
0x0A, /* bInterfaceClass, Data Interface Class */
0x00, /* bInterfaceSubClass, Abstract Control Model (ACM) */
0x00, /* bInterfaceProtocol, V.25ter (Common AT) commands */
0x05, /* string index for string describing this iInterface */
USBDESC_EP_DESCRIPTOR_SIZE,
USB_ENDPOINT_DESCRIPTOR, /* bDescriptorType, endpoint */
0x01, /* bEndpointAddress */
0x02, /* bmAttributes: Bulk endpoint */
0x20, /* wMaxPacketSize */
0x00,
0x00, /* bInterval, not used */
USBDESC_EP_DESCRIPTOR_SIZE,
USB_ENDPOINT_DESCRIPTOR, /* bDescriptorType, endpoint */
0x82, /* bEndpointAddress */
0x02, /* bmAttributes: Bulk endpoint */
0x10, /* wMaxPacketSize */
0x00,
0x00 /* bInterval, not used */
};
U8 StringDescriptor0[4] =
{
4, /* bLength */
USB_STRING_DESCRIPTOR, /* bDescriptorType, string */
0x09, /* LangID codes, English */
0x00
};
U8 StringDescriptor1[8] =
{
8, /* bLength */
USB_STRING_DESCRIPTOR, /* bDescriptorType, string */
'T',
0x00,
'D',
0x00,
'I',
0x00
};
U8 StringDescriptor2[30] =
{
30, /* bLength */
USB_STRING_DESCRIPTOR, /* bDescriptorType, string */
'C',
0x00,
'D',
0x00,
'C',
0x00,
' ',
0x00,
'A',
0x00,
'C',
0x00,
'M',
0x00,
' ',
0x00,
'D',
0x00,
'e',
0x00,
'v',
0x00,
'i',
0x00,
'c',
0x00,
'e',
0x00
};
U8 StringDescriptor3[12] =
{
12, /* bLength */
USB_STRING_DESCRIPTOR, /* bDescriptorType, string */
'v',
0x00,
'1',
0x00,
'.',
0x00,
'0',
0x00,
'0',
0x00
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -