I am looking for code embedded in the source code to alter some of the fields of the HID device descriptor and HID report descriptor for Arduino micro. USBCore.h doesn't seem to define either descriptor. It has the other descriptor typedefs though. So are these two hard coded somewhere in a core.a or can I still find and change them? Thank you!
Not 100% sure but what you are looking for might be in HID.cpp
Romonaga:
Not 100% sure but what you are looking for might be in HID.cpp
Thanks. I glanced at HID.cpp and moved on to other USB code. Just moved back to HID
#define D_HIDREPORT(length) { 9, 0x21, 0x01, 0x01, 0, 1, 0x22, lowByte(length), highByte(length) }
This seems to be HID report related but this is not long enough.
What I extracted from micro, the complete HID report descriptor, 47 bytes in length:
05 01 09 06 a1 01 85 02 05 07 19 e0 29 e7 15 00 25 01 75 01 95 08 81 02 95 01 75 08 81 03 95 06 75 08 15 00 25 65 05 07 19 00 29 65 81 00 c0
INPUT(2)[INPUT]
Field(0)
Application(GenericDesktop.Keyboard)
Usage(8)
Keyboard.00e0
Keyboard.00e1
Keyboard.00e2
Keyboard.00e3
Keyboard.00e4
Keyboard.00e5
Keyboard.00e6
Keyboard.00e7
Logical Minimum(0)
Logical Maximum(1)
Report Size(1)
Report Count(8)
Report Offset(0)
Flags( Variable Absolute )
Field(1)
Application(GenericDesktop.Keyboard)
Usage(102)
Keyboard.0000
Keyboard.0001
Keyboard.0002
Keyboard.0003
Keyboard.0004
Keyboard.0005
Keyboard.0006
Keyboard.0007
Keyboard.0008
Keyboard.0009
Keyboard.000a
Keyboard.000b
Keyboard.000c
Keyboard.000d
Keyboard.000e
Keyboard.000f
Keyboard.0010
Keyboard.0011
Keyboard.0012
Keyboard.0013
Keyboard.0014
Keyboard.0015
Keyboard.0016
Keyboard.0017
Keyboard.0018
Keyboard.0019
Keyboard.001a
Keyboard.001b
Keyboard.001c
Keyboard.001d
Keyboard.001e
Keyboard.001f
Keyboard.0020
Keyboard.0021
Keyboard.0022
Keyboard.0023
Keyboard.0024
Keyboard.0025
Keyboard.0026
Keyboard.0027
Keyboard.0028
Keyboard.0029
Keyboard.002a
Keyboard.002b
Keyboard.002c
Keyboard.002d
Keyboard.002e
Keyboard.002f
Keyboard.0030
Keyboard.0031
Keyboard.0032
Keyboard.0033
Keyboard.0034
Keyboard.0035
Keyboard.0036
Keyboard.0037
Keyboard.0038
Keyboard.0039
Keyboard.003a
Keyboard.003b
Keyboard.003c
Keyboard.003d
Keyboard.003e
Keyboard.003f
Keyboard.0040
Keyboard.0041
Keyboard.0042
Keyboard.0043
Keyboard.0044
Keyboard.0045
Keyboard.0046
Keyboard.0047
Keyboard.0048
Keyboard.0049
Keyboard.004a
Keyboard.004b
Keyboard.004c
Keyboard.004d
Keyboard.004e
Keyboard.004f
Keyboard.0050
Keyboard.0051
Keyboard.0052
Keyboard.0053
Keyboard.0054
Keyboard.0055
Keyboard.0056
Keyboard.0057
Keyboard.0058
Keyboard.0059
Keyboard.005a
Keyboard.005b
Keyboard.005c
Keyboard.005d
Keyboard.005e
Keyboard.005f
Keyboard.0060
Keyboard.0061
Keyboard.0062
Keyboard.0063
Keyboard.0064
Keyboard.0065
Logical Minimum(0)
Logical Maximum(101)
Report Size(8)
Report Count(6)
Report Offset(16)
Flags( Array Absolute )
Keyboard.00e0 ---> Key.LeftControl
Keyboard.00e1 ---> Key.LeftShift
Keyboard.00e2 ---> Key.LeftAlt
Keyboard.00e3 ---> Key.LeftMeta
Keyboard.00e4 ---> Key.RightCtrl
Keyboard.00e5 ---> Key.RightShift
Keyboard.00e6 ---> Key.RightAlt
Keyboard.00e7 ---> Key.RightMeta
Keyboard.0000 ---> Sync.Report
Keyboard.0001 ---> Sync.Report
Keyboard.0002 ---> Sync.Report
Keyboard.0003 ---> Sync.Report
Keyboard.0004 ---> Key.A
Keyboard.0005 ---> Key.B
Keyboard.0006 ---> Key.C
Keyboard.0007 ---> Key.D
Keyboard.0008 ---> Key.E
Keyboard.0009 ---> Key.F
Keyboard.000a ---> Key.G
Keyboard.000b ---> Key.H
Keyboard.000c ---> Key.I
Keyboard.000d ---> Key.J
Keyboard.000e ---> Key.K
Keyboard.000f ---> Key.L
Keyboard.0010 ---> Key.M
Keyboard.0011 ---> Key.N
Keyboard.0012 ---> Key.O
Keyboard.0013 ---> Key.P
Keyboard.0014 ---> Key.Q
Keyboard.0015 ---> Key.R
Keyboard.0016 ---> Key.S
Keyboard.0017 ---> Key.T
Keyboard.0018 ---> Key.U
Keyboard.0019 ---> Key.V
Keyboard.001a ---> Key.W
Keyboard.001b ---> Key.X
Keyboard.001c ---> Key.Y
Keyboard.001d ---> Key.Z
Keyboard.001e ---> Key.1
Keyboard.001f ---> Key.2
Keyboard.0020 ---> Key.3
Keyboard.0021 ---> Key.4
Keyboard.0022 ---> Key.5
Keyboard.0023 ---> Key.6
Keyboard.0024 ---> Key.7
Keyboard.0025 ---> Key.8
Keyboard.0026 ---> Key.9
Keyboard.0027 ---> Key.0
Keyboard.0028 ---> Key.Enter
Keyboard.0029 ---> Key.Esc
Keyboard.002a ---> Key.Backspace
Keyboard.002b ---> Key.Tab
Keyboard.002c ---> Key.Space
Keyboard.002d ---> Key.Minus
Keyboard.002e ---> Key.Equal
Keyboard.002f ---> Key.LeftBrace
Keyboard.0030 ---> Key.RightBrace
Keyboard.0031 ---> Key.BackSlash
Keyboard.0032 ---> Key.BackSlash
Keyboard.0033 ---> Key.Semicolon
Keyboard.0034 ---> Key.Apostrophe
Keyboard.0035 ---> Key.Grave
Keyboard.0036 ---> Key.Comma
Keyboard.0037 ---> Key.Dot
Keyboard.0038 ---> Key.Slash
Keyboard.0039 ---> Key.CapsLock
Keyboard.003a ---> Key.F1
Keyboard.003b ---> Key.F2
Keyboard.003c ---> Key.F3
Keyboard.003d ---> Key.F4
Keyboard.003e ---> Key.F5
Keyboard.003f ---> Key.F6
Keyboard.0040 ---> Key.F7
Keyboard.0041 ---> Key.F8
Keyboard.0042 ---> Key.F9
Keyboard.0043 ---> Key.F10
Keyboard.0044 ---> Key.F11
Keyboard.0045 ---> Key.F12
Keyboard.0046 ---> Key.SysRq
Keyboard.0047 ---> Key.ScrollLock
Keyboard.0048 ---> Key.Pause
Keyboard.0049 ---> Key.Insert
Keyboard.004a ---> Key.Home
Keyboard.004b ---> Key.PageUp
Keyboard.004c ---> Key.Delete
Keyboard.004d ---> Key.End
Keyboard.004e ---> Key.PageDown
Keyboard.004f ---> Key.Right
Keyboard.0050 ---> Key.Left
Keyboard.0051 ---> Key.Down
Keyboard.0052 ---> Key.Up
Keyboard.0053 ---> Key.NumLock
Keyboard.0054 ---> Key.KPSlash
Keyboard.0055 ---> Key.KPAsterisk
Keyboard.0056 ---> Key.KPMinus
Keyboard.0057 ---> Key.KPPlus
Keyboard.0058 ---> Key.KPEnter
Keyboard.0059 ---> Key.KP1
Keyboard.005a ---> Key.KP2
Keyboard.005b ---> Key.KP3
Keyboard.005c ---> Key.KP4
Keyboard.005d ---> Key.KP5
Keyboard.005e ---> Key.KP6
Keyboard.005f ---> Key.KP7
Keyboard.0060 ---> Key.KP8
Keyboard.0061 ---> Key.KP9
Keyboard.0062 ---> Key.KP0
Keyboard.0063 ---> Key.KPDot
Keyboard.0064 ---> Key.102nd
Keyboard.0065 ---> Key.Compose
Look in Keyboard.cpp.
gbafamily:
Look in Keyboard.cpp.
That saved me from searching the whole night! XOXO
There are so many different pieces of code and I am doing my best to keep up. Some descriptions/naming aren't best either, like in HID.h they typedef HIDDescDescriptor?! It is supposed to be HID Device Descriptor, not HID Descriptor Descriptor?! Maybe it's not written in English but it's all confusing naming. I need to print these files out one day so I can stare at them on a large table or stick them to a wall. LOL
This is the right place to find the HID report descriptor. It turned out that the report descriptor sets keyboard with a report ID of 2, which follows Mouse report ID of 1. I'll see if I can safely remove this line and get it to not report ID (2) anymore.