📄 usb_desc.h
字号:
/*
Copyright 2003 Cygnal Integrated Products, Inc.
File: usb_desc.h
Author: JS
Created: JAN 03
Target Device: C8051F320
Header file for USB firmware. Includes descriptor array index
definitions.
*/
#ifndef _USB_DESC_H_
#define _USB_DESC_H_
// Descriptor sizes
#define STD_DSC_SIZE 18 // Device
#define CFG_DSC_SIZE 9 // Configuration
#define IF_DSC_SIZE 9 // Interface
#define EP_DSC_SIZE 7 // Endpoint
// Descriptor indicies - these are used to access specific fields
// of a descriptor array.
// Standard Device Descriptor Array Indicies#define std_bLength 0 // Length of this descriptor#define std_bDescriptorType 1 // Device desc type (const. 0x01)#define std_bcdUSB 2 // USB Specification used (BCD)#define std_bDeviceClass 4 // Device Class#define std_bDeviceSubClass 5 // Device SubClass#define std_bDeviceProtocol 6 // Device Protocol#define std_bMaxPacketSize0 7 // Maximum packet size for Endpoint0#define std_idVendor 8 // Vendor ID #define std_idProduct 10 // Product ID#define std_bcdDevice 12 // Device revision number#define std_iManufacturer 14 // Manufacturer name string index#define std_std_iProduct 15 // Product name string index#define std_iSerialNumber 16 // Serial number string index#define std_bNumConfigurations 17 // Number of supported configurations
// Configuration Descriptor Array Indicies
#define cfg_bLength 0 // Length of this desc
#define cfg_bDescriptorType 1 // Config desc type (const. 0x02)
#define cfg_wTotalLength_lsb 2 // Total length, including
#define cfg_wTotalLength_msb 3 // interface & endpoints
#define cfg_bNumInterfaces 4 // Number of supported int's
#define cfg_bConfigurationValue 5 // Config index
#define cfg_iConfiguration 6 // Index for string desc
#define cfg_bmAttributes 7 // Power, wakeup options
#define cfg_MaxPower 8 // Max bus power consumed
// Interface Descriptor Array Indicies
#define if_bLength 0 // Length of this desc
#define if_bDescriptorType 1 // Interface desc type (const. ?? )
#define if_bInterfaceNumber 2 // This interface index
#define if_bAlternateSetting 3 // Alternate index
#define if_bNumEndpoints 4 // Endpoints used by this interface
#define if_bInterfaceClass 5 // Device class
#define if_bInterfaceSubClass 6 // Device subclass
#define if_bInterfaceProcotol 7 // Class-specific protocol
#define if_iInterface 8 // Index for string desc
// Endpoint Descriptor Array Indicies
#define ep_bLength 0 // Length of this desc
#define ep_bDescriptorType 1 // Endpoint desc type
#define ep_bEndpointAddress 2 // This endpoint address
#define ep_bmAttributes 3 // Transfer type
#define ep_wMaxPacketSize 4 // Max FIFO size
#define ep_bInterval 6 // Polling interval (int only)
#endif /* _USB_DESC_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -