diff options
author | Joel Challis <git@zvecr.com> | 2022-06-21 04:15:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-20 20:15:06 -0700 |
commit | 1a400d8644a1f0763c68626863b897cb83c6c939 (patch) | |
tree | 4eb78ed9ca511844edd9881eb88a68320e8bc8c0 /data | |
parent | 4c39bad2e631e019d6f90d528e28961c54eb7fe1 (diff) | |
download | qmk_firmware-1a400d8644a1f0763c68626863b897cb83c6c939.tar.gz qmk_firmware-1a400d8644a1f0763c68626863b897cb83c6c939.zip |
Allow encoder config from info.json (#17295)
Diffstat (limited to 'data')
-rw-r--r-- | data/mappings/info_rules.json | 1 | ||||
-rw-r--r-- | data/schemas/keyboard.jsonschema | 35 |
2 files changed, 36 insertions, 0 deletions
diff --git a/data/mappings/info_rules.json b/data/mappings/info_rules.json index d4eec37ba0..5cdae962a5 100644 --- a/data/mappings/info_rules.json +++ b/data/mappings/info_rules.json @@ -13,6 +13,7 @@ "BOOTLOADER": {"info_key": "bootloader", "warn_duplicate": false}, "BLUETOOTH": {"info_key": "bluetooth.driver"}, "CAPS_WORD_ENABLE": {"info_key": "caps_word.enabled", "value_type": "bool"}, + "ENCODER_ENABLE": {"info_key": "encoder.enabled", "value_type": "bool"}, "FIRMWARE_FORMAT": {"info_key": "build.firmware_format"}, "KEYBOARD_SHARED_EP": {"info_key": "usb.shared_endpoint.keyboard", "value_type": "bool"}, "MOUSE_SHARED_EP": {"info_key": "usb.shared_endpoint.mouse", "value_type": "bool"}, diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index 52a66cc132..8d9fc4754d 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -2,6 +2,26 @@ "$schema": "https://json-schema.org/draft/2020-12/schema#", "$id": "qmk.keyboard.v1", "title": "Keyboard Information", + "definitions": { + "encoder_config": { + "type": "object", + "properties": { + "rotary": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": ["pin_a", "pin_b"], + "properties": { + "pin_a": {"$ref": "qmk.definitions.v1#/mcu_pin"}, + "pin_b": {"$ref": "qmk.definitions.v1#/mcu_pin"}, + "resolution": {"$ref": "qmk.definitions.v1#/unsigned_int"} + } + } + } + } + } + }, "type": "object", "properties": { "keyboard_name": {"$ref": "qmk.definitions.v1#/text_identifier"}, @@ -113,6 +133,12 @@ "type": "array", "items": {"$ref": "qmk.definitions.v1#/filename"} }, + "encoder": { + "$ref": "#/definitions/encoder_config", + "properties": { + "enabled": {"type": "boolean"} + } + }, "features": {"$ref": "qmk.definitions.v1#/boolean_array"}, "indicators": { "type": "object", @@ -363,6 +389,15 @@ } } }, + "encoder": { + "type": "object", + "additionalProperties": false, + "properties": { + "right": { + "$ref": "#/definitions/encoder_config" + } + } + }, "main": { "type": "string", "enum": ["eeprom", "left", "matrix_grid", "pin", "right"] |