diff options
Diffstat (limited to 'data')
| -rw-r--r-- | data/mappings/info_config.json | 42 | ||||
| -rw-r--r-- | data/mappings/info_rules.json | 15 | ||||
| -rw-r--r-- | data/schemas/api_keyboard.jsonschema | 35 | ||||
| -rw-r--r-- | data/schemas/false.jsonschema | 1 | ||||
| -rw-r--r-- | data/schemas/keyboard.jsonschema | 296 | ||||
| -rw-r--r-- | data/schemas/true.jsonschema | 1 |
6 files changed, 390 insertions, 0 deletions
diff --git a/data/mappings/info_config.json b/data/mappings/info_config.json new file mode 100644 index 000000000..885e6d025 --- /dev/null +++ b/data/mappings/info_config.json | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | # This file maps keys between `config.h` and `info.json`. It is used by QMK | ||
| 2 | # to correctly and consistently map back and forth between the two systems. | ||
| 3 | { | ||
| 4 | # Format: | ||
| 5 | # <config.h key>: {"info_key": <info.json key>, ["value_type": <value_type>], ["to_json": <true/false>], ["to_c": <true/false>]} | ||
| 6 | # value_type: one of "array", "array.int", "int", "hex", "list", "mapping" | ||
| 7 | # to_json: Default `true`. Set to `false` to exclude this mapping from info.json | ||
| 8 | # to_c: Default `true`. Set to `false` to exclude this mapping from config.h | ||
| 9 | # warn_duplicate: Default `true`. Set to `false` to turn off warning when a value exists in both places | ||
| 10 | "DEBOUNCE": {"info_key": "debounce", "value_type": "int"} | ||
| 11 | "DEVICE_VER": {"info_key": "usb.device_ver", "value_type": "hex"}, | ||
| 12 | "DESCRIPTION": {"info_key": "keyboard_folder", "to_json": false}, | ||
| 13 | "DIODE_DIRECTION": {"info_key": "diode_direction"}, | ||
| 14 | "LAYOUTS": {"info_key": "layout_aliases", "value_type": "mapping"}, | ||
| 15 | "LED_CAPS_LOCK_PIN": {"info_key": "indicators.caps_lock"}, | ||
| 16 | "LED_NUM_LOCK_PIN": {"info_key": "indicators.num_lock"}, | ||
| 17 | "LED_SCROLL_LOCK_PIN": {"info_key": "indicators.scroll_lock"}, | ||
| 18 | "MANUFACTURER": {"info_key": "manufacturer"}, | ||
| 19 | "RGB_DI_PIN": {"info_key": "rgblight.pin"}, | ||
| 20 | "RGBLED_NUM": {"info_key": "rgblight.led_count", "value_type": "int"}, | ||
| 21 | "RGBLED_SPLIT": {"info_key": "rgblight.split_count", "value_type": "array.int"}, | ||
| 22 | "RGBLIGHT_ANIMATIONS": {"info_key": "rgblight.animations.all", "value_type": "bool"}, | ||
| 23 | "RGBLIGHT_EFFECT_ALTERNATING": {"info_key": "rgblight.animations.alternating", "value_type": "bool"}, | ||
| 24 | "RGBLIGHT_EFFECT_BREATHING": {"info_key": "rgblight.animations.breathing", "value_type": "bool"}, | ||
| 25 | "RGBLIGHT_EFFECT_CHRISTMAS": {"info_key": "rgblight.animations.christmas", "value_type": "bool"}, | ||
| 26 | "RGBLIGHT_EFFECT_KNIGHT": {"info_key": "rgblight.animations.knight", "value_type": "bool"}, | ||
| 27 | "RGBLIGHT_EFFECT_RAINBOW_MOOD": {"info_key": "rgblight.animations.rainbow_mood", "value_type": "bool"}, | ||
| 28 | "RGBLIGHT_EFFECT_RAINBOW_SWIRL": {"info_key": "rgblight.animations.rainbow_swirl", "value_type": "bool"}, | ||
| 29 | "RGBLIGHT_EFFECT_RGB_TEST": {"info_key": "rgblight.animations.rgb_test", "value_type": "bool"}, | ||
| 30 | "RGBLIGHT_EFFECT_SNAKE": {"info_key": "rgblight.animations.snake", "value_type": "bool"}, | ||
| 31 | "RGBLIGHT_EFFECT_STATIC_GRADIENT": {"info_key": "rgblight.animations.static_gradient", "value_type": "bool"}, | ||
| 32 | "RGBLIGHT_EFFECT_TWINKLE": {"info_key": "rgblight.animations.twinkle"}, | ||
| 33 | "RGBLIGHT_LIMIT_VAL": {"info_key": "rgblight.max_brightness", "value_type": "int"}, | ||
| 34 | "RGBLIGHT_HUE_STEP": {"info_key": "rgblight.hue_steps", "value_type": "int"}, | ||
| 35 | "RGBLIGHT_SAT_STEP": {"info_key": "rgblight.saturation_steps", "value_type": "int"}, | ||
| 36 | "RGBLIGHT_VAL_STEP": {"info_key": "rgblight.brightness_steps", "value_type": "int"}, | ||
| 37 | "RGBLIGHT_SLEEP": {"info_key": "rgblight.sleep", "value_type": "bool"}, | ||
| 38 | "RGBLIGHT_SPLIT": {"info_key": "rgblight.split", "value_type": "bool"}, | ||
| 39 | "PRODUCT": {"info_key": "keyboard_folder", "to_json": false}, | ||
| 40 | "PRODUCT_ID": {"info_key": "usb.pid", "value_type": "hex"}, | ||
| 41 | "VENDOR_ID": {"info_key": "usb.vid", "value_type": "hex"} | ||
| 42 | } | ||
diff --git a/data/mappings/info_rules.json b/data/mappings/info_rules.json new file mode 100644 index 000000000..97f772c4d --- /dev/null +++ b/data/mappings/info_rules.json | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | # This file maps keys between `rules.mk` and `info.json`. It is used by QMK | ||
| 2 | # to correctly and consistently map back and forth between the two systems. | ||
| 3 | { | ||
| 4 | # Format: | ||
| 5 | # <rules.mk key>: {"info_key": <info.json key>, ["value_type": <value_type>], ["to_json": <true/false>], ["to_c": <true/false>]} | ||
| 6 | # value_type: one of "array", "array.int", "int", "list", "hex", "mapping" | ||
| 7 | # to_json: Default `true`. Set to `false` to exclude this mapping from info.json | ||
| 8 | # to_c: Default `true`. Set to `false` to exclude this mapping from rules.mk | ||
| 9 | # warn_duplicate: Default `true`. Set to `false` to turn off warning when a value exists in both places | ||
| 10 | "BOARD": {"info_key": "board"}, | ||
| 11 | "BOOTLOADER": {"info_key": "bootloader", "warn_duplicate": false}, | ||
| 12 | "LAYOUTS": {"info_key": "community_layouts", "value_type": "list"}, | ||
| 13 | "LED_MATRIX_DRIVER": {"info_key": "led_matrix.driver"}, | ||
| 14 | "MCU": {"info_key": "processor", "warn_duplicate": false}, | ||
| 15 | } | ||
diff --git a/data/schemas/api_keyboard.jsonschema b/data/schemas/api_keyboard.jsonschema new file mode 100644 index 000000000..d570ee999 --- /dev/null +++ b/data/schemas/api_keyboard.jsonschema | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | { | ||
| 2 | "allOf": [ | ||
| 3 | { "$ref": "qmk.keyboard.v1" }, | ||
| 4 | { | ||
| 5 | "$id": "qmk.api.keyboard.v1", | ||
| 6 | "keymaps": { | ||
| 7 | "type": "string" | ||
| 8 | }, | ||
| 9 | "parse_errors": { | ||
| 10 | "type": "array", | ||
| 11 | "items": { | ||
| 12 | "type": "string" | ||
| 13 | } | ||
| 14 | }, | ||
| 15 | "parse_warnings": { | ||
| 16 | "type": "array", | ||
| 17 | "items": { | ||
| 18 | "type": "string" | ||
| 19 | } | ||
| 20 | }, | ||
| 21 | "processor_type": { | ||
| 22 | "type": "string" | ||
| 23 | }, | ||
| 24 | "protocol": { | ||
| 25 | "type": "string" | ||
| 26 | }, | ||
| 27 | "keyboard_folder": { | ||
| 28 | "type": "string" | ||
| 29 | }, | ||
| 30 | "platform": { | ||
| 31 | "type": "string" | ||
| 32 | } | ||
| 33 | } | ||
| 34 | ] | ||
| 35 | } | ||
diff --git a/data/schemas/false.jsonschema b/data/schemas/false.jsonschema new file mode 100644 index 000000000..c508d5366 --- /dev/null +++ b/data/schemas/false.jsonschema | |||
| @@ -0,0 +1 @@ | |||
| false | |||
diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema new file mode 100644 index 000000000..967b5f990 --- /dev/null +++ b/data/schemas/keyboard.jsonschema | |||
| @@ -0,0 +1,296 @@ | |||
| 1 | { | ||
| 2 | "$schema": "http://json-schema.org/schema#", | ||
| 3 | "$id": "qmk.keyboard.v1", | ||
| 4 | "title": "Keyboard Information", | ||
| 5 | "type": "object", | ||
| 6 | "properties": { | ||
| 7 | "keyboard_name": { | ||
| 8 | "type": "string", | ||
| 9 | "minLength": 2, | ||
| 10 | "maxLength": 250 | ||
| 11 | }, | ||
| 12 | "maintainer": { | ||
| 13 | "type": "string", | ||
| 14 | "minLength": 2, | ||
| 15 | "maxLength": 250 | ||
| 16 | }, | ||
| 17 | "manufacturer": { | ||
| 18 | "type": "string", | ||
| 19 | "minLength": 2, | ||
| 20 | "maxLength": 250 | ||
| 21 | }, | ||
| 22 | "url": { | ||
| 23 | "type": "string", | ||
| 24 | "format": "uri" | ||
| 25 | }, | ||
| 26 | "processor": { | ||
| 27 | "type": "string", | ||
| 28 | "enum": ["cortex-m0", "cortex-m0plus", "cortex-m3", "cortex-m4", "MKL26Z64", "MK20DX128", "MK20DX256", "STM32F042", "STM32F072", "STM32F103", "STM32F303", "STM32F401", "STM32F411", "STM32G431", "STM32G474", "atmega16u2", "atmega32u2", "atmega16u4", "atmega32u4", "at90usb162", "at90usb646", "at90usb647", "at90usb1286", "at90usb1287", "atmega32a", "atmega328p", "atmega328", "attiny85", "unknown"] | ||
| 29 | }, | ||
| 30 | "board": { | ||
| 31 | "type": "string", | ||
| 32 | "minLength": 2, | ||
| 33 | "pattern": "^[a-zA-Z_][0-9a-zA-Z_]*$" | ||
| 34 | }, | ||
| 35 | "bootloader": { | ||
| 36 | "type": "string", | ||
| 37 | "enum": ["atmel-dfu", "bootloadHID", "caterina", "halfkay", "kiibohd", "lufa-dfu", "lufa-ms", "micronucleus", "qmk-dfu", "stm32-dfu", "stm32duino", "unknown", "USBasp"] | ||
| 38 | }, | ||
| 39 | "diode_direction": { | ||
| 40 | "type": "string", | ||
| 41 | "enum": ["COL2ROW", "ROW2COL"] | ||
| 42 | }, | ||
| 43 | "debounce": { | ||
| 44 | "type": "number", | ||
| 45 | "min": 0, | ||
| 46 | "multipleOf": 1 | ||
| 47 | }, | ||
| 48 | "height": { | ||
| 49 | "type": "number", | ||
| 50 | "min": 0.25 | ||
| 51 | }, | ||
| 52 | "width": { | ||
| 53 | "type": "number", | ||
| 54 | "min": 0.25 | ||
| 55 | }, | ||
| 56 | "community_layouts": { | ||
| 57 | "type": "array", | ||
| 58 | "items": { | ||
| 59 | "type": "string", | ||
| 60 | "minLength": 2, | ||
| 61 | "pattern": "^[0-9a-z_]*$" | ||
| 62 | } | ||
| 63 | }, | ||
| 64 | "features": { | ||
| 65 | "type": "object", | ||
| 66 | "additionalProperties": {"type": "boolean"} | ||
| 67 | }, | ||
| 68 | "indicators": { | ||
| 69 | "type": "object", | ||
| 70 | "properties": { | ||
| 71 | "caps_lock": { | ||
| 72 | "type": "string", | ||
| 73 | "pattern": "^[A-K]\\d{1,2}$" | ||
| 74 | }, | ||
| 75 | "num_lock": { | ||
| 76 | "type": "string", | ||
| 77 | "pattern": "^[A-K]\\d{1,2}$" | ||
| 78 | }, | ||
| 79 | "scroll_lock": { | ||
| 80 | "type": "string", | ||
| 81 | "pattern": "^[A-K]\\d{1,2}$" | ||
| 82 | } | ||
| 83 | } | ||
| 84 | }, | ||
| 85 | "layout_aliases": { | ||
| 86 | "type": "object", | ||
| 87 | "additionalProperties": { | ||
| 88 | "type": "string", | ||
| 89 | "pattern": "^LAYOUT_[0-9a-z_]*$" | ||
| 90 | } | ||
| 91 | }, | ||
| 92 | "layouts": { | ||
| 93 | "type": "object", | ||
| 94 | "additionalProperties": { | ||
| 95 | "type": "object", | ||
| 96 | "additionalProperties": false, | ||
| 97 | "properties": { | ||
| 98 | "filename": { | ||
| 99 | "type": "string" | ||
| 100 | }, | ||
| 101 | "c_macro": { | ||
| 102 | "type": "boolean" | ||
| 103 | }, | ||
| 104 | "key_count": { | ||
| 105 | "type": "number", | ||
| 106 | "min": 0, | ||
| 107 | "multipleOf": 1 | ||
| 108 | }, | ||
| 109 | "layout": { | ||
| 110 | "type": "array", | ||
| 111 | "items": { | ||
| 112 | "type": "object", | ||
| 113 | "additionalProperties": false, | ||
| 114 | "properties": { | ||
| 115 | "label": {"type": "string"}, | ||
| 116 | "matrix": { | ||
| 117 | "type": "array", | ||
| 118 | "minItems": 2, | ||
| 119 | "maxItems": 2, | ||
| 120 | "items": { | ||
| 121 | "type": "number", | ||
| 122 | "min": 0, | ||
| 123 | "multipleOf": 1 | ||
| 124 | } | ||
| 125 | }, | ||
| 126 | "h": { | ||
| 127 | "type": "number", | ||
| 128 | "min": 0.25 | ||
| 129 | }, | ||
| 130 | "r": { | ||
| 131 | "type": "number", | ||
| 132 | "min": 0 | ||
| 133 | }, | ||
| 134 | "rx": { | ||
| 135 | "type": "number", | ||
| 136 | "min": 0 | ||
| 137 | }, | ||
| 138 | "ry": { | ||
| 139 | "type": "number", | ||
| 140 | "min": 0 | ||
| 141 | }, | ||
| 142 | "w": { | ||
| 143 | "type": "number", | ||
| 144 | "min": 0.25 | ||
| 145 | }, | ||
| 146 | "x": { | ||
| 147 | "type": "number", | ||
| 148 | "min": 0 | ||
| 149 | }, | ||
| 150 | "y": { | ||
| 151 | "type": "number", | ||
| 152 | "min": 0 | ||
| 153 | } | ||
| 154 | } | ||
| 155 | } | ||
| 156 | } | ||
| 157 | } | ||
| 158 | } | ||
| 159 | }, | ||
| 160 | "matrix_pins": { | ||
| 161 | "type": "object", | ||
| 162 | "additionalProperties": false, | ||
| 163 | "properties": { | ||
| 164 | "direct": { | ||
| 165 | "type": "array", | ||
| 166 | "items": { | ||
| 167 | "type": "array", | ||
| 168 | "items": { | ||
| 169 | "oneOf": [ | ||
| 170 | { | ||
| 171 | "type": "string", | ||
| 172 | "pattern": "^[A-K]\\d{1,2}$" | ||
| 173 | }, | ||
| 174 | { | ||
| 175 | "type": "number", | ||
| 176 | "multipleOf": 1 | ||
| 177 | }, | ||
| 178 | { | ||
| 179 | "type": "null" | ||
| 180 | } | ||
| 181 | ] | ||
| 182 | } | ||
| 183 | } | ||
| 184 | }, | ||
| 185 | "cols": { | ||
| 186 | "type": "array", | ||
| 187 | "items": { | ||
| 188 | "oneOf": [ | ||
| 189 | { | ||
| 190 | "type": "string", | ||
| 191 | "pattern": "^[A-K]\\d{1,2}$" | ||
| 192 | }, | ||
| 193 | { | ||
| 194 | "type": "number", | ||
| 195 | "multipleOf": 1 | ||
| 196 | }, | ||
| 197 | { | ||
| 198 | "type": "null" | ||
| 199 | } | ||
| 200 | ] | ||
| 201 | } | ||
| 202 | }, | ||
| 203 | "rows": { | ||
| 204 | "type": "array", | ||
| 205 | "items": { | ||
| 206 | "oneOf": [ | ||
| 207 | { | ||
| 208 | "type": "string", | ||
| 209 | "pattern": "^[A-K]\\d{1,2}$" | ||
| 210 | }, | ||
| 211 | { | ||
| 212 | "type": "number", | ||
| 213 | "multipleOf": 1 | ||
| 214 | }, | ||
| 215 | { | ||
| 216 | "type": "null" | ||
| 217 | } | ||
| 218 | ] | ||
| 219 | } | ||
| 220 | } | ||
| 221 | } | ||
| 222 | }, | ||
| 223 | "rgblight": { | ||
| 224 | "type": "object", | ||
| 225 | "additionalProperties": false, | ||
| 226 | "properties": { | ||
| 227 | "animations": { | ||
| 228 | "type": "object", | ||
| 229 | "additionalProperties": { | ||
| 230 | "type": "boolean" | ||
| 231 | } | ||
| 232 | }, | ||
| 233 | "brightness_steps": { | ||
| 234 | "type": "number", | ||
| 235 | "min": 0, | ||
| 236 | "multipleOf": 1 | ||
| 237 | }, | ||
| 238 | "hue_steps": { | ||
| 239 | "type": "number", | ||
| 240 | "min": 0, | ||
| 241 | "multipleOf": 1 | ||
| 242 | }, | ||
| 243 | "led_count": { | ||
| 244 | "type": "number", | ||
| 245 | "min": 0, | ||
| 246 | "multipleOf": 1 | ||
| 247 | }, | ||
| 248 | "max_brightness": { | ||
| 249 | "type": "number", | ||
| 250 | "min": 0, | ||
| 251 | "max": 255, | ||
| 252 | "multipleOf": 1 | ||
| 253 | }, | ||
| 254 | "pin": { | ||
| 255 | "type": "string", | ||
| 256 | "pattern": "^[A-K]\\d{1,2}$" | ||
| 257 | }, | ||
| 258 | "saturation_steps": { | ||
| 259 | "type": "number", | ||
| 260 | "min": 0, | ||
| 261 | "multipleOf": 1 | ||
| 262 | }, | ||
| 263 | "sleep": {"type": "boolean"}, | ||
| 264 | "split": {"type": "boolean"}, | ||
| 265 | "split_count": { | ||
| 266 | "type": "array", | ||
| 267 | "minLength": 2, | ||
| 268 | "maxLength": 2, | ||
| 269 | "items": { | ||
| 270 | "type": "number", | ||
| 271 | "min": 0, | ||
| 272 | "multipleOf": 1 | ||
| 273 | } | ||
| 274 | } | ||
| 275 | } | ||
| 276 | }, | ||
| 277 | "usb": { | ||
| 278 | "type": "object", | ||
| 279 | "additionalProperties": false, | ||
| 280 | "properties": { | ||
| 281 | "device_ver": { | ||
| 282 | "type": "string", | ||
| 283 | "pattern": "^[0-9A-F]x[0-9A-F][0-9A-F][0-9A-F][0-9A-F]" | ||
| 284 | }, | ||
| 285 | "pid": { | ||
| 286 | "type": "string", | ||
| 287 | "pattern": "^[0-9A-F]x[0-9A-F][0-9A-F][0-9A-F][0-9A-F]" | ||
| 288 | }, | ||
| 289 | "vid": { | ||
| 290 | "type": "string", | ||
| 291 | "pattern": "^[0-9A-F]x[0-9A-F][0-9A-F][0-9A-F][0-9A-F]" | ||
| 292 | } | ||
| 293 | } | ||
| 294 | } | ||
| 295 | } | ||
| 296 | } | ||
diff --git a/data/schemas/true.jsonschema b/data/schemas/true.jsonschema new file mode 100644 index 000000000..27ba77dda --- /dev/null +++ b/data/schemas/true.jsonschema | |||
| @@ -0,0 +1 @@ | |||
| true | |||
