Skip to content

Commit

Permalink
Add audio driver to keyboard.json schema (qmk#23616)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr authored and Ardakilic committed Sep 10, 2024
1 parent 2212eb3 commit 3503e67
Show file tree
Hide file tree
Showing 39 changed files with 59 additions and 22 deletions.
1 change: 1 addition & 0 deletions data/mappings/info_rules.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// invalid: Default `false`. Set to `true` to generate errors when a value exists
// replace_with: use with a key marked deprecated or invalid to designate a replacement

"AUDIO_DRIVER": {"info_key": "audio.driver"},
"BACKLIGHT_DRIVER": {"info_key": "backlight.driver"},
"BLUETOOTH_DRIVER": {"info_key": "bluetooth.driver"},
"BOARD": {"info_key": "board"},
Expand Down
4 changes: 4 additions & 0 deletions data/schemas/keyboard.jsonschema
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@
"clicky": {"type": "boolean"}
}
},
"driver": {
"type": "string",
"enum": ["dac_additive", "dac_basic", "pwm_software", "pwm_hardware"]
},
"macro_beep": {"type": "boolean"},
"pins": {"$ref": "qmk.definitions.v1#/mcu_pin_array"},
"power_control": {
Expand Down
2 changes: 2 additions & 0 deletions docs/reference_info_json.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ Configures the [Audio](feature_audio.md) feature.
* `clicky`
* The default audio clicky enabled state.
* Default: `true`
* `driver`
* The driver to use. Must be one of `dac_additive`, `dac_basic`, `pwm_software`, `pwm_hardware`.
* `macro_beep`
* Play a short beep for `\a` (ASCII `BEL`) characters in Send String macros.
* Default: `false`
Expand Down
1 change: 1 addition & 0 deletions keyboards/adafruit/macropad/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"oled": true
},
"audio": {
"driver": "pwm_hardware",
"power_control": {
"pin": "GP14"
}
Expand Down
1 change: 0 additions & 1 deletion keyboards/adafruit/macropad/rules.mk
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
AUDIO_DRIVER = pwm_hardware
OLED_TRANSPORT = spi
3 changes: 3 additions & 0 deletions keyboards/arrowmechanics/wings/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
"mousekey": true,
"rgb_matrix": true
},
"audio": {
"driver": "pwm_hardware"
},
"matrix_pins": {
"cols": ["GP8", "GP9", "GP10", "GP11", "GP12", "GP13", "GP14", "GP15", "GP16"],
"rows": ["GP22", "GP21", "GP20", "GP19", "GP18", "GP17"]
Expand Down
1 change: 0 additions & 1 deletion keyboards/arrowmechanics/wings/rules.mk
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
SERIAL_DRIVER = vendor
AUDIO_DRIVER = pwm_hardware
3 changes: 3 additions & 0 deletions keyboards/boardsource/equals/48/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"cols": ["GP0", "GP1", "GP2", "GP3", "GP4", "GP5", "GP6", "GP7", "GP8", "GP9", "GP10", "GP11"],
"rows": ["GP12", "GP13", "GP16", "GP17"]
},
"audio": {
"driver": "pwm_hardware"
},
"ws2812": {
"driver": "vendor",
"pin": "GP21"
Expand Down
1 change: 0 additions & 1 deletion keyboards/boardsource/equals/48/rules.mk
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
AUDIO_DRIVER = pwm_hardware
QUANTUM_PAINTER_DRIVERS += st7735_spi
3 changes: 3 additions & 0 deletions keyboards/boardsource/equals/60/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"cols": ["GP0", "GP1", "GP2", "GP3", "GP4", "GP5", "GP6", "GP7", "GP8", "GP9", "GP10", "GP11"],
"rows": ["GP12", "GP13", "GP16", "GP17", "GP18"]
},
"audio": {
"driver": "pwm_hardware"
},
"ws2812": {
"driver": "vendor",
"pin": "GP21"
Expand Down
1 change: 0 additions & 1 deletion keyboards/boardsource/equals/60/rules.mk
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
AUDIO_DRIVER = pwm_hardware
QUANTUM_PAINTER_DRIVERS += st7735_spi
3 changes: 3 additions & 0 deletions keyboards/boardsource/unicorne/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
"pid": "0x7563",
"vid": "0x4273"
},
"audio": {
"driver": "pwm_hardware"
},
"ws2812": {
"driver": "vendor",
"pin": "GP29"
Expand Down
1 change: 0 additions & 1 deletion keyboards/boardsource/unicorne/rules.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
SERIAL_DRIVER = vendor
AUDIO_DRIVER = pwm_hardware
POINTING_DEVICE_DRIVER = analog_joystick
3 changes: 3 additions & 0 deletions keyboards/custommk/cmk11/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
"nkro": true,
"rgb_matrix": true
},
"audio": {
"driver": "pwm_hardware"
},
"matrix_pins": {
"cols": ["B0", "A1", "A2", "A3", "A6", "B10"],
"rows": ["A5", "A4"]
Expand Down
1 change: 0 additions & 1 deletion keyboards/custommk/cmk11/rules.mk

This file was deleted.

3 changes: 3 additions & 0 deletions keyboards/custommk/ergostrafer/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
"encoder": true,
"audio": true
},
"audio": {
"driver": "pwm_hardware"
},
"matrix_pins": {
"cols": ["B0", "A1", "A2", "A3", "A6", "B6", "B10"],
"rows": ["C13", "C14", "C15", "B1", "A7", "A5"]
Expand Down
1 change: 0 additions & 1 deletion keyboards/custommk/ergostrafer/rules.mk

This file was deleted.

3 changes: 3 additions & 0 deletions keyboards/custommk/evo70_r2/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
"twinkle": true
}
},
"audio": {
"driver": "pwm_hardware"
},
"ws2812": {
"driver": "pwm",
"pin": "A10"
Expand Down
2 changes: 0 additions & 2 deletions keyboards/custommk/evo70_r2/rules.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
AUDIO_DRIVER = pwm_hardware

# project specific files
SRC += matrix.c

Expand Down
3 changes: 3 additions & 0 deletions keyboards/handwired/macroboard/f411/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"rows": ["A15", "B3", "B4", "B5", "B7"]
},
"diode_direction": "COL2ROW",
"audio": {
"driver": "pwm_hardware"
},
"ws2812": {
"driver": "pwm"
},
Expand Down
1 change: 0 additions & 1 deletion keyboards/handwired/macroboard/f411/rules.mk

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"led_count": 20,
"split_count": [10, 10]
},
"audio": {
"driver": "dac_additive"
},
"ws2812": {
"pin": "A6",
"driver": "pwm"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# KEYBOARD_SHARED_EP = yes

SERIAL_DRIVER = usart
AUDIO_DRIVER = dac_additive
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
"build": {
"debounce_type": "asym_eager_defer_pk"
},
"audio": {
"driver": "pwm_hardware"
},
"ws2812": {
"pin": "A1",
"driver": "pwm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ KEYBOARD_SHARED_EP = yes
MOUSE_SHARED_EP = yes

SERIAL_DRIVER = usart
AUDIO_DRIVER = pwm_hardware
3 changes: 3 additions & 0 deletions keyboards/nack/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
"rgb_matrix": true,
"unicode": true
},
"audio": {
"driver": "dac_basic"
},
"ws2812": {
"pin": "B5",
"driver": "spi"
Expand Down
1 change: 0 additions & 1 deletion keyboards/nack/rules.mk

This file was deleted.

3 changes: 3 additions & 0 deletions keyboards/planck/ez/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@
"rows": ["A10", "A9", "A8", "B15", "C13", "C14", "C15", "A2"]
},
"diode_direction": "COL2ROW",
"audio": {
"driver": "dac_additive"
},
"encoder": {
"rotary": [
{"pin_a": "B12", "pin_b": "B13"}
Expand Down
2 changes: 0 additions & 2 deletions keyboards/planck/ez/rules.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
AUDIO_DRIVER = dac_additive

RGBLIGHT_SUPPORTED = no
BAKCLIGHT_SUPPORTED = no

Expand Down
3 changes: 3 additions & 0 deletions keyboards/quokka/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"oled": true,
"rgb_matrix": true
},
"audio": {
"driver": "pwm_hardware"
},
"matrix_pins": {
"cols": ["GP8", "GP7", "GP6", "GP5", "GP4"],
"rows": ["GP10", "GP19", "GP20", "GP18"]
Expand Down
1 change: 0 additions & 1 deletion keyboards/quokka/rules.mk
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
AUDIO_DRIVER = pwm_hardware
SERIAL_DRIVER = vendor
3 changes: 3 additions & 0 deletions keyboards/rgbkb/sol3/rev1/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
"twinkle": true
}
},
"audio": {
"driver": "dac_additive"
},
"ws2812": {
"pin": "B5",
"driver": "pwm"
Expand Down
1 change: 0 additions & 1 deletion keyboards/rgbkb/sol3/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = yes # Enable N-Key Rollover
AUDIO_ENABLE = yes # Audio output
AUDIO_DRIVER = dac_additive

DYNAMIC_MACRO_ENABLE = yes
DIP_SWITCH_ENABLE = yes
Expand Down
3 changes: 3 additions & 0 deletions keyboards/tzarc/djinn/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
"rows": ["B13", "B14", "B15", "C6", "C7", "C8"],
"cols": ["C0", "C1", "C2", "C3", "A0", "A1", "A2"]
},
"audio": {
"driver": "pwm_software"
},
"backlight": {
"pin": "A7",
"levels": 4
Expand Down
2 changes: 0 additions & 2 deletions keyboards/tzarc/djinn/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ SERIAL_DRIVER = usart

CIE1931_CURVE = yes

AUDIO_DRIVER = pwm_software

QUANTUM_PAINTER_DRIVERS = ili9341_spi

SRC += \
Expand Down
3 changes: 3 additions & 0 deletions keyboards/yanghu/unicorne/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
"oled": true,
"rgblight": true
},
"audio": {
"driver": "pwm_hardware"
},
"rgblight": {
"led_count": 8,
"animations": {
Expand Down
2 changes: 0 additions & 2 deletions keyboards/yanghu/unicorne/rules.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
AUDIO_DRIVER = pwm_hardware

DEFAULT_FOLDER = yanghu/unicorne/f411
3 changes: 3 additions & 0 deletions keyboards/zsa/moonlander/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"rgb_matrix": true,
"swap_hands": true
},
"audio": {
"driver": "dac_additive"
},
"dynamic_keymap": {
"layer_count": 8
},
Expand Down
1 change: 0 additions & 1 deletion keyboards/zsa/moonlander/rules.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
AUDIO_DRIVER = dac_additive
CUSTOM_MATRIX = lite

# project specific files
Expand Down

0 comments on commit 3503e67

Please sign in to comment.