📄 usbdesc.h
字号:
/*-----------------------------------------------------------------------------
$File: //tdi_sw/tdi/source/usb/common/usbdesc.h $
$DateTime: 2004/12/20 19:06:16 $
$Revision: #4 $
Purpose: USB Descriptors and structures.
CONFIDENTIAL AND PROPRIETARY INFORMATION OF TRANSDIMENSION, INC.
AND/OR ITS WHOLLY OWNED SUBSIDIARY SOFTCONNEX TECHNOLOGIES, INC.
THIS NOTICE IS NOT TO BE DELETED, MODIFIED, MOVED OR CHANGED IN ANY WAY.
(TransDimension, Inc. and SoftConnex Technologies, Inc. are referred to
collectively below as TransDimension, Inc.)
Copyright (c) 1999 - 2004 by TransDimension, 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 TransDimension, Inc.. 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, TransDimension, 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.
-----------------------------------------------------------------------------*/
#ifndef _SOFTCONNEX_USBDESC_H_
#define _SOFTCONNEX_USBDESC_H_
/******************************************************************************
Include Files
******************************************************************************/
#include "usb.h"
/******************************************************************************
Public Definitions
******************************************************************************/
/******************************************************************************
Public Data Types
******************************************************************************/
/*------------------------------------------------------------------------------
USB SPECIFIED STRING DESCRIPTOR
------------------------------------------------------------------------------*/
typedef struct _UsbDescriptor
{
U8 bLength;
U8 bDescriptorType;
}
UsbDescriptor;
#define USBDESC_BLENGTH 0
#define USBDESC_BDESCRIPTORTYPE 1
typedef struct _StringDescriptor
{
U8 bLength;
U8 bDescriptorType;
SctUnicode bString[1];
}
StringDescriptor;
#define USBDESC_STR_BSTRING 2
#define USBDESC_STR_DESCRIPTOR_SIZE 4
/* Need these for using the correct types in the below descriptors. */
struct _DeviceDescriptor;
struct _ConfigurationDescriptor;
struct _InterfaceDescriptor;
struct _EndpointDescriptor;
struct _OtgDescriptor;
/*------------------------------------------------------------------------------
OTG Descriptor:
------------------------------------------------------------------------------*/
typedef struct _OtgDescriptor
{
U8 bLength;
U8 bDescriptorType;
U8 bmAttributes;
}
OtgDescriptor;
#define USBDESC_OTG_DESC_BMATTRIBUTES 2
#define USBDESC_OTG_DESCRIPTOR_SIZE 3
/*------------------------------------------------------------------------------
Endpoint Descriptor:
------------------------------------------------------------------------------*/
typedef struct _EndpointDescriptor
{
U8 bLength;
U8 bDescriptorType;
U8 bEndpointAddress;
U8 bmAttributes;
U16 wMaxPacketSize;
U8 bInterval;
}
EndpointDescriptor;
#define USBDESC_EP_BENDPOINTADDRESS 2
#define USBDESC_EP_BMATTRIBUTES 3
#define USBDESC_EP_WMAXPACKETSIZE 4
#define USBDESC_EP_BINTERVAL 6
#define USBDESC_EP_DESCRIPTOR_SIZE 7
#define USBDESC_EP_NUM_MASK 0x0F
#define USBDESC_EP_TYPE_MASK 0x03
#define USBDESC_EP_DIRECTION 0x80
/*------------------------------------------------------------------------------
Interface Descriptor:
------------------------------------------------------------------------------*/
typedef struct _InterfaceDescriptor
{
U8 bLength;
U8 bDescriptorType;
U8 bInterfaceNumber;
U8 bAlternateSetting;
U8 bNumEndpoints;
U8 bInterfaceClass;
U8 bInterfaceSubClass;
U8 bInterfaceProtocol;
U8 iInterface;
}
InterfaceDescriptor;
#define USBDESC_INTF_BINTERFACENUMBER 2
#define USBDESC_INTF_BALTERNATESETTING 3
#define USBDESC_INTF_BNUMENDPOINTS 4
#define USBDESC_INTF_BINTERFACECLASS 5
#define USBDESC_INTF_BINTERFACESUBCLASS 6
#define USBDESC_INTF_BINTERFACEPROTOCOL 7
#define USBDESC_INTF_IINTERFACE 8
#define USBDESC_INTF_DESCRIPTOR_SIZE 9
/*------------------------------------------------------------------------------
Configuration Descriptor:
------------------------------------------------------------------------------*/
typedef struct _ConfigurationDescriptor
{
U8 bLength;
U8 bDescriptorType;
U16 wTotalLength;
U8 bNumInterfaces;
U8 bConfigurationValue;
U8 iConfiguration;
U8 bmAttributes;
U8 MaxPower;
}
ConfigurationDescriptor;
#define USBDESC_CONFIG_WTOTALLENGTH 2
#define USBDESC_CONFIG_BNUMINTERFACES 4
#define USBDESC_CONFIG_BCONFIGURATIONVALUE 5
#define USBDESC_CONFIG_ICONFIGURATION 6
#define USBDESC_CONFIG_BMATTRIBUTES 7
#define USBDESC_CONFIG_MAXPOWER 8
#define USBDESC_CONFIG_DESCRIPTOR_SIZE 9
/*------------------------------------------------------------------------------
Device Descriptor:
------------------------------------------------------------------------------*/
typedef struct _DeviceDescriptor
{
U8 bLength;
U8 bDescriptorType;
U16 bcdUSB;
U8 bDeviceClass;
U8 bDeviceSubClass;
U8 bDeviceProtocol;
U8 bMaxPacketSize0;
U16 idVendor;
U16 idProduct;
U16 bcdDevice;
U8 iManufacturer;
U8 iProduct;
U8 iSerialNumber;
U8 bNumConfigurations;
}
DeviceDescriptor;
#define USBDESC_DEVICE_BCDUSB 2
#define USBDESC_DEVICE_BDEVICECLASS 4
#define USBDESC_DEVICE_BDEVICESUBCLASS 5
#define USBDESC_DEVICE_BDEVICEPROTOCOL 6
#define USBDESC_DEVICE_BMAXPACKETSIZE0 7
#define USBDESC_DEVICE_IDVENDOR 8
#define USBDESC_DEVICE_IDPRODUCT 10
#define USBDESC_DEVICE_BCDDEVICE 12
#define USBDESC_DEVICE_IMANUFACTURER 14
#define USBDESC_DEVICE_IPRODUCT 15
#define USBDESC_DEVICE_ISERIALNUMBER 16
#define USBDESC_DEVICE_BNUMCONFIGURATIONS 17
#define USBDESC_DEVICE_DESCRIPTOR_SIZE 18
/******************************************************************************
Public Functions
******************************************************************************/
#endif /* _SOFTCONNEX_USBDESC_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -