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

📄 usbdesc.asm

📁 CY7C63743 usb键盘的源码
💻 ASM
字号:
;========================================================================
;  This is the LOGITECH dual-interface keyboard   descriptor table file
;========================================================================
;6/16/99 alpha bug repairs
;========================================================================




		XPAGEOFF




ROM_PAGE0:
   device_desc0_table:
	db      12h             ; size of descriptor (18 bytes)
	db      01h             ; descriptor type (device descriptor)
	db      10h, 01h        ; USB spec release (ver 1.1)
	db      00h             ; class code (each interface specifies class information)
	db      00h             ; device sub-class (must be set to 0 because class code is 0)
	db      00h             ; device protocol (no class specific protocol)
	db      08h             ; maximum packet size (8 bytes)
	db      46h, 04h        ; vendor ID (NMB vendor ID)
	db      01h, 00h        ; product ID (NMB USB keyboard product ID)
	db      01h, 00h        ; device release number
	db      01h             ; index of manufacturer string 
	db      02h             ; index of product string 
	db      00h             ; index of serial number string (0=none)
	db      01h             ; number of configurations (1)
 end_device_desc0_table:
device_desc0_len:		EQU (end_device_desc0_table - device_desc0_table)
device_desc0_offset:   EQU (device_desc0_table - ROM_PAGE0) 





   config_desc_table:
	db      09h             ; length of descriptor (9 bytes)
	db      02h             ; descriptor type (CONFIGURATION)
	db      22h, 00h        ; total length of descriptor (33 bytes)
	db      01h             ; number of interfaces to configure (1)
	db      01h             ; configuration value (1)
	db      04h             ; configuration string index
	db      A0h             ; configuration attributes (bus powered, remote wakeup)
	db      32h             ; maximum power (100mA)

   Interface1_Descriptor:  ; descriptor for interface 0 (HID keyboard)
	db      09h             ; length of descriptor (9 bytes)
	db      04h             ; descriptor type (INTERFACE)
	db      00h             ; interface number (0)
	db      00h             ; alternate setting (0)
	db      01h             ; number of endpoints (1)
	db      03h             ; interface class (3..defined by USB spec)
	db      01h             ; interface sub-class (1..defined by USB spec)
	db      01h             ; interface protocol (2..defined by USB spec)
	db      05h             ; interface string index 


   Class1_Descriptor:
	db      09h             ; descriptor size (9 bytes)
      db    21h         ; descriptor type (HID)
	db      00h, 01h        ; class specification (1.00)
	db      00h             ; hardware target country
	db      01h             ; number of hid class desriptors to follow (1)
	db      22h             ; report descriptor type (2)
	db      (end_hid_report_desc1_table - hid_report_desc1_table)
	db    00h

   end_Class1_Descriptor:
Class1_Descriptor_len: EQU (end_Class1_Descriptor - Class1_Descriptor)
Class1_Descriptor_offset: EQU (Class1_Descriptor - ROM_PAGE0)

   Endpoint1_Descriptor:
	db      07h             ; descriptor length (7 bytes)
	db      05h             ; descriptor type (ENDPOINT)
	db      81h             ; endpoint address (IN endpoint, endpoint 1)
	db      03h             ; endpoint attributes (interrupt)
	db      08h, 00h        ; maximum packet size (8 bytes)
	db      0Ah             ; polling interval (10ms)

   Interface2_Descriptor:  ; descriptor for interface 1 (HID mouse)

   Class2_Descriptor:
   end_Class2_Descriptor:
   Class2_Descriptor_len: EQU (end_Class2_Descriptor - Class2_Descriptor)
   Class2_Descriptor_offset: EQU (Class2_Descriptor - ROM_PAGE0)

   Endpoint2_Descriptor:

   end_config_desc_table:
config_descriptor_len: EQU (end_config_desc_table - config_desc_table)
config_descriptor_offset: EQU (config_desc_table - ROM_PAGE0)


   report_desc_table:
   hid_report_desc1_table:
	db      05h, 01h        ; usage page (generic desktop)
	db      09h, 06h        ; usage (keyboard)
	db      A1h, 01h        ; collection (application)
	db      05h, 07h        ; usage page( key codes)
	db      19h, E0h        ; usage minimum (234)
	db      29h, E7h        ; usage maximum (231)
	db      15h, 00h        ; logical minimum (0)
	db      25h, 01h        ; logical maximum (1)
	db      75h, 01h        ; report size (1 bit)
	db      95h, 08h        ; report count (8 bytes)
	db      81h, 02h        ; input (data, variable, absolute)
	db      95h, 01h        ; report count (1 byte)
	db      75h, 08h        ; report size (8 bits)
	db      81h, 01h        ; input (constant)
	db      95h, 05h        ; report count (5)
	db      75h, 01h        ; report size (1)
	db      05h, 08h        ; usage page (LEDs)
	db      19h, 01h        ; usage minimum (1)
	db      29h, 05h        ; usage maximum (5)
	db      91h, 02h        ; output (data, variable, absolute)
	db      95h, 01h        ; report count (1)
	db      75h, 03h        ; report size (3)
	db      91h, 01h        ; output (constant)
	db      95h, 06h        ; report count (6)
	db      75h, 08h        ; report size (8)
	db      15h, 00h        ; logical minimum (0)
	db      25h, 68h        ; logical maximum (104)
	db      05h, 07h        ; usage page (key codes)
	db      19h, 00h        ; usage minimum (0)
	db      29h, 68h        ; usage maximum (104)
	db      81h, 00h        ; input (data, array)
	db      C0h             ; end collection
   end_hid_report_desc1_table:
hid_report_desc1_table_len: EQU (end_hid_report_desc1_table - hid_report_desc1_table)
hid_report_desc1_table_offset: EQU (hid_report_desc1_table - ROM_PAGE0)
   hid_report_desc2_table:
 end_hid_report_desc2_table:

hid_report_desc2_table_len: EQU (end_hid_report_desc2_table - hid_report_desc2_table)
hid_report_desc2_table_offset: EQU (hid_report_desc2_table - ROM_PAGE0)

;
;*********************************************************
;         rom lookup tables for string descriptor
;*********************************************************


;string 0
USBStringDescription0:
    db 04h          ; Length
    db 03h          ; Type (3=string)
    db 09h          ; Language:  English
    db 04h          ; Sub-language: Default
end_USBStringDescription0:
USBStringDescription0_len: EQU (end_USBStringDescription0 - USBStringDescription0)
USBStringDescription0_offset: EQU (USBStringDescription0 - ROM_PAGE0)

; string 1
USBStringDescription1:	; IManufacturerName
    db 08h          ; Length
    db 03h          ; Type (3=string)
    dsu "NMB" ;

end_USBStringDescription1:	; IManufacturerName
USBStringDescription1_len: EQU (end_USBStringDescription1 -	USBStringDescription1)
USBStringDescription1_offset: EQU (USBStringDescription1 - ROM_PAGE0)

; string 2
USBStringDescription2:	; IProduct
    db 22h          ; Length
    db 03h          ; Type (3=string)
    dsu "NMB USB Keyboard"  ;

end_USBStringDescription2:	; IProduct
USBStringDescription2_len: EQU (end_USBStringDescription2 -	USBStringDescription2)
USBStringDescription2_offset: EQU (USBStringDescription2 - ROM_PAGE0)

;string 3
;USBStringDescription3:	; serial number
                        ; If a SN is used, this must be unique
                        ; for every device or the device may
                        ; not enumerate properly
;end_USBStringDescription3:	; serial number
;USBStringDescription3_len: EQU (end_USBStringDescription3 -	USBStringDescription3)
;USBStringDescription3_offset: EQU (USBStringDescription3 - ROM_PAGE0)
; string 4                 
;USBStringDescription4:	; configuration string descriptor
    db 1Ah          ; Length
    db 03h          ; Type (3=string)
    dsu "HID Keyboard"  ;

;end_USBStringDescription4:	; configuration string descriptor
;USBStringDescription4_len: EQU (end_USBStringDescription4 -	USBStringDescription4)
;USBStringDescription4_offset: EQU (USBStringDescription4 - ROM_PAGE0)

;string 5
;USBStringDescription5:	; interface 0 string descriptor
    db 28h          ; Length
    db 03h          ; Type (3=string)
    dsu "EndPoint1 Interrupt"  ;
;end_USBStringDescription5:	; interface 0 string descriptor
;USBStringDescription5_len: EQU (end_USBStringDescription5 -	USBStringDescription5)
;USBStringDescription5_offset: EQU (USBStringDescription5 - ROM_PAGE0)

;string 6
;USBStringDescription6:	; interface 1 string descriptor
    db 1Ch          ; Length
    db 03h          ; Type (3=string)
    dsu "EP2 Interrupt"  ;

;end_USBStringDescription6:	; interface 1 string descriptor
;USBStringDescription6_len: EQU (end_USBStringDescription6 -	USBStringDescription6)
;USBStringDescription6_offset: EQU (USBStringDescription6 - ROM_PAGE0)




lookup_table:
dw device_desc0_offset
db device_desc0_len,0

dw config_descriptor_offset
db config_descriptor_len,0

dw USBStringDescription0_offset
db USBStringDescription0_len,0

dw USBStringDescription1_offset
db USBStringDescription1_len,0

dw USBStringDescription2_offset
db USBStringDescription2_len,0

dw Class1_Descriptor_offset
db Class1_Descriptor_len,0

dw Class2_Descriptor_offset
db Class2_Descriptor_len,0

dw hid_report_desc1_table_offset
db hid_report_desc1_table_len,0

dw hid_report_desc2_table_offset
db hid_report_desc2_table_len,0



key_error_buffer:
db 01,01,01,01,01,01,01,01
key_error_offset:
dw (key_error_buffer - ROM_PAGE0)


    XPAGEON

⌨️ 快捷键说明

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