📄 usb_descr.c
字号:
/*------------------------------------------------------------------------------
$File: //tdi_sw/tdi/examples/usb/pcd/echo/usb_descr.c $
$DateTime: 2004/12/20 19:06:16 $
$Revision: #5 $
Purpose: All USB descriptors required by this test device
------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------
CONFIDENTIAL AND PROPRIETARY INFORMATION OF SOFTCONNEX TECHNOLOGIES, INC.
THIS NOTICE IS NOT TO BE DELETED, MODIFIED, MOVED OR CHANGED IN ANY WAY.
Copyright (c) 1999 - 2004 by SoftConnex Technologies, Inc.
This software is protected by copyright laws and international copyright
treaties, as well as other intellectual property laws and treaties. This
software is a CONFIDENTIAL, unpublished work of authorship, and with portions
constituting TRADE SECRETS of SoftConnex Technologies, Inc., a Delaware USA
corporation. Any unauthorized use, disclosure, and/or reproduction of this
software, or any part of this software; or distribution of this software in any
form or by any means; or storage of this software in any database or retrieval
system, without the express written consent of, and license from, SoftConnex
Technologies, Inc. is strictly prohibited. This software is protected under the
copyright and/or trade secret laws in other countries in addition to USA. All
Rights Reserved. Failure to abide by the use, disclosure and/or reproduction
restrictions may result in civil and /or criminal penalties, and will be
prosecuted to the maximum extent of the law.
------------------------------------------------------------------------------*/
#include "project.h"
/******************************************************************************
Include Files
******************************************************************************/
/* Following descriptors are defined for a vendor-specific "echoing" device
** so that we can exercise all types of transfers
*/
U8 fsDeviceDescriptor[18] =
{
0x12,
USB_DEVICE_DESCRIPTOR,
0x00, /* bcdUSB */
0x02, /* USB 2.0 */
0xFF, /* bDeviceClass, interface will define */
0xFF, /* bDeviceSubClass, ... */
0xFF, /* bDeviceProtocol */
FS_CTRL_MPS, /* bMaxPacketSize0, 8 bytes */
0x20, /* idVendor, TDI 0x0B20 */
0x0B,
0xC0, /* idProduct */
0x0E,
0x00, /* bcdDevice */
0x01,
0x01, /* iManufacturer */
0x02, /* iProduct */
0x03, /* iSerialNumber */
0x01 /* bNumConfigurations */
};
U8 hsDeviceDescriptor[18] =
{
0x12,
USB_DEVICE_DESCRIPTOR,
0x00, /* bcdUSB */
0x02, /* USB 2.0 */
0xFF, /* bDeviceClass, interface will define */
0xFF, /* bDeviceSubClass, ... */
0xFF, /* bDeviceProtocol */
HS_CTRL_MPS, /* bMaxPacketSize0, 64 bytes */
0x20, /* idVendor, TDI 0x0B20 */
0x0B,
0xC0, /* idProduct */
0x0E,
0x00, /* bcdDevice */
0x01,
0x01, /* iManufacturer */
0x02, /* iProduct */
0x03, /* iSerialNumber */
0x01 /* bNumConfigurations */
};
U8 fsConfigDescriptor[60] =
{
9, /* size of USB config descriptor */
USB_CONFIG_DESCRIPTOR, /* bDescriptorType, configuration */
0x3C, /* wTotalLength */
0x00,
0x01, /* bNumInterfaces */
1, /* bConfigurationValue */
0x00, /* iConfiguration */
0xC0, /* bmAttributes, self powered */
0x03, /* bMaxPower */
9, /* size of interface descriptor */
4, /* bDescriptorType, interface */
0x00, /* bInterfaceNumber */
0x00, /* bAlternateSetting */
0x06, /* bNumEndpoints */
0xFF, /* bInterfaceClass */
0xFF, /* bInterfaceSubClass */
0xFF, /* bInterfaceProtocol */
0x00, /* iInterface */
7, /* Size of USB ENDPOINT DESCRIPTOR */
5, /* bDescriptorType, endpoint */
0x01, /* bEndpointAddress */
USB_ISOCH_ENDPOINT, /* bmAttributes, iso */
(FS_ISOCH_MPS & 0xFF),
((FS_ISOCH_MPS >> 8) & 0xFF),
FS_ISO_INTERVAL, /* bInterval, not used */
7, /* Size of USB ENDPOINT DESCRIPTOR */
5, /* bDescriptorType, endpoint */
0x82, /* bEndpointAddress */
USB_ISOCH_ENDPOINT, /* bmAttributes, iso */
(FS_ISOCH_MPS & 0xFF),
((FS_ISOCH_MPS >> 8) & 0xFF),
FS_ISO_INTERVAL, /* bInterval, not used */
7, /* Size of USB ENDPOINT DESCRIPTOR */
5, /* bDescriptorType, endpoint */
0x03, /* bEndpointAddress */
USB_INT_ENDPOINT, /* bmAttributes, intr */
(FS_INT_MPS & 0xFF),
((FS_INT_MPS >> 8) & 0xFF),
FS_INT_INTERVAL, /* bInterval, not used */
7, /* Size of USB ENDPOINT DESCRIPTOR */
5, /* bDescriptorType, endpoint */
0x84, /* bEndpointAddress */
USB_INT_ENDPOINT, /* bmAttributes, intr */
(FS_INT_MPS & 0xFF),
((FS_INT_MPS >> 8) & 0xFF),
FS_INT_INTERVAL, /* bInterval, not used */
7, /* Size of USB ENDPOINT DESCRIPTOR */
5, /* bDescriptorType, endpoint */
0x05, /* bEndpointAddress */
0x02, /* bmAttributes, bulk */
(FS_BULKOUT_MPS & 0xFF),
((FS_BULKOUT_MPS >> 8) & 0xFF),
0x00, /* bInterval, not used */
7, /* Size of USB ENDPOINT DESCRIPTOR */
5, /* bDescriptorType, endpoint */
0x86, /* bEndpointAddress */
0x02, /* bmAttributes, bulk */
(FS_BULKIN_MPS & 0xFF),
((FS_BULKIN_MPS >> 8) & 0xFF),
0x00, /* bInterval, not used */
};
U8 hsConfigDescriptor[60] =
{
9, /* size of USB config descriptor */
USB_CONFIG_DESCRIPTOR, /* bDescriptorType, configuration */
0x3C, /* wTotalLength */
0x00,
0x01, /* bNumInterfaces */
1, /* bConfigurationValue */
0x00, /* iConfiguration */
0xC0, /* bmAttributes, self powered */
0x03, /* bMaxPower */
9, /* size of interface descriptor */
4, /* bDescriptorType, interface */
0x00, /* bInterfaceNumber */
0x00, /* bAlternateSetting */
0x06, /* bNumEndpoints */
0xFF, /* bInterfaceClass */
0xFF, /* bInterfaceSubClass */
0xFF, /* bInterfaceProtocol */
0x00, /* iInterface */
7, /* Size of USB ENDPOINT DESCRIPTOR */
5, /* bDescriptorType, endpoint */
0x01, /* bEndpointAddress */
USB_ISOCH_ENDPOINT, /* bmAttributes, iso */
(HS_ISOCH_MPS & 0xFF),
((HS_ISOCH_MPS >> 8) & 0xFF),
HS_ISO_INTERVAL, /* bInterval, not used */
7, /* Size of USB ENDPOINT DESCRIPTOR */
5, /* bDescriptorType, endpoint */
0x82, /* bEndpointAddress */
USB_ISOCH_ENDPOINT, /* bmAttributes, iso */
(HS_ISOCH_MPS & 0xFF),
((HS_ISOCH_MPS >> 8) & 0xFF),
HS_ISO_INTERVAL, /* bInterval, not used */
7, /* Size of USB ENDPOINT DESCRIPTOR */
5, /* bDescriptorType, endpoint */
0x03, /* bEndpointAddress */
USB_INT_ENDPOINT, /* bmAttributes, intr */
(HS_INT_MPS & 0xFF),
((HS_INT_MPS >> 8) & 0xFF),
HS_INT_INTERVAL, /* bInterval, not used */
7, /* Size of USB ENDPOINT DESCRIPTOR */
5, /* bDescriptorType, endpoint */
0x84, /* bEndpointAddress */
USB_INT_ENDPOINT, /* bmAttributes, intr */
(HS_INT_MPS & 0xFF),
((HS_INT_MPS >> 8) & 0xFF),
HS_INT_INTERVAL, /* bInterval, not used */
7, /* Size of USB ENDPOINT DESCRIPTOR */
5, /* bDescriptorType, endpoint */
0x05, /* bEndpointAddress */
0x02, /* bmAttributes, bulk */
(HS_BULKOUT_MPS & 0xFF),
((HS_BULKOUT_MPS >> 8) & 0xFF),
0x00, /* bInterval, not used */
7, /* Size of USB ENDPOINT DESCRIPTOR */
5, /* bDescriptorType, endpoint */
0x86, /* bEndpointAddress */
0x02, /* bmAttributes, bulk */
(HS_BULKIN_MPS & 0xFF),
((HS_BULKIN_MPS >> 8) & 0xFF),
0x00, /* bInterval, not used */
};
/* 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 */
0xFF, /* bDeviceClass */
0xFF, /* bDeviceSubClass */
0xFF, /* bDeviceProtocol */
0x40, /* bMaxPacketSize0 */
0x01, /* bNumConfigurations */
0
};
/* USB 2.0 specific descriptor */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -