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

📄 des.asm

📁 HT82J97滑鼠DEMO程序
💻 ASM
字号:
#include "usbrf1.inc"
;Descript		.Section   at   0f50h		'code'	
Descript		.Section   at   00700h		'code'	

;Device_Length		equ		12H (USBRF.INC)
DeviceD:
dw		00112H, 00110H,	00000H,	00800H,	004d9H, 003f00h, 03ff0h,00100H,	00201H
DW		00100H

;bLengthD:           DW  0012H   ;Size of this descriptor in bytes (18)
;bDescriptorTypeD:   DW  0001H   ;Device descriptor type (1)
;bcdUSB:             DW  0010H, 0001H ;USB specification release Number (1.0)
;bDeviceClass:       DW  0000H   ;Class code (assigned by USB) (0 ?)
;bDeviceSubClass:    DW  0000H   ;Subclass code
;bDeviceProtocol:    DW  0000H   ;Protocol code
;wMaxPacketSize0:    DW  0008H   ;Maximum packet size for endpoint zero (8)
;idVendor:           DW  0012H, 0041H ;Vendor ID (assigned by USB) (?)
;idProduct:          DW  00e0H, 0001H ;Product ID (assigned by manufacturer) (?)
;bcdDevice:          DW  0000H, 0001H ;Device release number (1.0 ?)
;iManufacturer:      DW  0001H   ;Index of string descriptor (Manufacturer) (?)
;iProduct:           DW  0002H   ;Index of string descriptor (Product) (?)
;iSerialNumber:      DW  0000H   ;Index of string descriptor (Serial Number) (?)
;iNumConfigurations: DW  0001H   ;Number of possible configuration
;-----------------------------------------------------------------------------

;*******************************************************************************
ConfigurationD:
DW		00209H		

;config_Length 		equ		22H (USBRF.INC)
Wtotallength:
DW		00022H		
;;DW	00029H
;INTERFACE_NO		EQU		1 (USBRF.INC)
bNumberInterface:
DW		00101H,	03f00h, 03280h		

;bLengthC:           DW  0009H   ;Size of this descriptor in bytes (9)
;bDescriptorTypeC:   DW  0002H   ;Configur descriptor type (2)
;wTotalLength:       DW  0022H, 0000H
;                    ;Total length of data return for this configuration.
;                    ;Include: Configuration,Interface,Endpoint, and HID)
;                    ;               9           9       7         9
;bNumberInterface:   DW  0001H   ;Number of interfaces supported by this config.
;bConfigurationValue:DW  0001H   ;The value set by Set configuration (1 ?)
;;According to the length of previous string(0 means no support)
;bConfiguration:     DW  0000H   ;Index of string descriptor (Configuration) (0 ?)
;bAttributes:        DW  0080H   ;D7:BusPowered,D6:Selfpowered,D5:RemoteWakeup
;MaxPower:           DW  0032H   ;Maximum power (50 x 2 mA ?)

;-----------------------------------------------------------------------------
InterfaceD_2:
InterfaceD_1:
InterfaceD_0:
DW		00409H,	00000H,	00301h,	00000H,	03F00H 	;9

;bLengthI_0_1:           DW  0009H   ;Size of this descriptor in bytes (9)
;bDescriptorTypeI_0_1:   DW  0004H   ;Configur descriptor type (4)
;bInterfaceNumber_0_1:   DW  0000H   ;Number of interface (Zero-based 0)
;bAlternateSetting_0_1:  DW  0000H   ;Value used to select alternate setting (0)
;bNumEndpoints_0_1:      DW  0001H   ;Number of endpoints use by this interface (1)
;bInterfaceClass_0_1:    DW  0003H   ;Class code (HID code assigned by USB) (3)
;bInterfaceSubClass_0_1: DW  0000H   ;Subclass code (0:no subclass 1:Boot interface subclass)
;bInterfaceProtocol_0_1: DW  0000H   ;Protocol code (0:none, 1:KB, 2:Mouse) (0)
;;According to the length of previous string(0 means no support)
;iInterface_0_1:         DW  0000H   ;Index of string descriptor (Interface) (5 ?)

;-----------------------------------------------------------------------------
;HID_LENGTH	EQU 9 (USBRF1.INC)
;ENTITY_LENGTH EQU 2fH
HID_2:
HID_1:
HID_0:
DW		02109H,	00110H,	00100H,	03f22H, 0002fH ;9

;bLengthH_0:           DW  0009H   ;Size of this descriptor in bytes (8)
;bDescriptor_0:        DW  0021H   ;HID Descriptor type (1)  (MemPhis)
;bcdHID_0:             DW  0010H, 0001H  ;HID Class spec. release number (1.00)
;bCountryCode_0:       DW  0000H   ;Hardware target country
;bNumDescriptors_0:    DW  0001h   ;Number of HID class descriptors to follow
;bDescriptorType_0:    DW  0022H   ;Entity descriptor type
;wEntityLength_0:      DW  0035h	
;-----------------------------------------------------------------------------
EndpointD_0:
DW		00507H,	00381H,	00008H,	03f0aH				;7
;bLengthE_0_1:           DW  0007H   ;Size of this descriptor in bytes (9)
;bDescriptorTypeE_0_1:   DW  0005H   ;Endpoint descriptor type (5)
;bEndpointAddress_0_1:   DW  0081H   ;The address of endpoint    (81h)
;                                ;bit 0..3: The endpoint number  0001
;                                ;bit 4..6: reserved              000
;                                ;bit 7   : direction (0:Out/1:In)  1
;bmAttribute_0_1:        DW  0003H   ;Endpoint Attribute (03h)
;                                ;bit 0..1: transfer type
;                                ;      00  Control
;                                ;      01  Isochronous
;                                ;      10  Bulk
;                                ;      11  Interrupt
;                                ;All other reserved
;wMaxPacketSize_0_1:     DW  0008H, 0000H    ;Maximum packet size (8)
;bInterval_0:          	 DW  0008H   ;Interval for polling endpoint (8 ms)

EndpointD_2:
EndpointD_1:
;DW		00507H,	00302H,	00008H,	03f08H				;7
;DW		00507H,	00302H,	00008H,	03f0aH				;7
;bLengthE_0_1:           DW  0007H   ;Size of this descriptor in bytes (9)
;bDescriptorTypeE_0_1:   DW  0005H   ;Endpoint descriptor type (5)
;bEndpointAddress_0_1:   DW  0002H   ;The address of endpoint    (81h)
;                                ;bit 0..3: The endpoint number  0001
;                                ;bit 4..6: reserved              000
;                                ;bit 7   : direction (0:Out/1:In)  1
;bmAttribute_0_1:        DW  0003H   ;Endpoint Attribute (03h)
;                                ;bit 0..1: transfer type
;                                ;      00  Control
;                                ;      01  Isochronous
;                                ;      10  Bulk
;                                ;      11  Interrupt
;                                ;All other reserved
;wMaxPacketSize_0_1:     DW  0008H, 0000H    ;Maximum packet size (16)
;bInterval_0:          	 DW  0008H   ;Interval for polling endpoint (8 ms)

;-----------------------------------------------------------------------------
Entity_2:
Entity_1:
Entity_0:
dw		00006h, 009ffh, 03f01h, 001a1h

DW      00295H, 00875H, 0015h, 03f26h, 03fffh, 03f00H 

;feature
;DW		00409H, 0509h, 002B1H

;intput
dw		00015h, 03f26h, 03fffh, 03f00h
dw		01019h, 01729h	;usage min, usage max
dw		00895h, 00875h, 00281h

;output
dw      00015h, 03f26h, 03fffh, 03f00h
dw		01819h, 01f29h	;usage min, usage max
dw		00895h, 00875h, 00291h

dw		03fc0h

;		DB	06H, 00H, FFH  	;  USAGE PAGE (USER PAGE) 
;		DB	09H, 01H  		;  USAGE (CONSUMER CONTROL)
;		DB	A1H, 01H		;  COLLECTION (APPLICATION)
;                    DW  0095H, 0001H    ;Report Count (3)
;                    DW  0075H, 0008H    ;Report Size (1)
;                    DW  0015H, 0000H    ;Log Min (0)
;                    DW  0025H, 0006H    ;Log Max (1)
;                    DW  0009H, 0004H    ;Usage (#)
;                    DW  00B1H, 0002H    ;Feature: (Data, ARRAY)

;					 DB  15H, 00H        ;LOGICAL MINIMUM (0)		
;				     DB  26H, FFH, 00H   ;LOGICAL MAXIMUM (FF)
;                    DW  0019H, 0018H    ;Usage Min (#)
;                    DW  0029H, 001FH    ;Usage Max (#)

;       			 DW  0095H, 0008H    ;Report Count (8)
;       			 DW  0075H, 0008H    ;Report Size (8)
;       			 DW  0091H, 0002H    ;INPUT: (Data, Array)

;					 DB  15H, 00H        ;LOGICAL MINIMUM (0)		
;				     DB  26H, FFH, 00H   ;LOGICAL MAXIMUM (FF)
;                    DW  0019H, 0004H    ;Usage Min (#)
;                    DW  0029H, 0006H    ;Usage Max (#)

;       			 DW  0095H, 0008H    ;Report Count (8)
;       			 DW  0075H, 0008H    ;Report Size (8)
;       			 DW  0091H, 0002H    ;OUTPUT: (Data, Array)
;		DB C0H							 ;END_COLLECTION	

;-----------------------------------------------------------------------------
LANGID:
dw		0304h,	00409h

ManufactureS:
dw		0030eh, 'H', 'o', 'l', 't', 'e', 'k'

ProductS:
dw		00324h
dw		'U','S','B','-','H','I','D',' ','d','e','m','o',' ','c','o','d','e'

;avoid c compiler/linker arrange code in last byte (ice bug)
DUMMY			.Section   at	07FFH		'CODE'
DW		0000H
;-----------------------------------------------------------------------------
PUBLIC			DeviceD
PUBLIC			ConfigurationD
PUBLIC			InterfaceD_0
PUBLIC			EndpointD_0
PUBLIC			HID_0
PUBLIC			Entity_0
PUBLIC			InterfaceD_1
PUBLIC			EndpointD_1
PUBLIC			HID_1
PUBLIC			Entity_1
PUBLIC			InterfaceD_2
PUBLIC			EndpointD_2
PUBLIC			HID_2
public			LANGID
public			ManufactureS
public			ProductS
end

⌨️ 快捷键说明

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