/doc/hidpp10.md

https://github.com/cvuchener/g500 · Markdown · 215 lines · 159 code · 56 blank · 0 comment · 0 complexity · 37339d40c33ee3800d5b2d3896274421 MD5 · raw file

  1. HID++ 1.0
  2. =========
  3. Short and long reports are use the same way. The long report is used when the data does not fit in the short one. Every HID++ 1.0 report use the same header:
  4. | Bytes | Type | Content | Comment |
  5. | ----- | ---------- | ------------------ | ------------------------ |
  6. | 0 | byte | HID report ID | 0x10 for short report, 0x11 for long report |
  7. | 1 | byte | Device index | -1 (0xff) for Unifying receivers, 0 for wired devices, 16 for Unifying devices |
  8. | 2 | byte | Sub ID | |
  9. | 3 | | | Depends on the *Sub ID* |
  10. Known Sub IDs are:
  11. - 0x000x0F: Device notifications
  12. - 0x400x4F: Unifying receiver notifications
  13. - 0x50: Memory writing notifications
  14. - 0x800x8F: Register access
  15. - 0x900x93: Writing data to memory
  16. Register access
  17. ---------------
  18. A register size may vary, if it is too big to fit in a short report, the long report is used. Every register command is answered with a input report using the same Sub ID or an error message.
  19. | Sub ID | Description | Output | Input |
  20. | ------ | -------------------- | ------ | ----- |
  21. | 0x80 | Write short register | short | short |
  22. | 0x81 | Read short register | short | short |
  23. | 0x82 | Write long register | long | short |
  24. | 0x83 | Read short register | short | long |
  25. | 0x8F | Error message | N/A | short |
  26. ### Accessing registers
  27. The format for report with Sub IDs 0x80 to 0x83 is:
  28. | Bytes | Type | Content | Comment |
  29. | ----- | ---------- | ------------------ | ------------------------ |
  30. | 0 | byte | HID report ID | 0x10 for short report, 0x11 for long report |
  31. | 1 | byte | Device index | |
  32. | 2 | byte | Sub ID | 0x800x83 |
  33. | 3 | byte | Register index | See below |
  34. | 4 | | | Register data |
  35. #### 0x000x0F: General registers
  36. | Register | Description | R/W | UR | G5 | G500(s) | G700s |
  37. | -------- | ----------------------------------------------------- | --- | ----- | ----- | ------- | ----- |
  38. | 0x00 | Enable notifications | R/W | short | short | | short |
  39. | 0x01 | [Individual features](commands/01-features.md) | R/W | | short | short | short |
  40. | 0x02 | Connection state | R/W | short | | | |
  41. | 0x07 | [Battery status](commands/07-battery-status.md) | R/? | | | | short |
  42. | 0x09 | ? (bit 8: keyboard Fn swap flag) | R/W | | | | |
  43. | 0x0D | [Battery mileage](commands/0d-battery-mileage.md) | R | | | | |
  44. | 0x0F | [Profile related queries](commands/0f-profile.md) | R/W | | | short | short |
  45. #### 0x100x1F: ?
  46. | Register | Description | R/W |
  47. | -------- | ----------------------------------------------------- | --- |
  48. | 0x17 | Keyboard illumination | ? |
  49. #### 0x500x5F: LED registers
  50. | Register | Description | R/W | G5 | G500(s) | G700s |
  51. | -------- | ----------------------------------------------------- | --- | ----- | ------- | ----- |
  52. | 0x51 | [LED status](commands/51-leds.md) | R/W | short | short | short |
  53. | 0x54 | [LED intensity](commands/54-led-intensity.md) | R/W | | | |
  54. | 0x57 | LED color | R/W | | short | |
  55. #### 0x600x6F: Mouse sensor registers
  56. | Register | Description | R/W | G5 | G500(s) | G700s |
  57. | -------- | ----------------------------------------------------- | --- | ----- | ------- | ----- |
  58. | 0x61 | [Optical sensor settings](commands/61-sensor.md) | R/W | | short | short |
  59. | 0x63 | [Current resolution](commands/63-resolution.md) | R/W | short | long | long |
  60. | 0x64 | [USB refresh rate](commands/64-usbrate.md) | R/W | short | short | short |
  61. #### 0x700x7F: ?
  62. | Register | Description | R/W | G500(s) |
  63. | -------- | ----------------------------------------------------- | --- | ------- |
  64. | 0x78 | ? | R | short |
  65. #### 0xA00xAF: Memory registers
  66. | Register | Description | R/W | G500(s) | G700s |
  67. | -------- | ----------------------------------------------------- | --- | ------- | ----- |
  68. | 0xA0 | [Internal memory operations](commands/a0-memop.md) | W | long | ? |
  69. | 0xA1 | [Resetting the sequence number](commands/a1-seqnum.md)| W | short | ? |
  70. | 0xA2 | [Internal memory reading](commands/a2-memread.md) | R | long | long |
  71. #### 0xB00xBF: Unifying connections
  72. | Register | Description | R/W | UR |
  73. | -------- | ----------------------------------------------------- | --- | ----- |
  74. | 0xB2 | Device Connection (Pairing) | W | short |
  75. | 0xB3 | Device Activity | R | long |
  76. | 0xB5 | Device Pairing information | R/W | long |
  77. #### 0xD00xDF: ?
  78. | Register | Description | R/W | G5 | G500(s) | G700s |
  79. | -------- | ----------------------------------------------------- | --- | ----- | ------- | ----- |
  80. | 0xD0 | ? | R/W | short | short | short |
  81. | 0xD2 | ? (write unavailable on G5) | R | short | short | |
  82. | 0xD3 | ? (error: unavailable) | R/? | | | long |
  83. | 0xD5 | ? (error: unavailable) | R/? | | | long |
  84. | 0xDA | ? (error: unavailable) | R/W | short | short | |
  85. | 0xDB | ? (error: unavailable) | R | long | long | |
  86. | 0xDE | ? (error: unavailable) | R/W | short | short | |
  87. #### 0xF00xFF: Firmware registers?
  88. | Register | Description | R/W | G5 | G500(s) | G700s |
  89. | -------- | ----------------------------------------------------- | --- | ----- | ------- | ----- |
  90. | 0xF0 | ? | W | short | short | ? |
  91. | 0xF1 | [Firmware infos](commands/f1-fwinfos.md) | R | short | short | ? |
  92. ### Error messages
  93. | Bytes | Type | Content | Comment |
  94. | ----- | ---------- | ------------------ | ------------------------ |
  95. | 0 | byte | HID report ID | Short report: 0x10 |
  96. | 1 | byte | Device index | |
  97. | 2 | byte | Sub ID | 0x8F |
  98. | 3 | byte | Original Sub ID | From the output report generating the error |
  99. | 4 | byte | Register index | From the output report generating the error |
  100. | 5 | byte | Error code | See table below |
  101. | 6 | | | *unused* |
  102. Error codes are:
  103. | Value | Name | Description |
  104. | ----- | ----------------------- | ------------------------------------- |
  105. | 0x00 | ERR_SUCCESS | |
  106. | 0x01 | ERR_INVALID_SUBID | Invalid report type or message length |
  107. | 0x02 | ERR_INVALID_ADDRESS | Invalid query type |
  108. | 0x03 | ERR_INVALID_VALUE | |
  109. | 0x04 | ERR_CONNECT_FAIL | Unifying Receiver error |
  110. | 0x05 | ERR_TOO_MANY_DEVICES | Unifying Receiver error |
  111. | 0x06 | ERR_ALREADY_EXISTS | Unifying Receiver error |
  112. | 0x07 | ERR_BUSY | Unifying Receiver error |
  113. | 0x08 | ERR_UNKNOWN_DEVICE | Unifying Receiver error |
  114. | 0x09 | ERR_RESOURCE_ERROR | Unifying Receiver error |
  115. | 0x0A | ERR_REQUEST_UNAVAILABLE | |
  116. | 0x0B | ERR_INVALID_PARAM_VALUE | |
  117. | 0x0C | ERR_WRONG_PIN_CODE | |
  118. For invalid parameters some devices use ERR_INVALID_VALUE instead of ERR_INVALID_PARAM_VALUE.
  119. Sending data to the internal memory
  120. -----------------------------------
  121. Data is sent in blocks to the internal memory. Values are replaced in the temporary memory (page 0) but is ANDed in the permanent memory.
  122. Each block is transmitted in several messages, the first message contains a 9-byte-long header describing the block being sent. All reports are long, thus each report contains 16 bytes of data, except the first which contains only 7 bytes because of the header.
  123. The structure of each message is:
  124. | Bytes | Type | Content | Comment |
  125. | ----- | ---------- | ------------------ | ------------------------ |
  126. | 0 | byte | Report ID | Long report: 0x11 |
  127. | 1 | byte | Device index | |
  128. | 2 | byte | Sub ID | 0x900x93 |
  129. | 3 | byte | Sequence number | |
  130. | 419 | byte array | 16 bytes of data | Payload or header with smaller payload |
  131. ### Sub IDs
  132. Sub IDs identify if the report is the first for a block or if acknowledgment message (input report with Sub ID = 0x50) are needed.
  133. | | Begin sending | Continue sending |
  134. | ----------------------- | ------------- | ---------------- |
  135. | Without acknowledgement | 0x90 | 0x91 |
  136. | With acknowledgement | 0x92 | 0x93 |
  137. ### Sequence number
  138. Each message contains a sequence number that must be incremented each time. The next sequence number to send can be reset by writing [register 0xA1](commands/a1-seqnum.md).
  139. When using acknowledgement message, the sequence number is repeated in the input report.
  140. ### Acknowledgement messages
  141. The structure of the acknowledgement messages is:
  142. | Bytes | Type | Content | Comment |
  143. | ----- | ---------- | ---------------------- | ------------------------ |
  144. | 0 | byte | Report ID | Short report: 0x10 |
  145. | 1 | byte | Device index | |
  146. | 2 | byte | Sub ID | 0x50 |
  147. | 3 | byte | Acknowledgement status | 0x01 if there is no error, otherwise an error code |
  148. | 4 | byte | Sequence number | if there was no error |
  149. | 56 | | | *unused* |
  150. ### Header
  151. The structure of the header sent in the first message is:
  152. | Bytes | Type | Content | Comment |
  153. | ----- | ---------- | ------------------ | ------------------------ |
  154. | 0 | byte | ? | 0x01 |
  155. | 1 | byte | destination page | |
  156. | 2 | byte | destination offset | |
  157. | 34 | byte | ? | |
  158. | 56 | int16 be | block length | |
  159. | 78 | byte | ? | |