📄 usb_descriptor.s51
字号:
/*******************************************************************************************************
* *
* ********** *
* ************ *
* *** *** *
* *** +++ *** *
* *** + + *** *
* *** + CHIPCON SMARTRF04EB BOOTLOADER *
* *** + + *** USB Descriptors *
* *** +++ *** *
* *** *** *
* ************ *
* ********** *
* *
*******************************************************************************************************
* Copyright Chipcon AS, 2005 *
*******************************************************************************************************
* The default USB descriptor defines a minimum configuration, with no endpoints apart from EP0. The *
* application can define 3 IN and OUT endpoints, and override the configuration and interface *
* descriptor (only one of each). The device and string descriptors are locked. *
*******************************************************************************************************
* Compiler: Keil C51 *
* Target platform: SmartRF04EB (Silabs C8051F320) *
*******************************************************************************************************
* Revision history is located at the bottom of the file *
*******************************************************************************************************/
#define ASM_FILE
#include "usb_descriptor.h"
#include "usb_cdc.h"
MODULE usb_descriptor
RSEG RCODE
PUBLIC pUsbDescStart;
PUBLIC pUsbDescEnd;
PUBLIC pUsbDescLut;
PUBLIC pUsbDescLutEnd;
PUBLIC pUsbDblbufLut;
;;-------------------------------------------------------------------------------------------------------
;; USB descriptors
pUsbDescStart:
deviceDesc: ; Device descriptor
DB deviceDescEnd - deviceDesc
DB DESC_TYPE_DEVICE ; bDescriptorType
DB 10H, 01H ; bcdUSB
DB CDC_DEVICE ; bDeviceClass
DB 00H ; bDeviceSubClass
DB 00H ; bDeviceProtocol
DB EP0_PACKET_SIZE
DB 0A0H, 11H ; idVendor
DB 32H, 02H ; idProduct
DB 88H, 88H ; bcdDevice
DB 01H ; iManufacturer
DB 02H ; iProduct
DB 03H ; iSerialNumber
DB 01H ; bNumConfigurations
deviceDescEnd:
config1LengthStart:
configDesc: ; Configuration descriptor
DB configDescEnd - configDesc
DB DESC_TYPE_CONFIG ; bDescriptorType
DB config1LengthEnd - config1LengthStart, 00H
DB 02H ; NumInterfaces
DB 01H ; bConfigurationValue
DB 00H ; iConfiguration
DB 80H ; bmAttributes
DB 25 ; MaxPower
configDescEnd:
interface0Desc: ; Interface descriptor
DB interface0DescEnd - interface0Desc
DB DESC_TYPE_INTERFACE ; bDescriptorType
DB 00H ; bInterfaceNumber
DB 00H ; bAlternateSetting
DB 01H ; bNumEndpoints
DB COMM_INTF ; bInterfaceClass
DB ABSTRACT_CONTROL_MODEL ; bInterfaceSubClass
DB V25TER ; bInterfaceProcotol
DB 00H ; iInterface
interface0DescEnd:
;; CDC Class-Specific Descriptors
headerFunctionalDesc: ; Header Functional Descriptor
DB headerFunctionalDescEnd - headerFunctionalDesc
DB CS_INTERFACE
DB DSC_FN_HEADER
DB 01H, 10H
headerFunctionalDescEnd:
absCtrlManFuncDesc: ; Abstract Control Management Functional Descriptor
DB absCtrlManFuncDescEnd - absCtrlManFuncDesc
DB CS_INTERFACE
DB DSC_FN_ACM
DB 02H ;set the supported class requests
absCtrlManFuncDescEnd:
unionFunctionalDesc: ; Union Functional Descriptor
DB unionFunctionalDescEnd - unionFunctionalDesc
DB CS_INTERFACE
DB DSC_FN_UNION
DB CDC_COMM_INTF_ID
DB CDC_DATA_INTF_ID
unionFunctionalDescEnd:
callMngFuncDesc: ; Call Management Functional Descriptor
DB callMngFuncDescEnd - callMngFuncDesc
DB CS_INTERFACE
DB DSC_FN_CALL_MGT
DB 00H
DB CDC_DATA_INTF_ID
callMngFuncDescEnd:
endpoint0Desc: ; Endpoint descriptor (EP2 IN)
DB endpoint0DescEnd - endpoint0Desc
DB DESC_TYPE_ENDPOINT ; bDescriptorType
DB 82H ; bEndpointAddress
DB EP_ATTR_INT ; bmAttributes
DB 40H, 00H ; wMaxPacketSize
DB 40H ; bInterval
endpoint0DescEnd:
interface1Desc: ; Interface descriptor
DB interface1DescEnd - interface1Desc
DB DESC_TYPE_INTERFACE ; Interface descriptor type
DB 01H ; Interface Number
DB 00H ; Alternate Setting Number
DB 02H ; Number of endpoints in this intf
DB DATA_INTF ; Class code
DB 00H ; Subclass code
DB NO_PROTOCOL ; Protocol code
DB 00H ; Interface string index
interface1DescEnd:
endpoint1Desc: ; Endpoint descriptor (EP4 OUT)
DB endpoint1DescEnd - endpoint1Desc
DB DESC_TYPE_ENDPOINT ; bDescriptorType
DB 84H ; bEndpointAddress
DB EP_ATTR_BULK ; bmAttributes
DB 40H, 00H ; wMaxPacketSize
DB 01H ; bInterval
endpoint1DescEnd:
endpoint2Desc: ; Endpoint descriptor (EP4 IN)
DB endpoint2DescEnd - endpoint2Desc
DB DESC_TYPE_ENDPOINT ; bDescriptorType
DB 04H ; bEndpointAddress
DB EP_ATTR_BULK ; bmAttributes
DB 40H, 00H ; wMaxPacketSize
DB 01H ; bInterval
endpoint2DescEnd:
config1LengthEnd:
;;-------------------------------------------------------------------------------------------------------
;;-------------------------------------------------------------------------------------------------------
;; String descriptors
string0Desc: ; Language ID
DB string0DescEnd - string0Desc
DB DESC_TYPE_STRING ; bDescriptorType
DB 09H
DB 04H
string0DescEnd:
string1Desc: ; Manufacturer
DB string1DescEnd - string1Desc
DB DESC_TYPE_STRING ; bDescriptorType
DB 'C', 0
DB 'h', 0
DB 'i', 0
DB 'p', 0
DB 'c', 0
DB 'o', 0
DB 'n', 0
string1DescEnd:
string2Desc: ; Product
DB string2DescEnd - string2Desc
DB DESC_TYPE_STRING ; bDescriptorType
DB 'U', 0
DB 'S', 0
DB 'B', 0
DB ' ', 0
DB 'R', 0
DB 'F', 0
DB '-', 0
DB '2', 0
DB '3', 0
DB '2', 0
string2DescEnd:
string3Desc: ; Serial number
DB string3DescEnd - string3Desc
DB DESC_TYPE_STRING ; bDescriptorType
DB '0', 0
DB '1', 0
DB '2', 0
DB '3', 0
DB '4', 0
DB '5', 0
DB '6', 0
DB '7', 0
DB '8', 0
DB '9', 0
string3DescEnd:
pUsbDescEnd:
;;-------------------------------------------------------------------------------------------------------
;;-------------------------------------------------------------------------------------------------------
;; Look-up table for descriptors that are not returned through requests for DSC_DEVICE, DSC_CONFIG or
;; DSC_STRING (e.g. HID report descriptors)
pUsbDescLut:
pUsbDescLutEnd:
;;-------------------------------------------------------------------------------------------------------
;;-------------------------------------------------------------------------------------------------------
;; Look-up table for double buffer settings (one set of bit masks for each defined interface)
pUsbDblbufLut: DW interface0Desc ; pInterface
DB 00H ; inMask
DB 00H ; outMask
DW interface1Desc ; pInterface
DB 00H ; inMask
DB 00H ; outMask
;;-------------------------------------------------------------------------------------------------------
END;
/*******************************************************************************************************
* Revision history:
*
* $Log: usb_descriptor.a51,v $
*
*******************************************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -