From 266a85eda0cbb63852565d0c1d7ddb24700b8c1f Mon Sep 17 00:00:00 2001 From: Zach White Date: Tue, 1 Dec 2020 12:58:00 -0800 Subject: add missing schemas --- data/schemas/keyboard.jsonschema | 232 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 data/schemas/keyboard.jsonschema (limited to 'data/schemas/keyboard.jsonschema') diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema new file mode 100644 index 0000000000..75e792b646 --- /dev/null +++ b/data/schemas/keyboard.jsonschema @@ -0,0 +1,232 @@ +{ + "$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": ["MK20DX128", "MK20DX256", "MKL26Z64", "STM32F042", "STM32F072", "STM32F103", "STM32F303", "STM32F401", "STM32F411", "at90usb1286", "at90usb646", "atmega16u2", "atmega328p", "atmega32a", "atmega32u2", "atmega32u4", "attiny85", "cortex-m4"] + }, + "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": { + "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 + }, + "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": "null" + } + ] + } + } + }, + "cols": { + "type": "array", + "items": { + "type": "string", + "pattern": "^[A-K]\\d{1,2}$" + } + }, + "rows": { + "type": "array", + "items": { + "type": "string", + "pattern": "^[A-K]\\d{1,2}$" + } + } + } + }, + "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 + }, + "pin": { + "type": "string", + "pattern": "^[A-K]\\d{1,2}$" + }, + "saturation_steps": { + "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]" + } + } + } + } +} -- cgit v1.2.1 From b2c26f7cdd4b268e80f98cae7f444956559436ec Mon Sep 17 00:00:00 2001 From: Zach White Date: Tue, 1 Dec 2020 16:04:22 -0800 Subject: get qmk generate-api into a good state --- data/schemas/keyboard.jsonschema | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'data/schemas/keyboard.jsonschema') diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index 75e792b646..9355ee49bd 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -90,6 +90,9 @@ "type": "object", "additionalProperties": false, "properties": { + "filename": { + "type": "string" + }, "c_macro": { "type": "boolean" }, @@ -119,6 +122,18 @@ "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 @@ -199,6 +214,12 @@ "min": 0, "multipleOf": 1 }, + "max_brightness": { + "type": "number", + "min": 0, + "max": 255, + "multipleOf": 1 + }, "pin": { "type": "string", "pattern": "^[A-K]\\d{1,2}$" @@ -207,6 +228,18 @@ "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 + } } } }, -- cgit v1.2.1 From ed19198c7891735a5ba3f118f25c608f968f746f Mon Sep 17 00:00:00 2001 From: Zach White Date: Wed, 6 Jan 2021 10:33:30 -0800 Subject: loosen up the schema to allow any pin format --- data/schemas/keyboard.jsonschema | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'data/schemas/keyboard.jsonschema') diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index 9355ee49bd..f250ffd8a9 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -163,8 +163,7 @@ "items": { "oneOf": [ { - "type": "string", - "pattern": "^[A-K]\\d{1,2}$" + "type": "string" }, { "type": "null" @@ -176,15 +175,13 @@ "cols": { "type": "array", "items": { - "type": "string", - "pattern": "^[A-K]\\d{1,2}$" + "type": "string" } }, "rows": { "type": "array", "items": { - "type": "string", - "pattern": "^[A-K]\\d{1,2}$" + "type": "string" } } } -- cgit v1.2.1 From 82007aa03a93ba77e54f4660c80ef3749630de0c Mon Sep 17 00:00:00 2001 From: Zach White Date: Wed, 6 Jan 2021 10:37:53 -0800 Subject: Revert "loosen up the schema to allow any pin format" This reverts commit e41762be64c170f42ab3f8aa6b7e3078e5895e92. --- data/schemas/keyboard.jsonschema | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'data/schemas/keyboard.jsonschema') diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index f250ffd8a9..9355ee49bd 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -163,7 +163,8 @@ "items": { "oneOf": [ { - "type": "string" + "type": "string", + "pattern": "^[A-K]\\d{1,2}$" }, { "type": "null" @@ -175,13 +176,15 @@ "cols": { "type": "array", "items": { - "type": "string" + "type": "string", + "pattern": "^[A-K]\\d{1,2}$" } }, "rows": { "type": "array", "items": { - "type": "string" + "type": "string", + "pattern": "^[A-K]\\d{1,2}$" } } } -- cgit v1.2.1 From 30331b383f9ef4620e47aa07e4f9af7fae9d30b3 Mon Sep 17 00:00:00 2001 From: Zach White Date: Fri, 8 Jan 2021 00:00:15 -0800 Subject: fix bugs triggered by certain boards --- data/schemas/keyboard.jsonschema | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'data/schemas/keyboard.jsonschema') diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index 9355ee49bd..e13771e92a 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -166,6 +166,10 @@ "type": "string", "pattern": "^[A-K]\\d{1,2}$" }, + { + "type": "number", + "multipleOf": 1 + }, { "type": "null" } @@ -176,15 +180,37 @@ "cols": { "type": "array", "items": { - "type": "string", - "pattern": "^[A-K]\\d{1,2}$" + "oneOf": [ + { + "type": "string", + "pattern": "^[A-K]\\d{1,2}$" + }, + { + "type": "number", + "multipleOf": 1 + }, + { + "type": "null" + } + ] } }, "rows": { "type": "array", "items": { - "type": "string", - "pattern": "^[A-K]\\d{1,2}$" + "oneOf": [ + { + "type": "string", + "pattern": "^[A-K]\\d{1,2}$" + }, + { + "type": "number", + "multipleOf": 1 + }, + { + "type": "null" + } + ] } } } -- cgit v1.2.1 From 962bc8d9dd413690dbeadeaac971a5389697210f Mon Sep 17 00:00:00 2001 From: Zach White Date: Sat, 9 Jan 2021 13:34:14 -0800 Subject: Use the schema to eliminate custom code (#11108) * use the schema to eliminate custom code * Update docs/reference_info_json.md Co-authored-by: Ryan * make flake8 happy * bugfix * do not overwrite make vars from json Co-authored-by: Ryan --- data/schemas/keyboard.jsonschema | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'data/schemas/keyboard.jsonschema') diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index e13771e92a..f76c7fd189 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -25,7 +25,7 @@ }, "processor": { "type": "string", - "enum": ["MK20DX128", "MK20DX256", "MKL26Z64", "STM32F042", "STM32F072", "STM32F103", "STM32F303", "STM32F401", "STM32F411", "at90usb1286", "at90usb646", "atmega16u2", "atmega328p", "atmega32a", "atmega32u2", "atmega32u4", "attiny85", "cortex-m4"] + "enum": ["MK20DX128", "MK20DX256", "MKL26Z64", "STM32F042", "STM32F072", "STM32F103", "STM32F303", "STM32F401", "STM32F411", "at90usb1286", "at90usb646", "atmega16u2", "atmega328p", "atmega32a", "atmega32u2", "atmega32u4", "attiny85", "cortex-m4", "unknown"] }, "bootloader": { "type": "string", -- cgit v1.2.1 From eaa9106ec74591593e638ac015a5c90d17b30612 Mon Sep 17 00:00:00 2001 From: Zach White Date: Sat, 9 Jan 2021 20:18:47 -0800 Subject: Add support for specifying BOARD in info.json (#11492) * add support for specifying BOARD in info.json * move BOARD from rules.mk to info.json for clueboard * fix keyboards that do not require board * remove out of compliance values --- data/schemas/keyboard.jsonschema | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'data/schemas/keyboard.jsonschema') diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index f76c7fd189..0b3d6f393d 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -27,6 +27,11 @@ "type": "string", "enum": ["MK20DX128", "MK20DX256", "MKL26Z64", "STM32F042", "STM32F072", "STM32F103", "STM32F303", "STM32F401", "STM32F411", "at90usb1286", "at90usb646", "atmega16u2", "atmega328p", "atmega32a", "atmega32u2", "atmega32u4", "attiny85", "cortex-m4", "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"] -- cgit v1.2.1 From 625f29368b7408db4375b412064dafa4dfa4bb35 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Mon, 25 Jan 2021 22:00:47 +1100 Subject: Update list of MCUs in keyboard.jsonschema to mirror qmk.constants.py (#11688) --- data/schemas/keyboard.jsonschema | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'data/schemas/keyboard.jsonschema') diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index 0b3d6f393d..3dba21bc0f 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -25,7 +25,7 @@ }, "processor": { "type": "string", - "enum": ["MK20DX128", "MK20DX256", "MKL26Z64", "STM32F042", "STM32F072", "STM32F103", "STM32F303", "STM32F401", "STM32F411", "at90usb1286", "at90usb646", "atmega16u2", "atmega328p", "atmega32a", "atmega32u2", "atmega32u4", "attiny85", "cortex-m4", "unknown"] + "enum": ["cortex-m0", "cortex-m0plus", "cortex-m3", "cortex-m4", "MKL26Z64", "MK20DX128", "MK20DX256", "STM32F042", "STM32F072", "STM32F103", "STM32F303", "STM32F401", "STM32F411", "atmega16u2", "atmega32u2", "atmega16u4", "atmega32u4", "at90usb646", "at90usb647", "at90usb1286", "at90usb1287", "atmega32a", "atmega328p", "atmega328", "attiny85", "unknown"] }, "board": { "type": "string", -- cgit v1.2.1 From d92ffd1157e3ecc4ae2dbf8548c45c8b0269f664 Mon Sep 17 00:00:00 2001 From: Dasky <32983009+daskygit@users.noreply.github.com> Date: Sat, 30 Jan 2021 03:53:56 +0000 Subject: Adds AT90USB162 support (#11570) * at90usb162 support * fix missing bracket * Apply suggestions from code review Co-authored-by: Ryan Co-authored-by: Ryan --- data/schemas/keyboard.jsonschema | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'data/schemas/keyboard.jsonschema') diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index 3dba21bc0f..8f1c0a9157 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -25,7 +25,7 @@ }, "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", "at90usb646", "at90usb647", "at90usb1286", "at90usb1287", "atmega32a", "atmega328p", "atmega328", "attiny85", "unknown"] + "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", -- cgit v1.2.1 From 620a946d01477b64ee2f719141aa35400c0188c6 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Sat, 6 Feb 2021 11:27:46 +1100 Subject: Add STM32G431 and STM32G474 board definitions. (#11793) * Add STM32G431 and STM32G474 board definitions. * Add docs. --- data/schemas/keyboard.jsonschema | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'data/schemas/keyboard.jsonschema') diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index 8f1c0a9157..967b5f9904 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -25,7 +25,7 @@ }, "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"] + "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"] }, "board": { "type": "string", -- cgit v1.2.1 From 1581ea48dcd48d0d3f42cc09b388c468aedec45d Mon Sep 17 00:00:00 2001 From: Zach White Date: Sat, 27 Feb 2021 12:00:50 -0800 Subject: Fix develop (#12039) Fixes file encoding errors on Windows, and layouts not correctly merging into info.json. * force utf8 encoding * correctly merge layouts and layout aliases * show what aliases point to --- data/schemas/keyboard.jsonschema | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'data/schemas/keyboard.jsonschema') diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index 967b5f9904..f5fb611bd2 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -85,8 +85,16 @@ "layout_aliases": { "type": "object", "additionalProperties": { - "type": "string", - "pattern": "^LAYOUT_[0-9a-z_]*$" + "oneOf": [ + { + "type": "string", + "enum": ["LAYOUT"] + }, + { + "type": "string", + "pattern": "^LAYOUT_[0-9a-z_]*$" + } + ] } }, "layouts": { -- cgit v1.2.1