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

📄 dscr.lst

📁 linux下数据下载器的设计与实现
💻 LST
📖 第 1 页 / 共 3 页
字号:
                    +1  148     
                    +1  149     $endif  
                    +1  150     
                    +1  151     
                        152     
                        153        
 0001                   154     DSCR_DEVICE       equ   1   ; Descriptor type: Device
 0002                   155     DSCR_CONFIG       equ   2   ; Descriptor type: Configuration
 0003                   156     DSCR_STRING       equ   3   ; Descriptor type: String
 0004                   157     DSCR_INTRFC       equ   4   ; Descriptor type: Interface
 0005                   158     DSCR_ENDPNT       equ   5   ; Descriptor type: Endpoint
 0006                   159     DSCR_DEVQUAL      equ   6   ; Descriptor type: Device Qualifier
                        160     
 0012                   161     DSCR_DEVICE_LEN   equ   18
 0009                   162     DSCR_CONFIG_LEN   equ   9
 0009                   163     DSCR_INTRFC_LEN   equ   9
 0007                   164     DSCR_ENDPNT_LEN   equ   7
 000A                   165     DSCR_DEVQUAL_LEN  equ   10
                        166     
 0000                   167     ET_CONTROL        equ   0   ; Endpoint type: Control
 0001                   168     ET_ISO            equ   1   ; Endpoint type: Isochronous
 0002                   169     ET_BULK           equ   2   ; Endpoint type: Bulk
 0003                   170     ET_INT            equ   3   ; Endpoint type: Interrupt
                        171     
                        172     public      DeviceDscr, DeviceQualDscr, HighSpeedConfigDscr 
                        173     public      DscrEnd, VendorOffset, Str3Offset, HighSpeedConfigLen
                        174     public      DeviceDscrOffset, DeviceQualDscrOffset, HighSpeedConfigDscrOffset 
                        175     public      DscrEndOffset, DscrVIDOffset
                        176     
                        177     
                        178     $if     (HID)
                                public      HIDDscrOffset, HIDReportDscrOffset, HIDReportDscrLen, HIDIntrfcDscr, HIDIntr
                               fcDscrOffset
                                public          HIDDscr
                                $endif 
                        182     
                        183     ;-----------------------------------------------------------------------------
                        184     ; Global Variables
                        185     ;-----------------------------------------------------------------------------
000100                  186           CSEG at DESC_VEC       ; locate the descriptor table in on-part memory.
                        187     
000100                  188     DeviceDscr:   
000100 12               189           db   DSCR_DEVICE_LEN   ; Descriptor length
AX51 MACRO ASSEMBLER  DSCR                                                                  10/12/07 16:09:52 PAGE     4

000101 01               190           db   DSCR_DEVICE       ; Decriptor type
000102 0002             191           dw   0002H             ; Specification Version (BCD)
000104 00               192           db   00H               ; Device class
000105 00               193           db   00H               ; Device sub-class
000106 00               194           db   00H               ; Device sub-sub-class
000107 40               195           db   64                ; Maximum packet size
                        196     
000108                  197     DscrVID:
000108 B604             198           dw   0B604H            ; Vendor ID (4b4)
00010A 1746             199           dw   1746H             ; Product ID - set to new id = NX2LP
00010C 0200             200           dw   0200H             ; Product version ID [RevH RevL Major Minor]
00010E                  201     Str3:
00010E 01               202           db   1                 ; Manufacturer string index
00010F 02               203           db   2                 ; Product string index
000110 03               204           db   3                 ; Serial number string index
000111 01               205           db   1                 ; Number of configurations
                        206     
000112                  207     HighSpeedConfigDscr:   
000112 09               208           db   DSCR_CONFIG_LEN   ; Descriptor length
000113 02               209           db   DSCR_CONFIG       ; Descriptor type
000114 20               210           db   (HighSpeedConfigDscrEnd-HighSpeedConfigDscr) mod 256 ; Total Length (LSB)
000115 00               211           db   (HighSpeedConfigDscrEnd-HighSpeedConfigDscr)  /  256 ; Total Length (MSB)
                        212     $if  (HID)
                                      db   2                 ; Number of interfaces
                                $else 
000116 01               215           db   1                 ; Number of interfaces
                        216     $endif 
000117 01               217           db   1                 ; Configuration number
000118 00               218           db   0                 ; Configuration string
000119 80               219           db   10000000b         ; Attributes (b7 - buspwr, b6 - selfpwr, b5 - rwu)
00011A 32               220           db   50                ; Power requirement (div 2 ma)
                        221     
                        222     ; Interface Descriptor
00011B 09               223           db   DSCR_INTRFC_LEN   ; Descriptor length
00011C 04               224           db   DSCR_INTRFC       ; Descriptor type
00011D 00               225           db   0                 ; Zero-based index of this interface
00011E 00               226           db   0                 ; Alternate setting
00011F 02               227           db   2                 ; Number of end points 
000120                  228     Vendor:
000120 08               229           db   08H               ; Interface class - vendor specific for mfgMode
000121 06               230           db   06H               ; Interface sub class
000122 50               231           db   50H               ; Interface sub sub class
000123 00               232           db   0                 ; Interface descriptor string index
                        233           
                        234     ; Endpoint Descriptor
000124 07               235           db   DSCR_ENDPNT_LEN   ; Descriptor length
000125 05               236           db   DSCR_ENDPNT       ; Descriptor type
000126 02               237           db   02H               ; Endpoint number, and direction
000127 02               238           db   ET_BULK           ; Endpoint type
000128 00               239           db   00H               ; Maximun packet size (LSB)
000129 02               240           db   02H               ; Max packect size (MSB)
00012A 00               241           db   00H               ; Polling interval
                        242     
                        243     ;; Endpoint Descriptor
00012B 07               244           db   DSCR_ENDPNT_LEN   ; Descriptor length
00012C 05               245           db   DSCR_ENDPNT       ; Descriptor type
00012D 84               246           db   84H               ; Endpoint number, and direction
00012E 02               247           db   ET_BULK           ; Endpoint type
00012F 00               248           db   00H               ; Maximun packet size (LSB)
000130 02               249           db   02H               ; Max packect size (MSB)
000131 00               250           db   00H               ; Polling interval
                        251     
                        252     $if  (HID)
                                HIDIntrfcDscr:               ; HID Interface Descriptor
                                      db   DSCR_CONFIG_LEN       ; Descriptor length
                                      db   DSCR_INTRFC           ; Descriptor type
AX51 MACRO ASSEMBLER  DSCR                                                                  10/12/07 16:09:52 PAGE     5

                                      db   1                             ; Zero-based index of this interface
                                      db   0                             ; Alternate setting
                                      db   1                             ; Number of end points 
                                      db   03H                   ; 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)mod 256 ; length of HID descriptor
                                      db   (HIDReportDscrEnd - HIDReportDscr)/256 ; length of HID descriptor
                                HIDDscrEnd:
                                
                                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
                                $endif       
000132                  283     HighSpeedConfigDscrEnd:   
                        284     
                        285     $if     (HID)
                                    db 0            ; need a byte aligment here
                                HIDReportDscr:
                                        db 05h, 01h     ; Usage Page (Generic Desktop),
                                        db 09h, 02h     ; Usage (Mouse),
                                        db 0A1h, 01h    ; Collection (Application),
                                        db 09h, 01h     ; Usage (Pointer), 
                                        db 0A1h, 00h    ; Collection (Physical),
                                        db 95h, 03h     ; Report Count (3),
                                        db 75h, 01h     ; Report Size (1),
                                        db 05h, 09h         ; Usage Page (Buttons),
                                        db 19h, 01h         ; Usage minimum (1)
                                        db 29h, 03h         ; Usage maximum (3)
                                        db 15h, 00h     ; Logical minimum (0),
                                        db 25h, 01h     ; Logical maximum (1),  
                                        db 81h, 02h     ; Input (Data, Variable, Absolute), (3 button bits)
                                        db 95h, 01h     ; Report Count (1),
                                        db 75h, 05h     ; Report Size (5),

⌨️ 快捷键说明

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