📄 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"
MODULE usb_descriptor
RSEG RCODE
PUBLIC pUsbDescStart;
PUBLIC pUsbDescEnd;
PUBLIC pUsbDescLut;
PUBLIC pUsbDescLutEnd;
PUBLIC pUsbDblbufLut;
;;-------------------------------------------------------------------------------------------------------
;; USB descriptors. Make sure that USB_SETUP_MAX_NUMBER_OF_INTERFACES defines the maximum number of
;; interface for a configuration descriptor.
pUsbDescStart:
deviceDesc: ; Device descriptor
DB deviceDescEnd - deviceDesc
DB DESC_TYPE_DEVICE ; bDescriptorType
DB 10H, 01H ; bcdUSB
DB 00H ; bDeviceClass
DB 00H ; bDeviceSubClass
DB 00H ; bDeviceProtocol
DB EP0_PACKET_SIZE
DB 0A0H, 11H ; idVendor
DB 20H, 20H ; 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 01H ; 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 02H ; bNumEndpoints
DB 0FFH ; bInterfaceClass
DB 0FFH ; bInterfaceSubClass
DB 0FFH ; bInterfaceProcotol
DB 00H ; iInterface
interface0DescEnd:
endpoint0Desc: ; Winamp display endpoint descriptor (EP1 OUT)
DB endpoint0DescEnd - endpoint0Desc
DB DESC_TYPE_ENDPOINT ; bDescriptorType
DB 04H ; bEndpointAddress
DB EP_ATTR_BULK ; bmAttributes
DB 40H, 00H ; wMaxPacketSize
DB 0AH ; bInterval
endpoint0DescEnd:
endpoint1Desc: ; Winamp control endpoint descriptor (EP1 IN)
DB endpoint1DescEnd - endpoint1Desc
DB DESC_TYPE_ENDPOINT ; bDescriptorType
DB 84H ; bEndpointAddress
DB EP_ATTR_BULK ; bmAttributes
DB 40H, 00H ; wMaxPacketSize
DB 0AH ; bInterval
endpoint1DescEnd:
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 'W', 0
DB 'i', 0
DB 'n', 0
DB 'a', 0
DB 'm', 0
DB 'p', 0
DB ' ', 0
DB 'R', 0
DB 'e', 0
DB 'm', 0
DB 'o', 0
DB 't', 0
DB 'e', 0
DB ' ', 0
DB 'C', 0
DB 'o', 0
DB 'n', 0
DB 't', 0
DB 'r', 0
DB 'o', 0
DB 'l', 0
string2DescEnd:
string3Desc: ; Product
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). Make sure that USB_SETUP_DESC_LUT_SIZE defines the number of
;; items in this table
pUsbDescLut:
pUsbDescLutEnd:
;;-------------------------------------------------------------------------------------------------------
;;-------------------------------------------------------------------------------------------------------
;; Look-up table for double buffer settings (one set of bit masks for each defined interface)
pUsbDblbufLut: DW interface0Desc ; pInterface
DB 04H ; inMask
DB 04H ; outMask
;;-------------------------------------------------------------------------------------------------------
END;
/*******************************************************************************************************
* Revision history:
*
* $Log: usb_descriptor.a51,v $
*
*******************************************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -