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 0000000000..885e6d0256 --- /dev/null +++ b/data/mappings/info_config.json @@ -0,0 +1,42 @@ +# This file maps keys between `config.h` and `info.json`. It is used by QMK +# to correctly and consistently map back and forth between the two systems. +{ + # Format: + # <config.h key>: {"info_key": <info.json key>, ["value_type": <value_type>], ["to_json": <true/false>], ["to_c": <true/false>]} + # value_type: one of "array", "array.int", "int", "hex", "list", "mapping" + # to_json: Default `true`. Set to `false` to exclude this mapping from info.json + # to_c: Default `true`. Set to `false` to exclude this mapping from config.h + # warn_duplicate: Default `true`. Set to `false` to turn off warning when a value exists in both places + "DEBOUNCE": {"info_key": "debounce", "value_type": "int"} + "DEVICE_VER": {"info_key": "usb.device_ver", "value_type": "hex"}, + "DESCRIPTION": {"info_key": "keyboard_folder", "to_json": false}, + "DIODE_DIRECTION": {"info_key": "diode_direction"}, + "LAYOUTS": {"info_key": "layout_aliases", "value_type": "mapping"}, + "LED_CAPS_LOCK_PIN": {"info_key": "indicators.caps_lock"}, + "LED_NUM_LOCK_PIN": {"info_key": "indicators.num_lock"}, + "LED_SCROLL_LOCK_PIN": {"info_key": "indicators.scroll_lock"}, + "MANUFACTURER": {"info_key": "manufacturer"}, + "RGB_DI_PIN": {"info_key": "rgblight.pin"}, + "RGBLED_NUM": {"info_key": "rgblight.led_count", "value_type": "int"}, + "RGBLED_SPLIT": {"info_key": "rgblight.split_count", "value_type": "array.int"}, + "RGBLIGHT_ANIMATIONS": {"info_key": "rgblight.animations.all", "value_type": "bool"}, + "RGBLIGHT_EFFECT_ALTERNATING": {"info_key": "rgblight.animations.alternating", "value_type": "bool"}, + "RGBLIGHT_EFFECT_BREATHING": {"info_key": "rgblight.animations.breathing", "value_type": "bool"}, + "RGBLIGHT_EFFECT_CHRISTMAS": {"info_key": "rgblight.animations.christmas", "value_type": "bool"}, + "RGBLIGHT_EFFECT_KNIGHT": {"info_key": "rgblight.animations.knight", "value_type": "bool"}, + "RGBLIGHT_EFFECT_RAINBOW_MOOD": {"info_key": "rgblight.animations.rainbow_mood", "value_type": "bool"}, + "RGBLIGHT_EFFECT_RAINBOW_SWIRL": {"info_key": "rgblight.animations.rainbow_swirl", "value_type": "bool"}, + "RGBLIGHT_EFFECT_RGB_TEST": {"info_key": "rgblight.animations.rgb_test", "value_type": "bool"}, + "RGBLIGHT_EFFECT_SNAKE": {"info_key": "rgblight.animations.snake", "value_type": "bool"}, + "RGBLIGHT_EFFECT_STATIC_GRADIENT": {"info_key": "rgblight.animations.static_gradient", "value_type": "bool"}, + "RGBLIGHT_EFFECT_TWINKLE": {"info_key": "rgblight.animations.twinkle"}, + "RGBLIGHT_LIMIT_VAL": {"info_key": "rgblight.max_brightness", "value_type": "int"}, + "RGBLIGHT_HUE_STEP": {"info_key": "rgblight.hue_steps", "value_type": "int"}, + "RGBLIGHT_SAT_STEP": {"info_key": "rgblight.saturation_steps", "value_type": "int"}, + "RGBLIGHT_VAL_STEP": {"info_key": "rgblight.brightness_steps", "value_type": "int"}, + "RGBLIGHT_SLEEP": {"info_key": "rgblight.sleep", "value_type": "bool"}, + "RGBLIGHT_SPLIT": {"info_key": "rgblight.split", "value_type": "bool"}, + "PRODUCT": {"info_key": "keyboard_folder", "to_json": false}, + "PRODUCT_ID": {"info_key": "usb.pid", "value_type": "hex"}, + "VENDOR_ID": {"info_key": "usb.vid", "value_type": "hex"} +} diff --git a/data/mappings/info_rules.json b/data/mappings/info_rules.json new file mode 100644 index 0000000000..97f772c4d5 --- /dev/null +++ b/data/mappings/info_rules.json @@ -0,0 +1,15 @@ +# This file maps keys between `rules.mk` and `info.json`. It is used by QMK +# to correctly and consistently map back and forth between the two systems. +{ + # Format: + # <rules.mk key>: {"info_key": <info.json key>, ["value_type": <value_type>], ["to_json": <true/false>], ["to_c": <true/false>]} + # value_type: one of "array", "array.int", "int", "list", "hex", "mapping" + # to_json: Default `true`. Set to `false` to exclude this mapping from info.json + # to_c: Default `true`. Set to `false` to exclude this mapping from rules.mk + # warn_duplicate: Default `true`. Set to `false` to turn off warning when a value exists in both places + "BOARD": {"info_key": "board"}, + "BOOTLOADER": {"info_key": "bootloader", "warn_duplicate": false}, + "LAYOUTS": {"info_key": "community_layouts", "value_type": "list"}, + "LED_MATRIX_DRIVER": {"info_key": "led_matrix.driver"}, + "MCU": {"info_key": "processor", "warn_duplicate": false}, +} diff --git a/data/schemas/api_keyboard.jsonschema b/data/schemas/api_keyboard.jsonschema new file mode 100644 index 0000000000..d570ee9990 --- /dev/null +++ b/data/schemas/api_keyboard.jsonschema @@ -0,0 +1,35 @@ +{ + "allOf": [ + { "$ref": "qmk.keyboard.v1" }, + { + "$id": "qmk.api.keyboard.v1", + "keymaps": { + "type": "string" + }, + "parse_errors": { + "type": "array", + "items": { + "type": "string" + } + }, + "parse_warnings": { + "type": "array", + "items": { + "type": "string" + } + }, + "processor_type": { + "type": "string" + }, + "protocol": { + "type": "string" + }, + "keyboard_folder": { + "type": "string" + }, + "platform": { + "type": "string" + } + } + ] +} diff --git a/data/schemas/false.jsonschema b/data/schemas/false.jsonschema new file mode 100644 index 0000000000..c508d5366f --- /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 0000000000..8f1c0a9157 --- /dev/null +++ b/data/schemas/keyboard.jsonschema @@ -0,0 +1,296 @@ +{ + "$schema": "http://json-schema.org/schema#", + "$id": "qmk.keyboard.v1", + "title": "Keyboard Information", + "type": "object", + "properties": { + "keyboard_name": { + "type": "string", + "minLength": 2, + "maxLength": 250 + }, + "maintainer": { + "type": "string", + "minLength": 2, + "maxLength": 250 + }, + "manufacturer": { + "type": "string", + "minLength": 2, + "maxLength": 250 + }, + "url": { + "type": "string", + "format": "uri" + }, + "processor": { + "type": "string", + "enum": ["cortex-m0", "cortex-m0plus", "cortex-m3", "cortex-m4", "MKL26Z64", "MK20DX128", "MK20DX256", "STM32F042", "STM32F072", "STM32F103", "STM32F303", "STM32F401", "STM32F411", "atmega16u2", "atmega32u2", "atmega16u4", "atmega32u4", "at90usb162", "at90usb646", "at90usb647", "at90usb1286", "at90usb1287", "atmega32a", "atmega328p", "atmega328", "attiny85", "unknown"] + }, + "board": { + "type": "string", + "minLength": 2, + "pattern": "^[a-zA-Z_][0-9a-zA-Z_]*$" + }, + "bootloader": { + "type": "string", + "enum": ["atmel-dfu", "bootloadHID", "caterina", "halfkay", "kiibohd", "lufa-dfu", "lufa-ms", "micronucleus", "qmk-dfu", "stm32-dfu", "stm32duino", "unknown", "USBasp"] + }, + "diode_direction": { + "type": "string", + "enum": ["COL2ROW", "ROW2COL"] + }, + "debounce": { + "type": "number", + "min": 0, + "multipleOf": 1 + }, + "height": { + "type": "number", + "min": 0.25 + }, + "width": { + "type": "number", + "min": 0.25 + }, + "community_layouts": { + "type": "array", + "items": { + "type": "string", + "minLength": 2, + "pattern": "^[0-9a-z_]*$" + } + }, + "features": { + "type": "object", + "additionalProperties": {"type": "boolean"} + }, + "indicators": { + "type": "object", + "properties": { + "caps_lock": { + "type": "string", + "pattern": "^[A-K]\\d{1,2}$" + }, + "num_lock": { + "type": "string", + "pattern": "^[A-K]\\d{1,2}$" + }, + "scroll_lock": { + "type": "string", + "pattern": "^[A-K]\\d{1,2}$" + } + } + }, + "layout_aliases": { + "type": "object", + "additionalProperties": { + "type": "string", + "pattern": "^LAYOUT_[0-9a-z_]*$" + } + }, + "layouts": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": false, + "properties": { + "filename": { + "type": "string" + }, + "c_macro": { + "type": "boolean" + }, + "key_count": { + "type": "number", + "min": 0, + "multipleOf": 1 + }, + "layout": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "label": {"type": "string"}, + "matrix": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": { + "type": "number", + "min": 0, + "multipleOf": 1 + } + }, + "h": { + "type": "number", + "min": 0.25 + }, + "r": { + "type": "number", + "min": 0 + }, + "rx": { + "type": "number", + "min": 0 + }, + "ry": { + "type": "number", + "min": 0 + }, + "w": { + "type": "number", + "min": 0.25 + }, + "x": { + "type": "number", + "min": 0 + }, + "y": { + "type": "number", + "min": 0 + } + } + } + } + } + } + }, + "matrix_pins": { + "type": "object", + "additionalProperties": false, + "properties": { + "direct": { + "type": "array", + "items": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string", + "pattern": "^[A-K]\\d{1,2}$" + }, + { + "type": "number", + "multipleOf": 1 + }, + { + "type": "null" + } + ] + } + } + }, + "cols": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string", + "pattern": "^[A-K]\\d{1,2}$" + }, + { + "type": "number", + "multipleOf": 1 + }, + { + "type": "null" + } + ] + } + }, + "rows": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string", + "pattern": "^[A-K]\\d{1,2}$" + }, + { + "type": "number", + "multipleOf": 1 + }, + { + "type": "null" + } + ] + } + } + } + }, + "rgblight": { + "type": "object", + "additionalProperties": false, + "properties": { + "animations": { + "type": "object", + "additionalProperties": { + "type": "boolean" + } + }, + "brightness_steps": { + "type": "number", + "min": 0, + "multipleOf": 1 + }, + "hue_steps": { + "type": "number", + "min": 0, + "multipleOf": 1 + }, + "led_count": { + "type": "number", + "min": 0, + "multipleOf": 1 + }, + "max_brightness": { + "type": "number", + "min": 0, + "max": 255, + "multipleOf": 1 + }, + "pin": { + "type": "string", + "pattern": "^[A-K]\\d{1,2}$" + }, + "saturation_steps": { + "type": "number", + "min": 0, + "multipleOf": 1 + }, + "sleep": {"type": "boolean"}, + "split": {"type": "boolean"}, + "split_count": { + "type": "array", + "minLength": 2, + "maxLength": 2, + "items": { + "type": "number", + "min": 0, + "multipleOf": 1 + } + } + } + }, + "usb": { + "type": "object", + "additionalProperties": false, + "properties": { + "device_ver": { + "type": "string", + "pattern": "^[0-9A-F]x[0-9A-F][0-9A-F][0-9A-F][0-9A-F]" + }, + "pid": { + "type": "string", + "pattern": "^[0-9A-F]x[0-9A-F][0-9A-F][0-9A-F][0-9A-F]" + }, + "vid": { + "type": "string", + "pattern": "^[0-9A-F]x[0-9A-F][0-9A-F][0-9A-F][0-9A-F]" + } + } + } + } +} diff --git a/data/schemas/true.jsonschema b/data/schemas/true.jsonschema new file mode 100644 index 0000000000..27ba77ddaf --- /dev/null +++ b/data/schemas/true.jsonschema @@ -0,0 +1 @@ +true |