c80e5f9f8868ccaa8cb990be6f4da3f1011c2b78
- Author
- Drashna Jaelre <drashna@live.com>
- Committer
- GitHub <noreply@github.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/common_features.mk b/common_features.mk
2index 8338ce4080225a00d170b1f1a3dd91b9290d2ccf..6463efb8ba412c8ab893032b837e565762db8ea6 100644
3--- a/common_features.mk
4+++ b/common_features.mk
5@@ -42,12 +42,31 @@ ifeq ($(strip $(COMMAND_ENABLE)), yes)
6 OPT_DEFS += -DCOMMAND_ENABLE
7 endif
8
9+AUDIO_ENABLE ?= no
10 ifeq ($(strip $(AUDIO_ENABLE)), yes)
11+ ifeq ($(PLATFORM),CHIBIOS)
12+ AUDIO_DRIVER ?= dac_basic
13+ ifeq ($(strip $(AUDIO_DRIVER)), dac_basic)
14+ OPT_DEFS += -DAUDIO_DRIVER_DAC
15+ else ifeq ($(strip $(AUDIO_DRIVER)), dac_additive)
16+ OPT_DEFS += -DAUDIO_DRIVER_DAC
17+ ## stm32f2 and above have a usable DAC unit, f1 do not, and need to use pwm instead
18+ else ifeq ($(strip $(AUDIO_DRIVER)), pwm_software)
19+ OPT_DEFS += -DAUDIO_DRIVER_PWM
20+ else ifeq ($(strip $(AUDIO_DRIVER)), pwm_hardware)
21+ OPT_DEFS += -DAUDIO_DRIVER_PWM
22+ endif
23+ else
24+ # fallback for all other platforms is pwm
25+ AUDIO_DRIVER ?= pwm_hardware
26+ OPT_DEFS += -DAUDIO_DRIVER_PWM
27+ endif
28 OPT_DEFS += -DAUDIO_ENABLE
29 MUSIC_ENABLE = yes
30 SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c
31 SRC += $(QUANTUM_DIR)/process_keycode/process_clicky.c
32- SRC += $(QUANTUM_DIR)/audio/audio_$(PLATFORM_KEY).c
33+ SRC += $(QUANTUM_DIR)/audio/audio.c ## common audio code, hardware agnostic
34+ SRC += $(QUANTUM_DIR)/audio/driver_$(PLATFORM_KEY)_$(strip $(AUDIO_DRIVER)).c
35 SRC += $(QUANTUM_DIR)/audio/voices.c
36 SRC += $(QUANTUM_DIR)/audio/luts.c
37 endif
38diff --git a/docs/_summary.md b/docs/_summary.md
39index 526caf926f1f4c4e4049f007b617c1013bebf3c8..acbfcfaeda5aa5afa0218c4f29ecd582b9de9f1b 100644
40--- a/docs/_summary.md
41+++ b/docs/_summary.md
42@@ -133,6 +133,7 @@
43 * [Compatible Microcontrollers](compatible_microcontrollers.md)
44 * [Drivers](hardware_drivers.md)
45 * [ADC Driver](adc_driver.md)
46+ * [Audio Driver](audio_driver.md)
47 * [I2C Driver](i2c_driver.md)
48 * [SPI Driver](spi_driver.md)
49 * [WS2812 Driver](ws2812_driver.md)
50diff --git a/docs/audio_driver.md b/docs/audio_driver.md
51new file mode 100644
52index 0000000000000000000000000000000000000000..7cd5a98d9f4643011ba45468e06fc5b9fb46180e
53--- /dev/null
54+++ b/docs/audio_driver.md
55@@ -0,0 +1,221 @@
56+# Audio Driver :id=audio-driver
57+
58diff --git a/docs/config_options.md b/docs/config_options.md
59index 9a64b9b3d2097bef411a3c102f3b5fc82ed5060f..aeaaf47aaf4ff8a4715cea5c2c03b16cc73752c5 100644
60--- a/docs/config_options.md
61+++ b/docs/config_options.md
62@@ -67,16 +67,22 @@ This is a C header file that is one of the first things included, and will persi
63 * turns on the alternate audio voices (to cycle through)
64 * `#define C4_AUDIO`
65 * enables audio on pin C4
66+ * Deprecated. Use `#define AUDIO_PIN C4`
67 * `#define C5_AUDIO`
68 * enables audio on pin C5
69+ * Deprecated. Use `#define AUDIO_PIN C5`
70 * `#define C6_AUDIO`
71 * enables audio on pin C6
72+ * Deprecated. Use `#define AUDIO_PIN C6`
73 * `#define B5_AUDIO`
74- * enables audio on pin B5 (duophony is enables if one of B[5-7]\_AUDIO is enabled along with one of C[4-6]\_AUDIO)
75+ * enables audio on pin B5 (duophony is enabled if one of B pins is enabled along with one of C pins)
76+ * Deprecated. Use `#define AUDIO_PIN B5`, or use `#define AUDIO_PIN_ALT B5` if a `C` pin is enabled with `AUDIO_PIN`
77 * `#define B6_AUDIO`
78- * enables audio on pin B6 (duophony is enables if one of B[5-7]\_AUDIO is enabled along with one of C[4-6]\_AUDIO)
79+ * enables audio on pin B5 (duophony is enabled if one of B pins is enabled along with one of C pins)
80+ * Deprecated. Use `#define AUDIO_PIN B6`, or use `#define AUDIO_PIN_ALT B6` if a `C` pin is enabled with `AUDIO_PIN`
81 * `#define B7_AUDIO`
82- * enables audio on pin B7 (duophony is enables if one of B[5-7]\_AUDIO is enabled along with one of C[4-6]\_AUDIO)
83+ * enables audio on pin B5 (duophony is enabled if one of B pins is enabled along with one of C pins)
84+ * Deprecated. Use `#define AUDIO_PIN B7`, or use `#define AUDIO_PIN_ALT B7` if a `C` pin is enabled with `AUDIO_PIN`
85 * `#define BACKLIGHT_PIN B7`
86 * pin of the backlight
87 * `#define BACKLIGHT_LEVELS 3`
88diff --git a/docs/feature_audio.md b/docs/feature_audio.md
89index 68ba4477a52a81f971f0cba2c3ec46386b892e9e..9e7ba75f521241700954d331a535007775c098cb 100644
90--- a/docs/feature_audio.md
91+++ b/docs/feature_audio.md
92@@ -1,21 +1,117 @@
93 # Audio
94
95diff --git a/keyboards/1upkeyboards/sweet16/v2/proton_c/config.h b/keyboards/1upkeyboards/sweet16/v2/proton_c/config.h
96index 30abf28ee339ce815bc1d8ac503a86ea8db185d2..286af1857f68aa447a5f2d9016ab59c6c2a451d6 100644
97--- a/keyboards/1upkeyboards/sweet16/v2/proton_c/config.h
98+++ b/keyboards/1upkeyboards/sweet16/v2/proton_c/config.h
99@@ -18,3 +18,7 @@
100 #define ENCODERS_PAD_A { A2 }
101 #define ENCODERS_PAD_B { A1 }
102 #define ENCODER_RESOLUTION 4
103+
104+#define AUDIO_PIN A5
105+#define AUDIO_PIN_ALT A4
106+#define AUDIO_PIN_ALT_AS_NEGATIVE
107diff --git a/keyboards/atomic/keymaps/pvc/config.h b/keyboards/atomic/keymaps/pvc/config.h
108index 3803a2ccd013af77e2651cbd06ef69d6268a89fa..01fa0f43134f74def5f06f5430265874efbbd81d 100644
109--- a/keyboards/atomic/keymaps/pvc/config.h
110+++ b/keyboards/atomic/keymaps/pvc/config.h
111@@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
112 #define BACKLIGHT_PIN B7
113 #define BACKLIGHT_BREATHING
114
115-#define C6_AUDIO
116+#define AUDIO_PIN C6
117
118 /* COL2ROW or ROW2COL */
119 #define DIODE_DIRECTION COL2ROW
120diff --git a/keyboards/boston_meetup/2019/config.h b/keyboards/boston_meetup/2019/config.h
121index 3f2a0dd5d6097a1aaeac3dfa16a6621d9a27d924..d9fd93da6e282094f993b42d6913b7c38aa8050c 100644
122--- a/keyboards/boston_meetup/2019/config.h
123+++ b/keyboards/boston_meetup/2019/config.h
124@@ -31,7 +31,10 @@
125
126 //Audio
127 #undef AUDIO_VOICES
128-#undef C6_AUDIO
129+#undef AUDIO_PIN
130+#define AUDIO_PIN A5
131+#define AUDIO_PIN_ALT A4
132+#define AUDIO_PIN_ALT_AS_NEGATIVE
133
134 #ifdef AUDIO_ENABLE
135 #define STARTUP_SONG SONG(ONE_UP_SOUND)
136diff --git a/keyboards/c39/keymaps/kuchosauronad0/config.h b/keyboards/c39/keymaps/kuchosauronad0/config.h
137index cf0726e2bb02bdffc32753bbba2fbc1b515ce581..d67935a9fd0ad808bad48e5097dac73dcdf727a4 100644
138--- a/keyboards/c39/keymaps/kuchosauronad0/config.h
139+++ b/keyboards/c39/keymaps/kuchosauronad0/config.h
140@@ -32,12 +32,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
141 # define RGB_DI_PIN D0
142 # define RGBLED_NUM 4
143 #endif // !RGBLIGHT_ENABLE
144-
145-/*
146-#ifdef AUDIO_ENABLE
147-# Timer 1: #define B5_AUDIO #define B6_AUDIO #define B7_AUDIO
148-# Timer 3: #define C4_AUDIO #define C5_AUDIO #define C6_AUDIO
149-//TODO: only D0 and D1 available
150-#endif // !AUDIO_ENABLE
151-*/
152-
153diff --git a/keyboards/ckeys/obelus/config.h b/keyboards/ckeys/obelus/config.h
154index eaf4811ba7380c28bd64ee319cbf2fabf43dcff4..25bc1db03c1f944dd8903af89e5c732b3bc0474b 100644
155--- a/keyboards/ckeys/obelus/config.h
156+++ b/keyboards/ckeys/obelus/config.h
157@@ -154,7 +154,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
158
159 #ifdef AUDIO_ENABLE
160 #define AUDIO_VOICES
161- #define C6_AUDIO
162+ #define AUDIO_PIN C6
163 #define STARTUP_SONG SONG(STARTUP_SOUND)
164 #endif
165
166diff --git a/keyboards/ckeys/thedora/config.h b/keyboards/ckeys/thedora/config.h
167index 349e33748b54a7460f1637decc885dbd9ca7acc0..c7557aa62d6d0630c851e16dadda313ccb87fa34 100755
168--- a/keyboards/ckeys/thedora/config.h
169+++ b/keyboards/ckeys/thedora/config.h
170@@ -157,6 +157,9 @@
171 // NOTE: Must change polyphony_rate to a number higher than 0 in voices.c
172 #define AUDIO_VOICES
173 #define PITCH_STANDARD_A 880.0f
174+#define AUDIO_PIN A5
175+#define AUDIO_PIN_ALT A4
176+#define AUDIO_PIN_ALT_AS_NEGATIVE
177
178 // Mouse keys
179 #define MOUSEKEY_DELAY 0
180diff --git a/keyboards/clueboard/2x1800/2018/config.h b/keyboards/clueboard/2x1800/2018/config.h
181index 40486379eab3a6632eebe3335e028a481a465bf0..9d5b9b514473f70abc21f37146c4a21a40c4d540 100644
182--- a/keyboards/clueboard/2x1800/2018/config.h
183+++ b/keyboards/clueboard/2x1800/2018/config.h
184@@ -20,8 +20,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
185 #include "config_common.h"
186
187 /* audio support */
188-#define B7_AUDIO
189-#define C4_AUDIO
190+#define AUDIO_PIN_ALT B7
191+#define AUDIO_PIN C4
192 #define AUDIO_CLICKY
193
194 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
195diff --git a/keyboards/clueboard/2x1800/2019/config.h b/keyboards/clueboard/2x1800/2019/config.h
196index 595dc61081f570365c5fe1e97394eb966e107f42..162d41a2e2a07e6c440d52fb7a91ec194836235a 100644
197--- a/keyboards/clueboard/2x1800/2019/config.h
198+++ b/keyboards/clueboard/2x1800/2019/config.h
199@@ -27,8 +27,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
200 #define ENCODER_RESOLUTION 4
201
202 /* audio support */
203-#define B7_AUDIO
204-#define C4_AUDIO
205+#define AUDIO_PIN_ALT B7
206+#define AUDIO_PIN C4
207 #define AUDIO_CLICKY
208
209 /*
210diff --git a/keyboards/clueboard/66/rev4/config.h b/keyboards/clueboard/66/rev4/config.h
211index c745b5a1101d62e637030d64ba21fb6da3c7170e..2c11cf1ec05f59d85e85cbb9daa25b43cf8a4c67 100644
212--- a/keyboards/clueboard/66/rev4/config.h
213+++ b/keyboards/clueboard/66/rev4/config.h
214@@ -22,3 +22,7 @@
215 #define RGBLIGHT_EFFECT_KNIGHT_OFFSET 2 // The led to start at
216 #define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 5 // How many LEDs to travel
217 #define RGBLIGHT_EFFECT_SNAKE_LENGTH 4 // How many LEDs wide to light up
218+
219+#define AUDIO_PIN A5
220+#define AUDIO_PIN_ALT A4
221+#define AUDIO_PIN_ALT_AS_NEGATIVE
222diff --git a/keyboards/clueboard/66_hotswap/gen1/config.h b/keyboards/clueboard/66_hotswap/gen1/config.h
223index 1ddcfacf4d6cb79b9b0815d49e0b40bec650f068..1471af63dcd098f8edf823930319a3f3ec2ac7bd 100644
224--- a/keyboards/clueboard/66_hotswap/gen1/config.h
225+++ b/keyboards/clueboard/66_hotswap/gen1/config.h
226@@ -108,3 +108,7 @@
227
228 #define LED_DRIVER_COUNT 1
229 #define LED_DRIVER_LED_COUNT 71
230+
231+#define AUDIO_PIN A5
232+#define AUDIO_PIN_ALT A4
233+#define AUDIO_PIN_ALT_AS_NEGATIVE
234diff --git a/keyboards/clueboard/66_hotswap/prototype/config.h b/keyboards/clueboard/66_hotswap/prototype/config.h
235index 5c22b927adc351d001ddc107cfd50b64ed11c3f9..a1ab703c3408ebddecb1fa25628836c8d7b8129f 100644
236--- a/keyboards/clueboard/66_hotswap/prototype/config.h
237+++ b/keyboards/clueboard/66_hotswap/prototype/config.h
238@@ -3,7 +3,7 @@
239
240 /* Speaker configuration
241 */
242-#define B7_AUDIO
243+#define AUDIO_PIN B7
244 #define NO_MUSIC_MODE
245 #define AUDIO_CLICKY
246
247diff --git a/keyboards/clueboard/california/config.h b/keyboards/clueboard/california/config.h
248index b8c5759db6b6793a5324896b5f26032be860231b..017f1ddf66dec06dc76616d91f030f50c6b732a3 100644
249--- a/keyboards/clueboard/california/config.h
250+++ b/keyboards/clueboard/california/config.h
251@@ -1,3 +1,7 @@
252 #pragma once
253
254 #include "config_common.h"
255+
256+#define AUDIO_PIN A5
257+#define AUDIO_PIN_ALT A4
258+#define AUDIO_PIN_ALT_AS_NEGATIVE
259diff --git a/keyboards/clueboard/card/config.h b/keyboards/clueboard/card/config.h
260index 67ddb5e25cadb2448e971f7530c2a5116345cdc2..a115f5d6cf2690411353852c32f0e59eb661044f 100644
261--- a/keyboards/clueboard/card/config.h
262+++ b/keyboards/clueboard/card/config.h
263@@ -23,4 +23,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
264 #define BACKLIGHT_LEVELS 6
265
266 // Enable audio
267-#define C6_AUDIO
268+#define AUDIO_PIN C6
269diff --git a/keyboards/crkbd/keymaps/gotham/config.h b/keyboards/crkbd/keymaps/gotham/config.h
270index ed08203aa156f8c132c63c0e993b35ef9e814750..dd58a0fe05d37e907ab3cce78a7d359ae618dfda 100644
271--- a/keyboards/crkbd/keymaps/gotham/config.h
272+++ b/keyboards/crkbd/keymaps/gotham/config.h
273@@ -15,7 +15,7 @@
274 #define NO_ACTION_ONESHOT
275
276 #ifdef AUDIO_ENABLE
277-# define B5_AUDIO
278+# define AUDIO_PIN B5
279 # define NO_MUSIC_MODE
280 # define AUDIO_CLICKY
281 #endif
282diff --git a/keyboards/ergodash/mini/config.h b/keyboards/ergodash/mini/config.h
283index 5e16c78544abeaedbb7b452c843e3fb90a864c7e..b936e0f54e2a7de667a0053c3bf5db9f33c259b2 100644
284--- a/keyboards/ergodash/mini/config.h
285+++ b/keyboards/ergodash/mini/config.h
286@@ -45,7 +45,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
287 /* define if matrix has ghost */
288 //#define MATRIX_HAS_GHOST
289
290-#define C6_AUDIO
291+#define AUDIO_PIN C6
292
293 /* number of backlight levels */
294 #ifdef BACKLIGHT_ENABLE
295diff --git a/keyboards/ergodash/rev1/config.h b/keyboards/ergodash/rev1/config.h
296index 6e25194e4b666afe58d462b16d1d5093db82ddc1..07282cdad2871b12427e385d780c6988d12f92e1 100644
297--- a/keyboards/ergodash/rev1/config.h
298+++ b/keyboards/ergodash/rev1/config.h
299@@ -45,7 +45,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
300 /* define if matrix has ghost */
301 //#define MATRIX_HAS_GHOST
302
303-#define C6_AUDIO
304+#define AUDIO_PIN C6
305
306 /* number of backlight levels */
307 #ifdef BACKLIGHT_ENABLE
308diff --git a/keyboards/evyd13/plain60/keymaps/audio/config.h b/keyboards/evyd13/plain60/keymaps/audio/config.h
309index 9a43b7fbe346c7bdebe46448f956c91f39eabca5..50309173b4099397743460f6dc0e23ed7d22c860 100644
310--- a/keyboards/evyd13/plain60/keymaps/audio/config.h
311+++ b/keyboards/evyd13/plain60/keymaps/audio/config.h
312@@ -1,3 +1,3 @@
313 #pragma once
314
315-#define B7_AUDIO
316+#define AUDIO_PIN B7
317diff --git a/keyboards/flehrad/bigswitch/keymaps/wanleg/config.h b/keyboards/flehrad/bigswitch/keymaps/wanleg/config.h
318index 54abb9a6c17e80afb5cd80ddb8f84b1ae1c6e7b8..bb638ce599b660e4b25e76bd51050c5a6b1edb0b 100644
319--- a/keyboards/flehrad/bigswitch/keymaps/wanleg/config.h
320+++ b/keyboards/flehrad/bigswitch/keymaps/wanleg/config.h
321@@ -39,4 +39,4 @@
322 #define QMK_LED B0
323
324 // set audio pin
325-#define C6_AUDIO
326+#define AUDIO_PIN C6
327diff --git a/keyboards/hadron/ver3/config.h b/keyboards/hadron/ver3/config.h
328index f76ca40603cf40e1547450b1986ff644d6b245b1..8c04575eeab27ab6811d30e7e85c47d111969184 100644
329--- a/keyboards/hadron/ver3/config.h
330+++ b/keyboards/hadron/ver3/config.h
331@@ -50,7 +50,11 @@
332
333 //Audio
334 #undef AUDIO_VOICES
335-#undef C6_AUDIO
336+#undef AUDIO_PIN
337+#define AUDIO_PIN A5
338+#define AUDIO_PIN_ALT A4
339+#define AUDIO_PIN_ALT_AS_NEGATIVE
340+
341
342 #ifdef AUDIO_ENABLE
343 #define STARTUP_SONG SONG(PLANCK_SOUND)
344diff --git a/keyboards/handwired/aranck/config.h b/keyboards/handwired/aranck/config.h
345index 5356feb1ef84ffd0a024283a73d236e512120c13..7d0ab25fe4231a5b65a5dcc99134f518f81e95f5 100644
346--- a/keyboards/handwired/aranck/config.h
347+++ b/keyboards/handwired/aranck/config.h
348@@ -101,7 +101,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
349 /**
350 * Aranck-specific definitions
351 */
352-#define B5_AUDIO
353+#define AUDIO_PIN B5
354 /**
355 * Aranck-specific definitions END
356 */
357diff --git a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/config.h b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/config.h
358index 6d89314a2ce985e08e500dd7a687c7270127bd6f..d18f08e408570cae42dab7884043e757705e06d6 100644
359--- a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/config.h
360+++ b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/config.h
361@@ -61,7 +61,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
362 #define BOOTMAGIC_LITE_ROW_RIGHT 6
363 #define BOOTMAGIC_LITE_COLUMN_RIGHT 5
364
365-#define C6_AUDIO
366+#define AUDIO_PIN C6
367
368 #define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 4095
369 #define DYNAMIC_KEYMAP_LAYER_COUNT 16
370diff --git a/keyboards/handwired/heisenberg/config.h b/keyboards/handwired/heisenberg/config.h
371index 9fe2ec879ab14d98ef23bc65ef554daa94b5b405..ba35f24aca2f44dbdb9c6ff2714f12ea1de63769 100644
372--- a/keyboards/handwired/heisenberg/config.h
373+++ b/keyboards/handwired/heisenberg/config.h
374@@ -101,7 +101,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
375 /**
376 * Heisenberg-specific definitions
377 */
378-#define B5_AUDIO
379+#define AUDIO_PIN B5
380 /**
381 * Heisenberg-specific definitions END
382 */
383diff --git a/keyboards/handwired/ibm122m/config.h b/keyboards/handwired/ibm122m/config.h
384index e0e95d6d3b7d13b32f34a09e7f8e3bae50a2b29e..bd1fdc97dc2528bdfe1564ab2b25686da3bdb0b1 100644
385--- a/keyboards/handwired/ibm122m/config.h
386+++ b/keyboards/handwired/ibm122m/config.h
387@@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
388 #define PRODUCT_ID 0x0000
389 #define DEVICE_VER 0x0001
390 #define MANUFACTURER IBM
391-#define PRODUCT IBM Model M 122 key
392+#define PRODUCT IBM Model M 122 key
393
394 /* key matrix size */
395 #define MATRIX_ROWS 8
396@@ -102,8 +102,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
397 *
398 */
399
400-#define B6_AUDIO
401-#define C6_AUDIO
402+#define AUDIO_PIN_ALT B6
403+#define AUDIO_PIN C6
404
405 /* control how magic key switches layers */
406 //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
407diff --git a/keyboards/handwired/xealous/config.h b/keyboards/handwired/xealous/config.h
408index 251e85d4c122651c78ac5a3132d502400e48c246..5c1469b1f0127c1c14e729822e6dbc0d89763a3e 100644
409--- a/keyboards/handwired/xealous/config.h
410+++ b/keyboards/handwired/xealous/config.h
411@@ -34,10 +34,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
412
413
414 #ifdef AUDIO_ENABLE
415- #define C6_AUDIO
416+ #define AUDIO_PIN C6
417 #define STARTUP_SONG SONG(STARTUP_SOUND)
418 #define NO_MUSIC_MODE
419 #define TONE_QWERTY SONG(Q__NOTE(_E4));
420 #define TONE_NUMPAD SONG(Q__NOTE(_D4));
421 #endif
422-
423diff --git a/keyboards/helix/pico/config.h b/keyboards/helix/pico/config.h
424index 3938db30e6a4fde768fe6f8a88e95f353f1a60f2..b01fd3a0016cb77f65b665149f4cd774db555219 100644
425--- a/keyboards/helix/pico/config.h
426+++ b/keyboards/helix/pico/config.h
427@@ -77,7 +77,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
428
429 /* Audio */
430 #ifdef AUDIO_ENABLE
431- #define B5_AUDIO
432+ #define AUDIO_PIN B5
433 #endif
434
435 /* ws2812 RGB LED */
436diff --git a/keyboards/hp69/config.h b/keyboards/hp69/config.h
437index ca0a9eb47b6eab2951d5c40e61494b9b6829b5e5..06dd57145ca898bdfd585e03ae07fc64a7d35ab1 100644
438--- a/keyboards/hp69/config.h
439+++ b/keyboards/hp69/config.h
440@@ -48,5 +48,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
441 #define RGBLED_NUM 20
442 #define RGBLIGHT_ANIMATIONS
443
444-#define A4_AUDIO
445-#define A5_AUDIO
446+#define AUDIO_PIN A5
447+#define AUDIO_PIN_ALT A4
448+#define AUDIO_PIN_ALT_AS_NEGATIVE
449diff --git a/keyboards/jones/v03/config.h b/keyboards/jones/v03/config.h
450index 3683a43dd19fc76850ce8ab7a00d1cdf76a55b58..0ff82e8d37db465a3835ec1517b14e5fcab9b4dd 100644
451--- a/keyboards/jones/v03/config.h
452+++ b/keyboards/jones/v03/config.h
453@@ -57,8 +57,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
454
455 /* Audio */
456 #ifdef AUDIO_ENABLE
457- #define C6_AUDIO
458- #define B6_AUDIO // 2nd pin for simultaneous audio.
459+ #define AUDIO_PIN C6
460+ #define AUDIO_PIN_ALT B6 // 2nd pin for simultaneous audio.
461 #define AUDIO_CLICKY
462 #endif
463
464diff --git a/keyboards/jones/v03_1/config.h b/keyboards/jones/v03_1/config.h
465index a064e56396954adf19a24c52da51043aa1224722..c1d6a577fc49cb3971c92b656b5e963d9076a09a 100644
466--- a/keyboards/jones/v03_1/config.h
467+++ b/keyboards/jones/v03_1/config.h
468@@ -57,8 +57,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
469
470 /* Audio */
471 #ifdef AUDIO_ENABLE
472- #define C6_AUDIO
473- #define B7_AUDIO // 2nd pin for simultaneous audio.
474+ #define AUDIO_PIN C6
475+ #define AUDIO_PIN_ALT B7 // 2nd pin for simultaneous audio.
476 #define AUDIO_CLICKY
477 #endif
478
479diff --git a/keyboards/keebio/iris/keymaps/blucky/config.h b/keyboards/keebio/iris/keymaps/blucky/config.h
480index 213445dd3f3dddb84e8be8cfbd587ba83d4df30e..f187addbd33357ce728d3ecb522539e6cad71c04 100644
481--- a/keyboards/keebio/iris/keymaps/blucky/config.h
482+++ b/keyboards/keebio/iris/keymaps/blucky/config.h
483@@ -1,5 +1,5 @@
484 /*
485-Copyright 2019 Brian Luckenbill
486+Copyright 2019 Brian Luckenbill
487
488 This program is free software: you can redistribute it and/or modify
489 it under the terms of the GNU General Public License as published by
490@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
491
492 #pragma once
493
494-#define C6_AUDIO
495+#define AUDIO_PIN C6
496
497 #undef RGBLED_NUM
498 #define RGBLED_NUM 12
499diff --git a/keyboards/keebio/iris/keymaps/broswen/config.h b/keyboards/keebio/iris/keymaps/broswen/config.h
500index 19c47780dbfff7181d02d446f41bc0639472e94a..fcfbfe8cf06e4900d36770fa6033d177ce976668 100644
501--- a/keyboards/keebio/iris/keymaps/broswen/config.h
502+++ b/keyboards/keebio/iris/keymaps/broswen/config.h
503@@ -32,7 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
504 #define RGBLIGHT_HUE_STEP 5
505 #define RGBLIGHT_SAT_STEP 8
506 #define RGBLIGHT_VAL_STEP 8
507-#define C6_AUDIO
508+#define AUDIO_PIN C6
509
510 #define NO_MUSIC_MODE
511
512diff --git a/keyboards/keebio/iris/keymaps/drashna/config.h b/keyboards/keebio/iris/keymaps/drashna/config.h
513index 63f87b7c4e03332c76394913b68543b5eee2329a..f68166c98f0565c228c92a4dfc9be91e40151007 100644
514--- a/keyboards/keebio/iris/keymaps/drashna/config.h
515+++ b/keyboards/keebio/iris/keymaps/drashna/config.h
516@@ -43,7 +43,7 @@
517 #endif // RGBLIGHT_ENABLE
518
519 #ifdef AUDIO_ENABLE
520-# define C6_AUDIO
521+# define AUDIO_PIN C6
522 # ifdef RGBLIGHT_ENABLE
523 # ifndef __arm__
524 # define NO_MUSIC_MODE
525diff --git a/keyboards/keebio/iris/keymaps/mtdjr/config.h b/keyboards/keebio/iris/keymaps/mtdjr/config.h
526index 93dc4c211ddc1472d8d2c340995da532352c0cca..9adb6d62715f3bf72537ec9b0dab70cce5a86422 100644
527--- a/keyboards/keebio/iris/keymaps/mtdjr/config.h
528+++ b/keyboards/keebio/iris/keymaps/mtdjr/config.h
529@@ -34,7 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
530
531 // #define AUDIO_CLICKY
532 // #define AUDIO_CLICKY_ON
533-// #define C6_AUDIO
534+// #define AUDIO_PIN C6
535 // #define AUDIO_CLICKY_FREQ_RANDOMNESS 0.1f
536 // #define AUDIO_CLICKY_FREQ_MAX 100.0f
537
538diff --git a/keyboards/keebio/iris/keymaps/pvinis/config.h b/keyboards/keebio/iris/keymaps/pvinis/config.h
539index 9574f2a837f5dfb1c6bc8cd6d7b8bf15751f5ada..c2870eba0b94c91a25b7973cce047243eacc0d3c 100644
540--- a/keyboards/keebio/iris/keymaps/pvinis/config.h
541+++ b/keyboards/keebio/iris/keymaps/pvinis/config.h
542@@ -16,7 +16,7 @@
543
544 // Choose pin to use for audio. C6 is the one iris uses.
545 #ifdef AUDIO_ENABLE
546-# define C6_AUDIO
547+# define AUDIO_PIN C6
548 # define STARTUP_SONG SONG(NO_SOUND) // No startup song.
549 #endif
550
551diff --git a/keyboards/keebio/levinson/keymaps/issmirnov/config.h b/keyboards/keebio/levinson/keymaps/issmirnov/config.h
552index 89c2f5ebe82ce6f9edf647561fbe0089d5cb0c06..2f0fbaf33c6a6cbb655dc469da4d9e3066b0087a 100644
553--- a/keyboards/keebio/levinson/keymaps/issmirnov/config.h
554+++ b/keyboards/keebio/levinson/keymaps/issmirnov/config.h
555@@ -29,6 +29,6 @@
556
557 #ifdef AUDIO_ENABLE
558 #define QMK_SPEAKER C6
559- #define C6_AUDIO
560+ #define AUDIO_PIN C6
561 #define NO_MUSIC_MODE // Save 2000 bytes
562 #endif
563diff --git a/keyboards/keebio/quefrency/keymaps/drashna_ms/config.h b/keyboards/keebio/quefrency/keymaps/drashna_ms/config.h
564index 089c8cf79e52b30caa863109252e4726a9d9b71e..80a3cb877e2af0175dabc967c71d54c28c998222 100644
565--- a/keyboards/keebio/quefrency/keymaps/drashna_ms/config.h
566+++ b/keyboards/keebio/quefrency/keymaps/drashna_ms/config.h
567@@ -35,6 +35,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
568 #endif
569
570 #ifdef AUDIO_ENABLE
571- #define B7_AUDIO
572+ #define AUDIO_PIN B7
573 #define AUDIO_CLICKY
574 #endif
575diff --git a/keyboards/keebio/viterbi/keymaps/drashna/config.h b/keyboards/keebio/viterbi/keymaps/drashna/config.h
576index 5d7ffa8a1d5346d177a45d2ee886625bd39275ed..2decb3b3e9379f7018f25b0df1a04d57630ed43f 100644
577--- a/keyboards/keebio/viterbi/keymaps/drashna/config.h
578+++ b/keyboards/keebio/viterbi/keymaps/drashna/config.h
579@@ -34,7 +34,7 @@
580 #define PRODUCT Drashnas Viterbi Macro Pad
581
582 #ifdef AUDIO_ENABLE
583-# define C6_AUDIO
584+# define AUDIO_PIN C6
585 # define NO_MUSIC_MODE
586 #endif
587
588diff --git a/keyboards/keysofkings/twokey/config.h b/keyboards/keysofkings/twokey/config.h
589index d7f4c3cf0a64703519758394fdeefe5cde9c7213..9b77fa73e2439d69e32645695328e073e3efff7e 100755
590--- a/keyboards/keysofkings/twokey/config.h
591+++ b/keyboards/keysofkings/twokey/config.h
592@@ -1,18 +1,18 @@
593 /* Copyright 2020 Keys of Kings
594- *
595- * This program is free software: you can redistribute it and/or modify
596- * it under the terms of the GNU General Public License as published by
597- * the Free Software Foundation, either version 2 of the License, or
598- * (at your option) any later version.
599- *
600- * This program is distributed in the hope that it will be useful,
601- * but WITHOUT ANY WARRANTY; without even the implied warranty of
602- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
603- * GNU General Public License for more details.
604- *
605- * You should have received a copy of the GNU General Public License
606- * along with this program. If not, see <http://www.gnu.org/licenses/>.
607- */
608+ *
609+ * This program is free software: you can redistribute it and/or modify
610+ * it under the terms of the GNU General Public License as published by
611+ * the Free Software Foundation, either version 2 of the License, or
612+ * (at your option) any later version.
613+ *
614+ * This program is distributed in the hope that it will be useful,
615+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
616+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
617+ * GNU General Public License for more details.
618+ *
619+ * You should have received a copy of the GNU General Public License
620+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
621+ */
622
623 #pragma once
624
625@@ -59,7 +59,7 @@
626 #define RGBLIGHT_HUE_STEP 4
627 #define RGBLIGHT_SAT_STEP 4
628 #define RGBLIGHT_VAL_STEP 4
629-#define B6_AUDIO
630+#define AUDIO_PIN B6
631 #define AUDIO_CLICKY
632 #endif
633
634diff --git a/keyboards/knops/mini/keymaps/mverteuil/config.h b/keyboards/knops/mini/keymaps/mverteuil/config.h
635index f72145c5a86e9ef97beb792ec435b7f233cec55b..584296cfaada78856862870ed80ca47431fc3dbb 100644
636--- a/keyboards/knops/mini/keymaps/mverteuil/config.h
637+++ b/keyboards/knops/mini/keymaps/mverteuil/config.h
638@@ -18,8 +18,8 @@
639
640 #if defined(AUDIO_ENABLE)
641 #define AUDIO_CLICKY
642- #define B5_AUDIO
643- #define C6_AUDIO
644+ #define AUDIO_PIN_ALT B5
645+ #define AUDIO_PIN C6
646 #define STARTUP_SONG SONG(ZELDA_PUZZLE)
647 #define GOODBYE_SONG SONG(COIN_SOUND)
648 #endif
649diff --git a/keyboards/launchpad/keymaps/drashna/config.h b/keyboards/launchpad/keymaps/drashna/config.h
650index 212b1da805e01b7ff0cb89f115be27ca66641924..b14becc25bf57d433ed1f8b367a665e28b25bf99 100644
651--- a/keyboards/launchpad/keymaps/drashna/config.h
652+++ b/keyboards/launchpad/keymaps/drashna/config.h
653@@ -27,5 +27,5 @@
654 #define RGBLIGHT_VAL_STEP 17
655
656 #define DRIVER_LED_TOTAL RGBLED_NUM
657-#define B7_AUDIO
658+#define AUDIO_PIN B7
659 #define AUDIO_CLICKY
660diff --git a/keyboards/lets_split/sockets/config.h b/keyboards/lets_split/sockets/config.h
661index 4315ce24fda5ba66cccce1379883072dc923b05e..67fa4b4ccc204bffe9c3d81a639521787f321409 100644
662--- a/keyboards/lets_split/sockets/config.h
663+++ b/keyboards/lets_split/sockets/config.h
664@@ -61,7 +61,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
665
666 /* Audio settings */
667 #ifdef AUDIO_ENABLE
668- #define C6_AUDIO // Define this to enable the buzzer
669+ #define AUDIO_PIN C6 // Define this to enable the buzzer
670 #endif
671
672 /*
673diff --git a/keyboards/lfkeyboards/lfk78/config.h b/keyboards/lfkeyboards/lfk78/config.h
674index 5a855b07c53fd8f1cd6d3121003a4970afd97548..2b0b01d86117541d4891fc919d2125e57abdda97 100644
675--- a/keyboards/lfkeyboards/lfk78/config.h
676+++ b/keyboards/lfkeyboards/lfk78/config.h
677@@ -39,7 +39,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
678
679 #define TAPPING_TERM 200
680
681-#define C6_AUDIO
682+#define AUDIO_PIN C6
683 #define AUDIO_VOICES
684
685 #define RGB_DI_PIN C7 // Have to set it to something to get the ws2812 code to compile
686diff --git a/keyboards/lfkeyboards/lfk87/config.h b/keyboards/lfkeyboards/lfk87/config.h
687index 118c135aa1e20773aec057b0b9d42038b2ad82dd..c030590921e1ddc52faaedaf2db72d99dc82c9e0 100644
688--- a/keyboards/lfkeyboards/lfk87/config.h
689+++ b/keyboards/lfkeyboards/lfk87/config.h
690@@ -50,7 +50,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
691 #endif
692
693 #define AUDIO_VOICES
694-#define C6_AUDIO
695+#define AUDIO_PIN C6
696
697 #define BACKLIGHT_LEVELS 10
698 #define BACKLIGHT_PWM_MAP {2, 4, 8, 16, 40, 55, 70, 128, 200, 255}
699diff --git a/keyboards/lfkeyboards/mini1800/config.h b/keyboards/lfkeyboards/mini1800/config.h
700index a6cd675ddfb3f324af3f47768455da4facce32d0..b8c0f2b671d23cbdbdb7f2eca93871cb978bf7c0 100644
701--- a/keyboards/lfkeyboards/mini1800/config.h
702+++ b/keyboards/lfkeyboards/mini1800/config.h
703@@ -37,7 +37,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
704 #define RGBLED_NUM 26 // Number of LEDs
705
706 #define AUDIO_VOICES
707-#define C6_AUDIO
708+#define AUDIO_PIN C6
709
710 #define BACKLIGHT_LEVELS 10
711 #define BACKLIGHT_PWM_MAP {2, 4, 8, 16, 40, 55, 70, 128, 200, 255}
712diff --git a/keyboards/lfkeyboards/smk65/revb/config.h b/keyboards/lfkeyboards/smk65/revb/config.h
713index 0d4fe40f358709322bf3d5b4ef282ef91d0bd19d..924a04fd9efc44d9b8ab5f36cf7809c6d4249c4f 100644
714--- a/keyboards/lfkeyboards/smk65/revb/config.h
715+++ b/keyboards/lfkeyboards/smk65/revb/config.h
716@@ -43,8 +43,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
717 //RevB only:
718
719 #define AUDIO_VOICES
720-#define C6_AUDIO
721-// #define B5_AUDIO
722+#define AUDIO_PIN C6
723
724 #define BACKLIGHT_LEVELS 8
725 #define BACKLIGHT_PWM_MAP {8, 16, 40, 55, 70, 128, 200, 255}
726diff --git a/keyboards/meira/featherble/config.h b/keyboards/meira/featherble/config.h
727index c6c63556d650d113e61022f9b8691f3a60efe91a..e8db87acbb3aa96211f408d64dfdf3597b6ffb17 100644
728--- a/keyboards/meira/featherble/config.h
729+++ b/keyboards/meira/featherble/config.h
730@@ -37,7 +37,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
731 #define UNUSED_PINS
732
733 #define QMK_SPEAKER B5
734-#define B5_AUDIO
735+#define AUDIO_PIN B5
736 #define AUDIO_VOICES
737
738 // #define BACKLIGHT_PIN B7