CLI: Parse USB device version BCD (#14580)
* CLI: Parse USB device version BCD * Apply suggestions
This commit is contained in:
parent
557fbbd6af
commit
c72ed7c024
42 changed files with 88 additions and 52 deletions
|
|
@ -15,6 +15,8 @@
|
|||
"COMBO_TERM": {"info_key": "combo.term", "value_type": "int"},
|
||||
"DEBOUNCE": {"info_key": "debounce", "value_type": "int"},
|
||||
"DEVICE_VER": {"info_key": "usb.device_ver", "value_type": "hex"},
|
||||
# TODO: Replace ^^^ with vvv
|
||||
#"DEVICE_VER": {"info_key": "usb.device_version", "value_type": "bcd_version"},
|
||||
"DESCRIPTION": {"info_key": "keyboard_folder", "to_json": false},
|
||||
"DIODE_DIRECTION": {"info_key": "diode_direction"},
|
||||
"FORCE_NKRO": {"info_key": "usb.force_nkro", "value_type": "bool"},
|
||||
|
|
|
|||
|
|
@ -20,6 +20,10 @@
|
|||
"type": "string",
|
||||
"pattern": "^0x[0-9A-F]{4}$"
|
||||
},
|
||||
"bcd_version": {
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]{1,2}\\.[0-9]\\.[0-9]$"
|
||||
},
|
||||
"text_identifier": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
|
|
@ -70,13 +74,13 @@
|
|||
"signed_int": {
|
||||
"type": "number",
|
||||
"multipleOf": 1
|
||||
}
|
||||
},
|
||||
"signed_int_8": {
|
||||
"type": "number",
|
||||
"min": -127,
|
||||
"max": 127,
|
||||
"multipleOf": 1
|
||||
}
|
||||
},
|
||||
"string_array": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
|
|
@ -97,7 +101,7 @@
|
|||
"type": "number",
|
||||
"min": 0,
|
||||
"multipleOf": 1
|
||||
}
|
||||
},
|
||||
"unsigned_int_8": {
|
||||
"type": "number",
|
||||
"min": 0,
|
||||
|
|
|
|||
|
|
@ -320,7 +320,8 @@
|
|||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"device_ver": {"$ref": "qmk.definitions.v1#/hex_number_4d"},
|
||||
"device_ver": {"$ref": "qmk.definitions.v1#/hex_number_4d"}, # Deprecated
|
||||
"device_version": {"$ref": "qmk.definitions.v1#/bcd_version"},
|
||||
"force_nkro": {"type": "boolean"},
|
||||
"pid": {"$ref": "qmk.definitions.v1#/hex_number_4d"},
|
||||
"vid": {"$ref": "qmk.definitions.v1#/hex_number_4d"},
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ The following animations can be enabled:
|
|||
|
||||
### USB
|
||||
|
||||
Every USB keyboard needs to have its USB parmaters defined. At a minimum you need to set vid, pid, and device version.
|
||||
Every USB keyboard needs to have its USB parameters defined. At a minimum you need to set the Vendor ID, Product ID, and device version.
|
||||
|
||||
Example:
|
||||
|
||||
|
|
@ -181,7 +181,9 @@ Example:
|
|||
"usb": {
|
||||
"vid": "0xC1ED",
|
||||
"pid": "0x23B0",
|
||||
"device_ver": "0x0001"
|
||||
"device_version": "1.0.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The device version is a BCD (binary coded decimal) value, in the format `MMmr`, so the below value would look like `0x0100` in the generated code. This also means the maximum valid values for each part are `99.9.9`, despite it being a hexadecimal value under the hood.
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@
|
|||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0x4025
|
||||
#define PRODUCT_ID 0x0A0C
|
||||
#define DEVICE_VER 0x0F25
|
||||
#define VENDOR_ID 0x4025 // 40%
|
||||
#define PRODUCT_ID 0x0F25
|
||||
#define DEVICE_VER 0x0100
|
||||
#define MANUFACTURER di0ib
|
||||
#define PRODUCT The 5x5 Keyboard
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0x4025
|
||||
#define PRODUCT_ID 0x0A0C
|
||||
#define DEVICE_VER 0x05B5
|
||||
#define VENDOR_ID 0x4025 // 40%
|
||||
#define PRODUCT_ID 0x05B5
|
||||
#define DEVICE_VER 0x0100
|
||||
#define MANUFACTURER di0ib
|
||||
#define PRODUCT The 5x5 Keyboard
|
||||
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@
|
|||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0x4025
|
||||
#define PRODUCT_ID 0x0A0C
|
||||
#define DEVICE_VER 0x0F61
|
||||
#define VENDOR_ID 0x4025 // 40%
|
||||
#define PRODUCT_ID 0x0F61
|
||||
#define DEVICE_VER 0x0100
|
||||
#define MANUFACTURER di0ib
|
||||
#define PRODUCT The 6lit Macropad
|
||||
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@
|
|||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0x4025
|
||||
#define PRODUCT_ID 0x0A0C
|
||||
#define DEVICE_VER 0x0F00
|
||||
#define VENDOR_ID 0x4025 // 40%
|
||||
#define PRODUCT_ID 0x0F00
|
||||
#define DEVICE_VER 0x0100
|
||||
#define MANUFACTURER di0ib
|
||||
#define PRODUCT The foobar Keyboard
|
||||
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0x4025
|
||||
#define PRODUCT_ID 0x0A0C
|
||||
#define DEVICE_VER 0x4A1F
|
||||
#define VENDOR_ID 0x4025 // 40%
|
||||
#define PRODUCT_ID 0x4A1F
|
||||
#define DEVICE_VER 0x0100
|
||||
#define MANUFACTURER di0ib
|
||||
#define PRODUCT half_n_half
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define DEVICE_VER 0x07E3
|
||||
#define DEVICE_VER 0x2019
|
||||
|
||||
#undef MATRIX_ROWS
|
||||
#undef MATRIX_COLS
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
},
|
||||
"url": "https://caps-unlocked.com/cu80-round-2/",
|
||||
"usb": {
|
||||
"device_ver": "0x0001",
|
||||
"device_version": "0.0.1",
|
||||
"pid": "0x0081",
|
||||
"vid": "0x4355"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
},
|
||||
"url": "https://caps-unlocked.com/cu80-round-2/",
|
||||
"usb": {
|
||||
"device_ver": "0x0001",
|
||||
"device_version": "0.0.1",
|
||||
"pid": "0x0080",
|
||||
"vid": "0x4355"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
},
|
||||
"url": "",
|
||||
"usb": {
|
||||
"device_ver": "0x0001",
|
||||
"device_version": "0.0.1",
|
||||
"pid": "0x2312",
|
||||
"vid": "0xC1ED"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
"rows": ["C0", "C1", "C2", "C3", "C7", "F7", "B1", "F2", "F3", "F4", "F5", "F6", "C6"]
|
||||
},
|
||||
"usb": {
|
||||
"device_ver": "0x0001",
|
||||
"device_version": "0.0.1",
|
||||
"pid": "0x23A0",
|
||||
"vid": "0xC1ED"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
"rows": ["B0", "B1", "B2", "A15", "A10"]
|
||||
},
|
||||
"usb": {
|
||||
"device_ver": "0x0001",
|
||||
"device_version": "0.0.1",
|
||||
"pid": "0x2350",
|
||||
"vid": "0xC1ED"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
"saturation_steps": 17
|
||||
},
|
||||
"usb": {
|
||||
"device_ver": "0x0001",
|
||||
"device_version": "0.0.1",
|
||||
"pid": "0x2301",
|
||||
"vid": "0xC1ED"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
"saturation_steps": 17
|
||||
},
|
||||
"usb": {
|
||||
"device_ver": "0x0001",
|
||||
"device_version": "0.0.1",
|
||||
"pid": "0x2320",
|
||||
"vid": "0xC1ED"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
"saturation_steps": 17
|
||||
},
|
||||
"usb": {
|
||||
"device_ver": "0x0001",
|
||||
"device_version": "0.0.1",
|
||||
"pid": "0x2370",
|
||||
"vid": "0xC1ED"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
"saturation_steps": 17
|
||||
},
|
||||
"usb": {
|
||||
"device_ver": "0x0001",
|
||||
"device_version": "0.0.1",
|
||||
"pid": "0x2390",
|
||||
"vid": "0xC1ED"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
"rows": ["B11", "A6", "A3", "A2", "A1", "B5", "B6", "C15", "C14", "C13"]
|
||||
},
|
||||
"usb": {
|
||||
"device_ver": "0x0001",
|
||||
"device_version": "0.0.1",
|
||||
"pid": "0x2391",
|
||||
"vid": "0xC1ED"
|
||||
},
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue