⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dscr.a51

📁 cy68013a USB2.0 highspeed mass storage source code
💻 A51
字号:
;;-----------------------------------------------------------------------------
;;   File:      dscr.a51
;;   Contents:   This file contains descriptor data tables.  
;;
;;   Copyright (c) 1997-2004 Cypress SemiconductorAnchorChips, Inc. All rights reserved
;;
;; $Archive: /USB/atapifx2/CY4611B/dscr.a51 $
;; $Date: 6/28/05 5:54p $
;; $Revision: 10 $
;;-----------------------------------------------------------------------------
   
DSCR_DEVICE   equ   1   ;; Descriptor type: Device
DSCR_CONFIG   equ   2   ;; Descriptor type: Configuration
DSCR_STRING   equ   3   ;; Descriptor type: String
DSCR_INTRFC   equ   4   ;; Descriptor type: Interface
DSCR_ENDPNT   equ   5   ;; Descriptor type: Endpoint
DSCR_DEVQUAL  equ   6   ;; Descriptor type: Device Qualifier

DSCR_DEVICE_LEN   equ   18
DSCR_CONFIG_LEN   equ    9
DSCR_INTRFC_LEN   equ    9
DSCR_ENDPNT_LEN   equ    7
DSCR_DEVQUAL_LEN  equ   10

ET_CONTROL   equ   0   ;; Endpoint type: Control
ET_ISO       equ   1   ;; Endpoint type: Isochronous
ET_BULK      equ   2   ;; Endpoint type: Bulk
ET_INT       equ   3   ;; Endpoint type: Interrupt

MASS_STORAGE_CLASS     EQU   8
MASS_STORAGE_SCSICMD   EQU   6
MASS_STOAGE_BOT       EQU   50h

HID_SUPPORT       equ 0
CSM_SUPPORT       equ 0

public      DeviceDscr, DeviceQualDscr, FullSpeedConfigDscr, StringDscr
public      IntrfcSubClassFullSpeed, DscrEnd
public      DeviceDscrOffset, DeviceQualDscrOffset, FullSpeedConfigDscrOffset
public      IntrfcSubClassFullSpeedOffset, DscrEndOffset
public	   StringDscr0;  , StringDscr1, StringDscr3
public	    IntrfcClassFullSpeedOffset
public	    PIDOffset, VIDOffset;
public      CSMGeneralDscrOffset
public      CSMChannelDscrOffset
public      CSMCSMDscrOffset   
public      CSMCSMVDscrOffset
public      HIDDscrOffset
public      HIDReportDscrOffset 
public      HIDReportDscrLen
public      SerialNumberIndexOffset
public      interruptEPDscrOffset
public      bulkEPDscrEndOffset
;;-----------------------------------------------------------------------------
;; Global Variables
;;-----------------------------------------------------------------------------
      CSEG at 100h    ;; locate the descriptor table in on-part memory.

DeviceDscr:   
      db   DSCR_DEVICE_LEN      ;; Descriptor length
      db   DSCR_DEVICE   ;; Decriptor type
      dw   0002H      ;; Specification Version (BCD)
      db   00H        ;; Device class
      db   00H         ;; Device sub-class
      db   00H         ;; Device sub-sub-class
      db   64         ;; Maximum packet size
DscrVID:
      dw   0B404H      ;; Vendor ID (4b4)
DscrPID:
      dw   3068H      ;; Product ID - set to chip id = CY68300
;     dw   0210h	;; Sample device
      dw   0800H      ;; Product version ID [RevH RevL Major Minor]
      db   0	      ;; Manufacturer string index
      db   (StringDscr3 - DeviceDscr + 16) / 2       ;; Product string index
SerialNumberStringIndex:
      db   (StringDscr2 - DeviceDscr + 16) / 2       ;; Serial number string index
      db   1         ;; Number of configurations

DeviceQualDscr:
      db   DSCR_DEVQUAL_LEN   ;; Descriptor length
      db   DSCR_DEVQUAL   ;; Decriptor type
      dw   0002H      ;; Specification Version (BCD)
      db   00H        ;; Device class
      db   00H         ;; Device sub-class
      db   00H         ;; Device sub-sub-class
      db   64         ;; Maximum packet size
      db   1         ;; Number of configurations
      db   0         ;; Reserved

FullSpeedConfigDscr:   
      db   DSCR_CONFIG_LEN               ;; Descriptor length
      db   DSCR_CONFIG                  ;; Descriptor type
      db   (FullSpeedConfigDscrEnd-FullSpeedConfigDscr) mod 256 ;; Total Length (LSB)
      db   (FullSpeedConfigDscrEnd-FullSpeedConfigDscr)  /  256 ;; Total Length (MSB)
      ; CSM1
      db   1+HID_SUPPORT+CSM_SUPPORT      ;; Number of interfaces
      db   1      ;; Configuration number
      db   0      ;; Configuration string
      db   11000000b   ;; Attributes (b7 - buspwr, b6 - selfpwr, b5 - rwu)
      db   0      ;; Power requirement (div 2 ma)

;; Interface Descriptor
      db   DSCR_INTRFC_LEN      ;; Descriptor length
      db   DSCR_INTRFC         ;; Descriptor type
      db   0               ;; Zero-based index of this interface
      db   0               ;; Alternate setting
      db   3-HID_SUPPORT   ;; Number of end points 
IntrfcClassFullSpeed:
      db   08H             ;; Interface class - vendor specific for mfgMode, 08h for mass storage
;	db 0ffh
IntrfcSubClassFullSpeed:
      db   06H               ;; Interface sub class
      db   50H               ;; Interface sub sub class
      db   0               ;; Interface descriptor string index
      
;; Endpoint Descriptor
      db   DSCR_ENDPNT_LEN      ;; Descriptor length
      db   DSCR_ENDPNT         ;; Descriptor type
      db   02H               ;; Endpoint number, and direction
      db   ET_BULK            ;; Endpoint type
      db   3fH               ;; Maximun packet size (LSB)
      db   00H               ;; Max packect size (MSB)
      db   00H               ;; Polling interval

;; Endpoint Descriptor
      db   DSCR_ENDPNT_LEN      ;; Descriptor length
      db   DSCR_ENDPNT         ;; Descriptor type
      db   86H               ;; Endpoint number, and direction
      db   ET_BULK            ;; Endpoint type
      db   3fH               ;; Maximun packet size (LSB)
      db   00H               ;; Max packect size (MSB)
      db   00H               ;; Polling interval
BulkEPDscrEnd:

if CSM_SUPPORT
CSMIntrfcDscr:
;; Interface Descriptor
      db   DSCR_INTRFC_LEN      ;; Descriptor length
      db   DSCR_INTRFC         ;; Descriptor type
      db   1               ;; Zero-based index of this interface
      db   0               ;; Alternate setting
      db   0               ;; Number of end points 
      db   0dH             ;; Interface class
      db   0H               ;; Interface sub class
      db   0H               ;; Interface sub sub class
      db   0               ;; Interface descriptor string index
CSMGeneralDscr:
      db   4		   ;; Length
      db   21h		   ;; Type
      dw   0001h	   ;; version
;; Channel Descriptor for CSM
CSMChannelDscr:
      db   CSMChannelDscrEnd - CSMChannelDscr
      db   22h
      db   0		    ;; Number of the channel
      db   1		    ;; Recipient type = Interface
      db   0		    ;; Interface number that we're providing Content Security for
      db   0                ;; Alt setting that we're providing Content Security for
      db   0                ;; LUN that we're providing Content Security for
      db   1	            ;; CSM descriptor index:  Index of a class-specific CSM descriptor that describes one of the Content Security Methods offered by the device, must be a one-based value that is unique across the device. The value of 0 (zero) is reserved and must not be used in this field. See Table A-5.
      db   0		    ;; Zero-based value that points to a CSM Variant descriptor. If there is no CSM Variant descriptor than it has the value of zero.
CSMChannelDscrEnd:

CSMCSMDscr:
      db    CSMCSMDscrEnd-CSMCSMDscr
      db    23h
      db    1                 ;; CSM Method ID
      db    0                 ;; CSM string index
      dw    0001h             ;; BCD version number
CSMCSMDscrEnd:

CSMCSMVDscr:
;      db    CSMCSMVDscrEnd-CSMCSMVDscr
;      db    24h
CSMCSMVDscrEnd:
endif

if HID_SUPPORT
HIDIntrfcDscr:
;; HID Interface Descriptor
      db   DSCR_CONFIG_LEN               ;; Descriptor length
      db   DSCR_INTRFC   ;; Descriptor type
      db   2      ;; Zero-based index of this interface
      db   0      ;; Alternate setting
      db   1      ;; Number of end points 
      db   003H      ;; Interface class (HID)
      db   00H      ;; Interface sub class
      db   00H      ;; Interface sub sub class
      db   0      ;; Interface descriptor string index

HIDDscr:
      db   09h      ; length
      db   21h      ; type: HID
      db   010h,01h      ; release: HID class rev 1.1
      db   00h      ; country code (none)
      db   01h      ; number of HID class descriptors to follow
      db   22h      ; report descriptor type (HID)
      db   (HIDReportDscrEnd - HIDReportDscr) ; length of HID descriptor
      db   00h
HIDDscrEnd:
endif      
interruptEPDscr:
      db   DSCR_ENDPNT_LEN   ;; Descriptor length
      db   DSCR_ENDPNT   ;; Descriptor type
      db   81H      ;; Endpoint number, and direction
      db   ET_INT      ;; Endpoint type
      db   04H      ;; Maximun packet size (LSB)
      db   00H      ;; Max packect size (MSB)
      db   0AH      ;; Polling interval

FullSpeedConfigDscrEnd:   

      db   00       ;; NULL needed here to tell the dscr parser to stop.
if HID_SUPPORT
HIDReportDscr:
     db 06h, 0A0h, 0FFh      ;         Usage Page (vendor defined) FFA0
     db 09h, 0A5h     ;               Usage (vendor defined)
     db 0A1h, 01h     ;               Collection (Application)
     db 09h, 0A6h     ;               Usage (vendor defined)

;The input report
     db 09h, 0A7h     ;               usage - vendor defined
     db 15h, 80h     ;               Logical Minimum (-128)
     db 25h, 7Fh     ;               Logical Maximum (127)
     db 75h, 08h     ;               Report Size (8)  (bits)
     db 95h, 02h     ;               Report Count (2)  (fields)
     db 81h, 02h     ;               Input (Data, Variable, Absolute)  

;The output report
     db 09h, 0A9h     ;               usage - vendor defined
     db 15h, 80h     ;               Logical Minimum (-128)
     db 25h, 7Fh     ;               Logical Maximum (127)
     db 75h, 08h     ;               Report Size (8)  (bits)
     db 95h, 02h     ;               Report Count (2)  (fields)
     db 91h, 02h     ;               Output (Data, Variable, Absolute)  

     db 0C0h          ;               End Collection
HIDReportDscrEnd:
endif

StringDscr:
StringDscr0:
		db	StringDscr0End-StringDscr0		;; String descriptor length
		db	DSCR_STRING
		db	09H,04H
StringDscr0End:

//StringDscr1:	
//		db	StringDscr1End-StringDscr1		;; String descriptor length
//		db	DSCR_STRING
//		db	'C',00
//		db	'y',00
//		db	'p',00
//		db	'r',00
//		db	'e',00
//		db	's',00
//		db	's',00
//StringDscr1End:

StringDscr2:	
		db	StringDscr2End-StringDscr2		;; String descriptor length
		db	DSCR_STRING
		db	'0',00
		db	'0',00
		db	'0',00
		db	'0',00
		db	'0',00
		db	'0',00
		db	'0',00
		db	'0',00
		db	'0',00
		db	'0',00
		db	'0',00
		db	'0',00
StringDscr2End:

StringDscr3:	
		db	StringDscr3End-StringDscr3		;; String descriptor length
		db	DSCR_STRING
		db	'C',00
		db	'y',00
		db	'p',00
		db	'r',00
		db	'e',00
		db	's',00
		db	's',00
		db	' ',00
		db	'C',00
		db	'Y',00
		db	'4',00
		db	'6',00
		db	'1',00
		db	'1',00
		db	'B',00
		db	' ',00
		db	'R',00
		db	'C',00
            db	'1',00
            db	'3',00
StringDscr3End:

DscrEnd:

IF          StringDscr & 1
__ERROR__   "ERROR!! Strings are odd-aligned!!"
ENDIF


DeviceDscrOffset EQU DeviceDscr - DeviceDscr
DeviceQualDscrOffset EQU DeviceQualDscr - DeviceDscr
FullSpeedConfigDscrOffset EQU FullSpeedConfigDscr - DeviceDscr
StringDscrOffset EQU StringDscr - DeviceDscr
SerialNumberIndexOffset EQU SerialNumberStringIndex - DeviceDscr
IntrfcSubClassFullSpeedOffset EQU IntrfcSubClassFullSpeed - DeviceDscr
DscrEndOffset EQU DscrEnd - DeviceDscr
IntrfcClassFullSpeedOffset EQU IntrfcClassFullSpeed - DeviceDscr
PIDOffset EQU DscrPID - DeviceDscr
VIDOffset EQU DscrVID - DeviceDscr
interruptEPDscrOffset EQU interruptEPDscr - DeviceDscr
bulkEPDscrEndOffset EQU BulkEPDscrEnd - DeviceDscr
if CSM_SUPPORT
      CSMGeneralDscrOffset EQU CSMGeneralDscr - CSMIntrfcDscr
      CSMChannelDscrOffset EQU CSMChannelDscr - CSMIntrfcDscr
      CSMCSMDscrOffset    EQU CSMCSMDscr - CSMIntrfcDscr
      CSMCSMVDscrOffset   EQU CSMCSMVDscr - CSMIntrfcDscr
else
      CSMGeneralDscrOffset EQU 0
      CSMChannelDscrOffset EQU 0
      CSMCSMDscrOffset    EQU 0
      CSMCSMVDscrOffset   EQU 0
endif

if HID_SUPPORT
      HIDDscrOffset       EQU HIDDscr - HIDIntrfcDscr
      HIDReportDscrOffset EQU HIDReportDscr - HIDIntrfcDscr
      HIDReportDscrLen EQU HIDReportDscrEnd - HIDReportDscr
else
      HIDDscrOffset       EQU 0
      HIDReportDscrOffset EQU 0
      HIDReportDscrLen EQU 0
endif

      end
		

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -