📄 hidkb_2313.lst
字号:
; R13 USBIRQ
.EQU bmUSBRESDNIRQ =0x80
.EQU bmVBUSIRQ =0x40
.EQU bmNOVBUSIRQ =0x20
.EQU bmSUSPIRQ =0x10
.EQU bmUSBRESIRQ =0x08
.EQU bmBUSACTIRQ =0x04
.EQU bmRWUDNIRQ =0x02
.EQU bmOSCOKIRQ =0x01
; R14 USBIEN
.EQU bmUSBRESDNIE =0x80
.EQU bmVBUSIE =0x40
.EQU bmNOVBUSIE =0x20
.EQU bmSUSPENDIE =0x10
.EQU bmUSBRESIE =0x08
.EQU bmBUSACTIE =0x04
.EQU bmRWUDNIE =0x02
.EQU bmOSCOKIE =0x01
; R15 USBCTL
.EQU bmHOSCSTEN =0x80
.EQU bmVBGATE =0x40
.EQU bmCHIPRES =0x20
.EQU bmPWRDOWN =0x10
.EQU bmCONNECT =0x08
.EQU bmSIGRWU =0x04
; R16 CPUCTL
.EQU bmIE =0x01
; R17 PINCTL
.EQU bmEP3INAK =0x80
.EQU bmEP2INAK =0x40
.EQU bmEP0INAK =0x20
.EQU bmFDUPSPI =0x10
.EQU bmINTLEVEL =0x08
.EQU bmPOSINT =0x04
.EQU bmGPOB =0x02
.EQU bmGPOA =0x01
;
; USB Spec Constants
;
; Standard Requests
.EQU SR_GET_STATUS =0x00
.EQU SR_CLEAR_FEATURE =0x01
.EQU SR_RESERVED =0x02
.EQU SR_SET_FEATURE =0x03
.EQU SR_SET_ADDRESS =0x05
.EQU SR_GET_DESCRIPTOR =0x06
.EQU SR_SET_DESCRIPTOR =0x07
.EQU SR_GET_CONFIGURATION =0x08
.EQU SR_SET_CONFIGURATION =0x09
.EQU SR_GET_INTERFACE =0x0a
.EQU SR_SET_INTERFACE =0x0b
; SETUP packet offsets
.EQU bmRequestType =0
.EQU bRequest =1
.EQU wValueL =2
.EQU wValueH =3
.EQU wIndexL =4
.EQU wIndexH =5
.EQU wLengthL =6
.EQU wLengthH =7
; HID bRequest values
.EQU GET_REPORT =1
.EQU GET_IDLE =2
.EQU GET_PROTOCOL =3
.EQU SET_REPORT =9
.EQU SET_IDLE =0x0A
.EQU SET_PROTOCOL =0x0B
.EQU INPUT_REPORT =1
; Get Descriptor codes
.EQU GD_DEVICE =0x01 ; Get device descriptor: Device
.EQU GD_CONFIGURATION =0x02 ; Get device descriptor: Configuration
.EQU GD_STRING =0x03 ; Get device descriptor: String
.EQU GD_HID =0x21 ; Get descriptor: HID
.EQU GD_REPORT =0x22 ; Get descriptor: Report
.include "HID_KB_2313_Descriptors_and_Data.inc"
; HID_KB_2313_Descriptors_and_Data.inc
.SET SH = 128
.SET a = 4
.SET b = 5
.SET c = 6
.SET d = 7
.SET e = 8
.SET f = 9
.SET g = 10
.SET h = 11
.SET i = 12
.SET j = 13
.SET k = 14
.SET l = 15
.SET m = 16
.SET n = 17
.SET o = 18
.SET p = 19
.SET q = 20
.SET r = 21
.SET s = 22
.SET t = 23
.SET u = 24
.SET v = 25
.SET w = 26
.SET kx = 27 ; can't use X,Y or Z in new assembler
.SET ky = 28
.SET kz = 29
.SET n0 = 39
.SET n1 = 30
.SET n2 = 31
.SET n3 = 32
.SET n4 = 33
.SET n5 = 34
.SET n6 = 35
.SET n7 = 36
.SET n8 = 37
.SET n9 = 38
.SET sp = 44
.SET excl = SH+n1
.SET quest = SH+56
.SET period = 55
.SET comma = 54
.SET bs=42
.SET colon = SH+51
.SET tab = 43
.SET enter = 40
.SET dash = 45
.SET ampersand = SH+36
.CSEG
.ORG 0x300 ; in words
;Device_Descriptor
DD:
000300 0112 .DB 0x12,0x01 ; bLength = 18d bDescriptorType = Device (1)
000301 0100 .DB 0x00,0x01 ; bcdUSB(L/H) USB spec rev (BCD)
000302 ffff .DB 0xFF,0xFF ; bDeviceClass bDeviceSubClass,
000303 40ff .DB 0xFF,0x40 ; bDeviceProtocol bMaxPacketSize0 EP0 is 64 bytes
000304 0b6a .DB 0x6A,0x0B ; idVendor(L/H) MAXIM is 0B6A
000305 5346 .DB 0x46,0x53 ; idProduct(L/H)--5346
000306 1234 .DB 0x34,0x12 ; bcdDevice--1234
000307 0201
000308 0103 .DB 1,2,3,1 ; iManufacturer--iProduct--iSerialNumber--bNumConfigurations
; .DB 0,0,0,1
;
;Configuration_Descriptor
CD:
000309 0209 .DB 0x09,0x02 ; bLength bDescriptorType = Config
00030a 0022 .DB 34,0 ; wTotalLength=34 bytes (L/H)
00030b 0101 .DB 0x01,0x01 ; bNumInterfaces bConfigValue
00030c 8000 .DB 0x00,0x80 ; iConfiguration bmAttributes. b7=1 b6=self-powered(NOT) b5=RWU supported(NOT)
00030d 0901 .DB 0x01,0x09 ; MaxPower is 2 ma INTERFACE Descriptor, Length=9
00030e 0004 .DB 0x04,0x00 ; type = IF IF #0
00030f 0100 .DB 0x00,0x01 ; bAlternate Setting bNum Endpoints
000310 0003 .DB 0x03,0x00 ; bInterfaceClass=HID bInterfaceSubClass
000311 0000 .DB 0x00,0x00 ; bInterfaceProtocol iInterface
;HID_Descriptor
HD:
000312 2109 .DB 0x09,0x21 ; bLength bDescriptorType = HID
000313 0110 .DB 0x10,0x01 ; bcdHID(L/H) Rev 1.1
000314 0100 .DB 0x00,0x01 ; bCountryCode (none) bNumDescriptors (one report descriptor)
000315 2b22 .DB 0x22,43 ; bDescriptorType(report): wDescriptorLength(L) 43 byte report descriptor
000316 0700 .DB 0x00,0x07 ; wDescriptorLengthH ENDPOINT DESCRIPTOR bLength
000317 8305 .DB 0x05,0x83 ; bDescriptorType(EP) bEndpointAddress (EP3-IN)
000318 4003 .DB 0x03,0x40 ; bmAttributes(INT) wMaxPacketSizeL
000319 5500 .DB 0x00,0x255 ; wMaxPacketSizeH bInterval (poll every 255 msec)
;Report_Descriptor
RD:
00031a 0105 .DB 0x05,0x01 ; bDescriptorType (report) Usage Page (generic desktop)
00031b 0609 .DB 0x09,0x06 ; Usage
00031c 01a1 .DB 0xA1,0x01 ; Collection
00031d 0705 .DB 0x05,0x07 ; Usage Page
00031e e019 .DB 0x19,0xE0 ; Usage Minimum = 224
00031f e729 .DB 0x29,0xE7 ; Usage Maximum = 231
000320 0015 .DB 0x15,0x00 ; Logical Minimum = 0
000321 0125 .DB 0x25,0x01 ; Logical Maximum = 1
000322 0175 .DB 0x75,0x01 ; Report Size = 1
000323 0895 .DB 0x95,0x08 ; Report Count = 8
000324 0281 .DB 0x81,0x02 ; Input(Data,Variable,Absolute)
000325 0195 .DB 0x95,0x01 ; Report Count = 1
000326 0875 .DB 0x75,0x08 ; Report Size = 8
000327 0181 .DB 0x81,0x01 ; Input(Constant)
000328 0019 .DB 0x19,0x00 ; Usage Minimum = 0
000329 6529 .DB 0x29,0x65 ; Usage Maximum = 101
00032a 0015 .DB 0x15,0x00 ; Logical Minimum = 0,
00032b 6525 .DB 0x25,0x65 ; Logical Maximum = 101
00032c 0875 .DB 0x75,0x08 ; Report Size = 8
00032d 0195 .DB 0x95,0x01 ; Report Count = 1
00032e 0081 .DB 0x81,0x00 ; Input(Data,Variable,Array)
C:\AVR Projects\MAX3420E_EVKIT2_Code\HID_KB_2313_Descriptors_and_Data.inc(114): warning: .cseg .db misalignment - padding zero byte
C:\AVR Projects\MAX3420E_EVKIT2_Code\MAX3420E_EVKIT2_DemoCode.asm(54): 'C:\AVR Projects\MAX3420E_EVKIT2_Code\HID_KB_2313_Descriptors_and_Data.inc' included form here
00032f 00c0 .DB 0xC0 ; End Collection
STR0: ; Language string
000330 0304 .DB 0x04,0x03 ; bLength bDescriptorType = string
000331 0409 .DB 0x09,0x04 ; wLANGID(L/H)
;
; NOTE: USB uses Unicode for strings, which inserts a 0 after every ASCII character.
; These tables omit the zeros to save code space. The sending routine inserts them.
;
STR1: ; Manufacturer ID
000332 030c .DB 12,0x03 ; bLength bDescriptorType=string
000333 414d
000334 4958
C:\AVR Projects\MAX3420E_EVKIT2_Code\HID_KB_2313_Descriptors_and_Data.inc(126): warning: .cseg .db misalignment - padding zero byte
C:\AVR Projects\MAX3420E_EVKIT2_Code\MAX3420E_EVKIT2_DemoCode.asm(54): 'C:\AVR Projects\MAX3420E_EVKIT2_Code\HID_KB_2313_Descriptors_and_Data.inc' included form here
000335 004d .DB 'M','A','X','I','M' ; length is 2 + 2*(number of letters)
STR2: ; Product ID
000336 030a .DB 10,0x03 ; bLength bDescriptorType=string
000337 6544
000338 6f6d .DB 'D','e','m','o'
STR3: ; Serial Number
000339 0308 .DB 8,0x03 ; bLength bDescriptorType = string
00033a 4e53
C:\AVR Projects\MAX3420E_EVKIT2_Code\HID_KB_2313_Descriptors_and_Data.inc(134): warning: .cseg .db misalignment - padding zero byte
C:\AVR Projects\MAX3420E_EVKIT2_Code\MAX3420E_EVKIT2_DemoCode.asm(54): 'C:\AVR Projects\MAX3420E_EVKIT2_Code\HID_KB_2313_Descriptors_and_Data.inc' included form here
00033b 0031 .DB 'S','N','1'
DESCREND:
.CSEG
.ORG 0x380 ; in words
;HID_Message: Each letter is 3 bytes: shift,[00],Keycode. Sending routine inserts the middle zero.
; If b7 is set, send the shift character as the first byte.
;
; 0xFF is the message terminator.
;
KB_Message:
000380 2828
000381 2d2d
000382 2c2d
000383 8490
000384 209b
000385 1f21
000386 8827
000387 872c
000388 1704
000389 2c04
00038a 0b96
00038b 0808
00038c 2c17
00038d 2d2d
00038e 282d .DB enter,enter,dash,dash,dash,sp,SH+m,SH+a,SH+kx,n3,n4,n2,n0,SH+e,sp,SH+d,a,t,a,sp,SH+s,h,e,e,t,sp,dash,dash,dash,enter
00038f 2d2b
000390 842c
000391 0707
000392 2c16
000393 9698
000394 2c85
000395 1217
000396 042c
000397 1c11
000398 162c
000399 161c
00039a 0817
00039b 2810 .DB tab,dash,sp,SH+A,d,d,s,sp,SH+u,SH+s,SH+b,sp,t,o,sp,a,n,ky,sp,s,ky,s,t,e,m,enter
00039c 2d2b
00039d 972c
00039e 110c
00039f 2c1c
0003a0 2ca4
0003a1 0b86
0003a2 0408
0003a3 2a13
0003a4 2a2a
0003a5 122a
0003a6 1716
0003a7 882c
0003a8 0909
0003a9 0608
0003aa 0c17
0003ab 0819
C:\AVR Projects\MAX3420E_EVKIT2_Code\HID_KB_2313_Descriptors_and_Data.inc(149): warning: .cseg .db misalignment - padding zero byte
C:\AVR Projects\MAX3420E_EVKIT2_Code\MAX3420E_EVKIT2_DemoCode.asm(54): 'C:\AVR Projects\MAX3420E_EVKIT2_Code\HID_KB_2313_Descriptors_and_Data.inc' included form here
0003ac 0028 .DB tab,dash,sp,SH+t,i,n,ky,sp,ampersand,sp,SH+c,h,e,a,p,bs,bs,bs,bs,o,s,t,sp,SH+e,f,f,e,c,t,i,v,e,enter
0003ad 2d2b
0003ae 962c
0003af 100c
0003b0 0f13
0003b1 2c08
0003b2 9396
0003b3 2c8c
0003b4 118c
0003b5 0817
0003b6 0915
0003b7 0604
0003b8 2808 .DB tab,dash,sp,SH+s,i,m,p,l,e,sp,SH+s,SH+p,SH+i,sp,SH+i,n,t,e,r,f,a,c,e,enter
0003b9 2d2b
0003ba 892c
0003bb 080f
0003bc 0c1b
0003bd 0f05
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -