aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/ChangeLog/20200829.md2
-rw-r--r--docs/ChangeLog/20201128.md2
-rw-r--r--docs/ChangeLog/20210529.md192
-rw-r--r--docs/_summary.md2
-rw-r--r--docs/adc_driver.md154
-rw-r--r--docs/breaking_changes.md15
-rw-r--r--docs/breaking_changes_history.md1
-rw-r--r--docs/cli_commands.md48
-rw-r--r--docs/compatible_microcontrollers.md3
-rw-r--r--docs/feature_auto_shift.md27
-rw-r--r--docs/feature_backlight.md20
-rw-r--r--docs/feature_encoders.md9
-rw-r--r--docs/feature_leader_key.md13
-rw-r--r--docs/feature_led_matrix.md337
-rw-r--r--docs/feature_oled_driver.md2
-rw-r--r--docs/feature_rgb_matrix.md105
-rw-r--r--docs/feature_rgblight.md13
-rw-r--r--docs/feature_swap_hands.md2
-rw-r--r--docs/feature_unicode.md2
-rw-r--r--docs/feature_wpm.md67
-rw-r--r--docs/flashing.md26
-rw-r--r--docs/ja/compatible_microcontrollers.md3
-rw-r--r--docs/ja/feature_led_matrix.md2
-rw-r--r--docs/ja/feature_swap_hands.md2
-rw-r--r--docs/keycodes.md3
-rw-r--r--docs/one_shot_keys.md3
-rw-r--r--docs/serial_driver.md154
-rw-r--r--docs/ws2812_driver.md22
28 files changed, 1066 insertions, 165 deletions
diff --git a/docs/ChangeLog/20200829.md b/docs/ChangeLog/20200829.md
index 00e0bd1a2..c6abed5b3 100644
--- a/docs/ChangeLog/20200829.md
+++ b/docs/ChangeLog/20200829.md
@@ -5,7 +5,7 @@ Four times a year QMK runs a process for merging Breaking Changes. A Breaking Ch
5 5
6## Changes Requiring User Action :id=changes-requiring-user-action 6## Changes Requiring User Action :id=changes-requiring-user-action
7 7
8### Relocated Keyboards :id-relocated-keyboards 8### Relocated Keyboards :id=relocated-keyboards
9 9
10#### The Key Company project consolidation ([#9547](https://github.com/qmk/qmk_firmware/pull/9547)) 10#### The Key Company project consolidation ([#9547](https://github.com/qmk/qmk_firmware/pull/9547))
11#### relocating boards by flehrad to flehrad/ folder ([#9635](https://github.com/qmk/qmk_firmware/pull/9635)) 11#### relocating boards by flehrad to flehrad/ folder ([#9635](https://github.com/qmk/qmk_firmware/pull/9635))
diff --git a/docs/ChangeLog/20201128.md b/docs/ChangeLog/20201128.md
index 86abd384d..444132029 100644
--- a/docs/ChangeLog/20201128.md
+++ b/docs/ChangeLog/20201128.md
@@ -5,7 +5,7 @@ Four times a year QMK runs a process for merging Breaking Changes. A Breaking Ch
5 5
6## Changes Requiring User Action :id=changes-requiring-user-action 6## Changes Requiring User Action :id=changes-requiring-user-action
7 7
8### Relocated Keyboards :id-relocated-keyboards 8### Relocated Keyboards :id=relocated-keyboards
9 9
10#### Reduce Helix keyboard build variation ([#8669](https://github.com/qmk/qmk_firmware/pull/8669)) 10#### Reduce Helix keyboard build variation ([#8669](https://github.com/qmk/qmk_firmware/pull/8669))
11 11
diff --git a/docs/ChangeLog/20210529.md b/docs/ChangeLog/20210529.md
new file mode 100644
index 000000000..d005aeed3
--- /dev/null
+++ b/docs/ChangeLog/20210529.md
@@ -0,0 +1,192 @@
1# QMK Breaking Changes - 2021 May 29 Changelog
2
3## Notable Changes :id=notable-changes
4
5### RGB Matrix support for split common ([#11055](https://github.com/qmk/qmk_firmware/pull/11055)) :id=rgb-matrix-split-common
6
7Split boards can now use RGB Matrix without defining a custom matrix.
8
9### Teensy 3.6 support ([#12258](https://github.com/qmk/qmk_firmware/pull/12258)) :id=teensy-3-6-support
10
11Added support for MK66F18 (Teensy 3.6) microcontroller.
12
13### New command: qmk console ([#12828](https://github.com/qmk/qmk_firmware/pull/12828)) :id=new-command-qmk-console
14
15A new `qmk console` command has been added for attaching to your keyboard's console. It operates similiarly to QMK Toolbox by allowing you to connect to one or more keyboard consoles to display debugging messages.
16
17### Improved command: qmk config :id=improve-command-qmk-config
18
19We've updated the `qmk config` command to show only the configuration items you have actually set. You can now display (almost) all of the available configuration options, along with their default values, using `qmk config -a`.
20
21### LED Matrix Improvements ([#12509](https://github.com/qmk/qmk_firmware/pull/12509), [#12580](https://github.com/qmk/qmk_firmware/pull/12580), [#12588](https://github.com/qmk/qmk_firmware/pull/12588), [#12633](https://github.com/qmk/qmk_firmware/pull/12633), [#12651](https://github.com/qmk/qmk_firmware/pull/12651), [#12685](https://github.com/qmk/qmk_firmware/pull/12685)) :id=led-matrix-improvements
22
23LED Matrix has been improved with effects, CIE1931 curves, and a task system.
24
25## Changes Requiring User Action :id=changes-requiring-user-action
26
27### Updated Keyboard Codebases :id=updated-keyboard-codebases
28
29* Durgod keyboard refactor in preparation for adding additional durgod keyboards ([#11978](https://github.com/qmk/qmk_firmware/pull/11978))
30* Updated Function96 with V2 files and removed chconf.h and halconf.h ([#12613](https://github.com/qmk/qmk_firmware/pull/12613))
31* [Keyboard] updated a vendor name / fixed minor keymap issues ([#12881](https://github.com/qmk/qmk_firmware/pull/12881))
32* [Keyboard] Corne - Remove legacy revision support ([#12226](https://github.com/qmk/qmk_firmware/pull/12226))
33
34The following keyboards have had their source moved within QMK:
35
36Old Keyboard Name | New Keyboard Name
37:---------------- | :----------------
38crkbd/rev1/common | crkbd/rev1
39function96 | function96/v1
40nckiibs/flatbread60 | delikeeb/flatbread60
41nckiibs/vaguettelite | delikeeb/vaguettelite
42nckiibs/vanana/rev1 | delikeeb/vanana/rev1
43nckiibs/vanana/rev2 | delikeeb/vanana/rev2
44nckiibs/vaneela | delikeeb/vaneela
45nckiibs/vaneelaex | delikeeb/vaneelaex
46nckiibs/waaffle/rev3/elite_c | delikeeb/waaffle/rev3/elite_c
47nckiibs/waaffle/rev3/pro_micro | delikeeb/waaffle/rev3/pro_micro
48
49The [Function96 V2](https://github.com/qmk/qmk_firmware/tree/0.13.0/keyboards/function96/v2) has also been added as part of these changes.
50
51The codebase for the [Durgod K320](https://github.com/qmk/qmk_firmware/tree/0.13.0/keyboards/durgod/k320) has been reworked in anticipation of additional Durgod keyboards gaining QMK support.
52
53Additionally, the `crkbd/rev1/legacy` keyboard has been removed.
54
55### Bootmagic Deprecation and Refactor ([#12172](https://github.com/qmk/qmk_firmware/pull/12172)) :id=bootmagic-deprecation-and-refactor
56
57QMK has decided to deprecate the full Bootmagic feature and leave Bootmagic Lite as the only remaining option.
58
59This pull request changes the behavior of `BOOTMAGIC_ENABLE` such that specifying `BOOTMAGIC_ENABLE = yes` enables Bootmagic Lite instead of full Bootmagic.
60
61If attempts to use Bootmagic functionality result in unexpected behavior, check your `rules.mk` file and change the `BOOTMAGIC_ENABLE` setting to specify either `lite` or `full`.
62
63#### Tentative Deprecation Schedule
64
65This is the current planned roadmap for the behavior of `BOOTMAGIC_ENABLE`:
66
67- From 2021 May 29, setting `BOOTMAGIC_ENABLE = yes` will enable Bootmagic Lite instead of full Bootmagic.
68- From 2021 Aug 28, `BOOTMAGIC_ENABLE` must be either `yes`, `lite`, or `no` – setting `BOOTMAGIC_ENABLE = full` will cause compilation to fail.
69- From 2021 Nov 27, `BOOTMAGIC_ENABLE` must be either `yes` or `no` – setting `BOOTMAGIC_ENABLE = lite` will cause compilation to fail.
70
71### Removal of LAYOUT_kc ([#12160](https://github.com/qmk/qmk_firmware/pull/12160)) :id=removal-of-layout-kc
72
73We've removed support for `LAYOUT_kc` macros, if your keymap uses one you will need to update it use a regular `LAYOUT` macro.
74
75### Encoder callbacks are now boolean ([#12805](https://github.com/qmk/qmk_firmware/pull/12805), [#12985](https://github.com/qmk/qmk_firmware/pull/12985)) :id=encoder-callback-boolean
76
77To allow for keyboards to override (or not) keymap level code the `encoder_update_kb` function has been changed from `void` to `bool`. You will need to update your function definition to reflect this and ensure that you return a `true` or `false` value.
78
79Example code before change:
80
81```c
82void encoder_update_kb(uint8_t index, bool clockwise) {
83 encoder_update_user(index, clockwise);
84}
85```
86
87Example code after change:
88
89```c
90bool encoder_update_kb(uint8_t index, bool clockwise) {
91 return encoder_update_user(index, clockwise);
92}
93```
94
95## Core Changes :id=core-changes
96
97### Fixes :id=core-fixes
98
99* Fix connection issue in split keyboards when slave and OLED display are connected via I2C (fixes #9335) ([#11487](https://github.com/qmk/qmk_firmware/pull/11487))
100* Terrazzo: Fix wrong LED Matrix function names ([#12561](https://github.com/qmk/qmk_firmware/pull/12561))
101* Apply the "NO_LIMITED_CONTROLLER_CONNECT" fix to atmega16u2 ([#12482](https://github.com/qmk/qmk_firmware/pull/12482))
102* Fix comment parsing ([#12750](https://github.com/qmk/qmk_firmware/pull/12750))
103* Turn OLED off on suspend in soundmonster Corne keymap ([#10419](https://github.com/qmk/qmk_firmware/pull/10419))
104* Fixup build errors on `develop` branch. ([#12723](https://github.com/qmk/qmk_firmware/pull/12723))
105* Fix syntax error when compiling for ARM ([#12866](https://github.com/qmk/qmk_firmware/pull/12866))
106* Add missing LED Matrix suspend code to suspend.c ([#12878](https://github.com/qmk/qmk_firmware/pull/12878))
107* Fix spelling mistake regarding LED Matrix in split_common. ([#12888](https://github.com/qmk/qmk_firmware/pull/12888))
108* [Keymap] Fix QWERTY/DVORAK status output for kzar keymap ([#12895](https://github.com/qmk/qmk_firmware/pull/12895))
109* Fixup housekeeping from being invoked twice per loop. ([#12933](https://github.com/qmk/qmk_firmware/pull/12933))
110* wait for matrix row signal to go HIGH for every row ([#12945](https://github.com/qmk/qmk_firmware/pull/12945))
111* ensure we do not conflict with existing keymap aliases ([#12976](https://github.com/qmk/qmk_firmware/pull/12976))
112* [Keyboard] Fix Terrazzo build failure ([#12977](https://github.com/qmk/qmk_firmware/pull/12977))
113* Do not hard set config in CPTC files ([#11864](https://github.com/qmk/qmk_firmware/pull/11864))
114
115### Additions and Enhancements :id=core-additions
116
117* ARM - Refactor SLEEP_LED to support more platforms ([#8403](https://github.com/qmk/qmk_firmware/pull/8403))
118* Add ability to toggle One Shot functionality ([#4198](https://github.com/qmk/qmk_firmware/pull/4198))
119* Add RGB Matrix support to Split Common ([#11055](https://github.com/qmk/qmk_firmware/pull/11055))
120* Add support for complementary outputs to the ChibiOS WS2812 PWM driver ([#11988](https://github.com/qmk/qmk_firmware/pull/11988))
121* Enable RGB Matrix for Corne ([#12091](https://github.com/qmk/qmk_firmware/pull/12091))
122* Set default OLED Update Interval for Split Keyboards to improve matrix scan performance ([#12107](https://github.com/qmk/qmk_firmware/pull/12107))
123* Add support for MK66F18 (Teensy 3.6) micro controller ([#12258](https://github.com/qmk/qmk_firmware/pull/12258))
124* Split RGB Matrix support for RGBKB Zygomorph ([#11083](https://github.com/qmk/qmk_firmware/pull/11083))
125* Add baudrate and circular buffer to ARM WS2812 SPI config ([#12216](https://github.com/qmk/qmk_firmware/pull/12216))
126* Add keyboard level weak function for slave matrix scan ([#12317](https://github.com/qmk/qmk_firmware/pull/12317))
127* Add link to schematic on EasyEDA for XD60 ([#12018](https://github.com/qmk/qmk_firmware/pull/12018))
128* Add Config functions for LED Matrix ([#12361](https://github.com/qmk/qmk_firmware/pull/12361))
129* Add pin definitions for MK66F18 ([#12419](https://github.com/qmk/qmk_firmware/pull/12419))
130* add kinesis/kint36 keyboard ([#10171](https://github.com/qmk/qmk_firmware/pull/10171))
131* Add support for producing UF2-format binaries. ([#12435](https://github.com/qmk/qmk_firmware/pull/12435))
132* Implement CIE1931 curve for LED Matrix ([#12417](https://github.com/qmk/qmk_firmware/pull/12417))
133* Change `BOOTMAGIC_ENABLE=yes` to use Bootmagic Lite ([#12172](https://github.com/qmk/qmk_firmware/pull/12172))
134* Add kzar keymap for Kinesis Advantage ([#12444](https://github.com/qmk/qmk_firmware/pull/12444))
135* LED Matrix: suspend code ([#12509](https://github.com/qmk/qmk_firmware/pull/12509))
136* LED Matrix: Task system ([#12580](https://github.com/qmk/qmk_firmware/pull/12580))
137* Add missing RGB_MODE_TWINKLE / RGB_M_TW keycodes ([#11935](https://github.com/qmk/qmk_firmware/pull/11935))
138* Enhancement of WPM feature ([#11727](https://github.com/qmk/qmk_firmware/pull/11727))
139* Add Per Key functionality for AutoShift ([#11536](https://github.com/qmk/qmk_firmware/pull/11536))
140* LED Matrix: Reactive effect buffers & advanced indicators ([#12588](https://github.com/qmk/qmk_firmware/pull/12588))
141* LED Matrix: support for Split keyboards ([#12633](https://github.com/qmk/qmk_firmware/pull/12633))
142* add setting to enable infinite timeout for leader key ([#6580](https://github.com/qmk/qmk_firmware/pull/6580), [#12721](https://github.com/qmk/qmk_firmware/pull/12721 "Fix bad PR merge for #6580"))
143* Update ADC driver for STM32F1xx, STM32F3xx, STM32F4xx ([#12403](https://github.com/qmk/qmk_firmware/pull/12403))
144* Add initial support for tinyuf2 bootloader (when hosted on F411 blackpill) ([#12600](https://github.com/qmk/qmk_firmware/pull/12600))
145* Add support for STM32F446 MCU ([#12619](https://github.com/qmk/qmk_firmware/pull/12619))
146* Add STM32L433 and L443 support ([#12063](https://github.com/qmk/qmk_firmware/pull/12063))
147* Added OLED fade out support ([#12086](https://github.com/qmk/qmk_firmware/pull/12086))
148* New command: `qmk console` ([#12828](https://github.com/qmk/qmk_firmware/pull/12828))
149* LED Matrix: Effects! ([#12651](https://github.com/qmk/qmk_firmware/pull/12651))
150* Add setup, clone, and env to the list of commands we allow even with broken modules ([#12868](https://github.com/qmk/qmk_firmware/pull/12868))
151* LED Matrix: Documentation ([#12685](https://github.com/qmk/qmk_firmware/pull/12685))
152* Add function to allow repeated blinking of one layer ([#12237](https://github.com/qmk/qmk_firmware/pull/12237))
153* Add support for up to 4 IS31FL3733 drivers ([#12342](https://github.com/qmk/qmk_firmware/pull/12342))
154* Convert Encoder callbacks to be boolean functions ([#12805](https://github.com/qmk/qmk_firmware/pull/12805), [#12985](https://github.com/qmk/qmk_firmware/pull/12985))
155* [Keymap] Update to Drashna keymap and user code (based on develop) ([#12936](https://github.com/qmk/qmk_firmware/pull/12936))
156* Add Full-duplex serial driver for ARM boards ([#9842](https://github.com/qmk/qmk_firmware/pull/9842))
157* Document LED_MATRIX_FRAMEBUFFER_EFFECTS ([#12987](https://github.com/qmk/qmk_firmware/pull/12987))
158* Backlight: add defines for default level and breathing state ([#12560](https://github.com/qmk/qmk_firmware/pull/12560), [#13024](https://github.com/qmk/qmk_firmware/pull/13024))
159* Add dire message about LUFA mass storage bootloader ([#13014](https://github.com/qmk/qmk_firmware/pull/13014))
160
161### Clean-ups and Optimizations :id=core-optimizations
162
163* Overhaul bootmagic logic to have single entrypoint ([#8532](https://github.com/qmk/qmk_firmware/pull/8532))
164* Refactor of USB code within split_common ([#11890](https://github.com/qmk/qmk_firmware/pull/11890))
165* Begin the process of deprecating `bin/qmk` in favor of the global CLI ([#12109](https://github.com/qmk/qmk_firmware/pull/12109))
166* LED Matrix: decouple from Backlight ([#12054](https://github.com/qmk/qmk_firmware/pull/12054))
167* Remove `FUNC()` ([#12161](https://github.com/qmk/qmk_firmware/pull/12161))
168* Move gpio wait logic to wait.h ([#12067](https://github.com/qmk/qmk_firmware/pull/12067))
169* LED Matrix: Clean up includes ([#12197](https://github.com/qmk/qmk_firmware/pull/12197))
170* Consistently use bin/qmk when that script is called ([#12286](https://github.com/qmk/qmk_firmware/pull/12286))
171* LED Matrix: Additional common_features.mk tweaks ([#12187](https://github.com/qmk/qmk_firmware/pull/12187))
172* LED Matrix: Fix up eeconfig code ([#12327](https://github.com/qmk/qmk_firmware/pull/12327))
173* Big quantum_keycodes cleanup ([#12249](https://github.com/qmk/qmk_firmware/pull/12249))
174* Fix up builds that are now too big for `develop` branch. ([#12495](https://github.com/qmk/qmk_firmware/pull/12495))
175* [Keyboard] kint36: switch to sym_eager_pk debouncing ([#12626](https://github.com/qmk/qmk_firmware/pull/12626))
176* [Keyboard] kint2pp: reduce input latency by ≈10ms ([#12625](https://github.com/qmk/qmk_firmware/pull/12625))
177* eeprom driver: Refactor where eeprom driver initialisation (and EEPROM emulation initialisation) occurs to make it non-target-specific. ([#12671](https://github.com/qmk/qmk_firmware/pull/12671))
178* Change RGB/LED Matrix to use a simple define for USB suspend ([#12697](https://github.com/qmk/qmk_firmware/pull/12697), [#12770](https://github.com/qmk/qmk_firmware/pull/12770 "Fixing transport's led/rgb matrix suspend state logic"))
179* Remove pointless SERIAL_LINK_ENABLE rules ([#12846](https://github.com/qmk/qmk_firmware/pull/12846))
180* Make Swap Hands use PROGMEM ([#12284](https://github.com/qmk/qmk_firmware/pull/12284))
181* Remove KEYMAP and LAYOUT_kc ([#12160](https://github.com/qmk/qmk_firmware/pull/12160))
182* Rename `point_t` -> `led_point_t` ([#12864](https://github.com/qmk/qmk_firmware/pull/12864))
183* Deprecate `send_unicode_hex_string()` ([#12602](https://github.com/qmk/qmk_firmware/pull/12602))
184* [Keyboard] Remove redundant legacy and common headers for crkbd ([#13023](https://github.com/qmk/qmk_firmware/pull/13023))
185
186### QMK Infrastructure and Internals :id=qmk-internals
187
188* trivial change to trigger api update ([`b15288fb87`](https://github.com/qmk/qmk_firmware/commit/b15288fb87))
189* fix some references to bin/qmk that slipped in ([#12832](https://github.com/qmk/qmk_firmware/pull/12832))
190* Resolve a number of warnings in `qmk generate-api` ([#12833](https://github.com/qmk/qmk_firmware/pull/12833))
191* Fix another bin/qmk reference ([#12856](https://github.com/qmk/qmk_firmware/pull/12856))
192* Use milc.subcommand.config instead of qmk.cli.config ([#12915](https://github.com/qmk/qmk_firmware/pull/12915))
diff --git a/docs/_summary.md b/docs/_summary.md
index 825514e6b..38937771f 100644
--- a/docs/_summary.md
+++ b/docs/_summary.md
@@ -120,7 +120,7 @@
120 * Breaking Changes 120 * Breaking Changes
121 * [Overview](breaking_changes.md) 121 * [Overview](breaking_changes.md)
122 * [My Pull Request Was Flagged](breaking_changes_instructions.md) 122 * [My Pull Request Was Flagged](breaking_changes_instructions.md)
123 * [Most Recent ChangeLog](ChangeLog/20210227.md "QMK v0.12.0 - 2021 Feb 27") 123 * [Most Recent ChangeLog](ChangeLog/20210529.md "QMK v0.13.0 - 2021 May 29")
124 * [Past Breaking Changes](breaking_changes_history.md) 124 * [Past Breaking Changes](breaking_changes_history.md)
125 125
126 * C Development 126 * C Development
diff --git a/docs/adc_driver.md b/docs/adc_driver.md
index 6e3d51386..69fff4b3c 100644
--- a/docs/adc_driver.md
+++ b/docs/adc_driver.md
@@ -47,73 +47,79 @@ Note that some of these pins are doubled-up on ADCs with the same channel. This
47 47
48Also note that the F0 and F3 use different numbering schemes. The F0 has a single ADC and the channels are 0-indexed, whereas the F3 has 4 ADCs and the channels are 1-indexed. This is because the F0 uses the `ADCv1` implementation of the ADC, whereas the F3 uses the `ADCv3` implementation. 48Also note that the F0 and F3 use different numbering schemes. The F0 has a single ADC and the channels are 0-indexed, whereas the F3 has 4 ADCs and the channels are 1-indexed. This is because the F0 uses the `ADCv1` implementation of the ADC, whereas the F3 uses the `ADCv3` implementation.
49 49
50|ADC|Channel|STM32F0xx|STM32F3xx| 50|ADC|Channel|STM32F0xx|STM32F1xx|STM32F3xx|STM32F4xx|
51|---|-------|---------|---------| 51|---|-------|---------|---------|---------|---------|
52|1 |0 |`A0` | | 52|1 |0 |`A0` |`A0` | |`A0` |
53|1 |1 |`A1` |`A0` | 53|1 |1 |`A1` |`A1` |`A0` |`A1` |
54|1 |2 |`A2` |`A1` | 54|1 |2 |`A2` |`A2` |`A1` |`A2` |
55|1 |3 |`A3` |`A2` | 55|1 |3 |`A3` |`A3` |`A2` |`A3` |
56|1 |4 |`A4` |`A3` | 56|1 |4 |`A4` |`A4` |`A3` |`A4` |
57|1 |5 |`A5` |`F4` | 57|1 |5 |`A5` |`A5` |`F4` |`A5` |
58|1 |6 |`A6` |`C0` | 58|1 |6 |`A6` |`A6` |`C0` |`A6` |
59|1 |7 |`A7` |`C1` | 59|1 |7 |`A7` |`A7` |`C1` |`A7` |
60|1 |8 |`B0` |`C2` | 60|1 |8 |`B0` |`B0` |`C2` |`B0` |
61|1 |9 |`B1` |`C3` | 61|1 |9 |`B1` |`B1` |`C3` |`B1` |
62|1 |10 |`C0` |`F2` | 62|1 |10 |`C0` |`C0` |`F2` |`C0` |
63|1 |11 |`C1` | | 63|1 |11 |`C1` |`C1` | |`C1` |
64|1 |12 |`C2` | | 64|1 |12 |`C2` |`C2` | |`C2` |
65|1 |13 |`C3` | | 65|1 |13 |`C3` |`C3` | |`C3` |
66|1 |14 |`C4` | | 66|1 |14 |`C4` |`C4` | |`C4` |
67|1 |15 |`C5` | | 67|1 |15 |`C5` |`C5` | |`C5` |
68|1 |16 | | | 68|1 |16 | | | | |
69|2 |1 | |`A4` | 69|2 |0 | |`A0`¹ | |`A0`² |
70|2 |2 | |`A5` | 70|2 |1 | |`A1`¹ |`A4` |`A1`² |
71|2 |3 | |`A6` | 71|2 |2 | |`A2`¹ |`A5` |`A2`² |
72|2 |4 | |`A7` | 72|2 |3 | |`A3`¹ |`A6` |`A3`² |
73|2 |5 | |`C4` | 73|2 |4 | |`A4`¹ |`A7` |`A4`² |
74|2 |6 | |`C0` | 74|2 |5 | |`A5`¹ |`C4` |`A5`² |
75|2 |7 | |`C1` | 75|2 |6 | |`A6`¹ |`C0` |`A6`² |
76|2 |8 | |`C2` | 76|2 |7 | |`A7`¹ |`C1` |`A7`² |
77|2 |9 | |`C3` | 77|2 |8 | |`B0`¹ |`C2` |`B0`² |
78|2 |10 | |`F2` | 78|2 |9 | |`B1`¹ |`C3` |`B1`² |
79|2 |11 | |`C5` | 79|2 |10 | |`C0`¹ |`F2` |`C0`² |
80|2 |12 | |`B2` | 80|2 |11 | |`C1`¹ |`C5` |`C1`² |
81|2 |13 | | | 81|2 |12 | |`C2`¹ |`B2` |`C2`² |
82|2 |14 | | | 82|2 |13 | |`C3`¹ | |`C3`² |
83|2 |15 | | | 83|2 |14 | |`C4`¹ | |`C4`² |
84|2 |16 | | | 84|2 |15 | |`C5`¹ | |`C5`² |
85|3 |1 | |`B1` | 85|2 |16 | | | | |
86|3 |2 | |`E9` | 86|3 |0 | |`A0`¹ | |`A0`² |
87|3 |3 | |`E13` | 87|3 |1 | |`A1`¹ |`B1` |`A1`² |
88|3 |4 | | | 88|3 |2 | |`A2`¹ |`E9` |`A2`² |
89|3 |5 | | | 89|3 |3 | |`A3`¹ |`E13` |`A3`² |
90|3 |6 | |`E8` | 90|3 |4 | |`F6`¹ | |`F6`² |
91|3 |7 | |`D10` | 91|3 |5 | |`F7`¹ |`B13` |`F7`² |
92|3 |8 | |`D11` | 92|3 |6 | |`F8`¹ |`E8` |`F8`² |
93|3 |9 | |`D12` | 93|3 |7 | |`F9`¹ |`D10` |`F9`² |
94|3 |10 | |`D13` | 94|3 |8 | |`F10`¹ |`D11` |`F10`² |
95|3 |11 | |`D14` | 95|3 |9 | | |`D12` |`F3`² |
96|3 |12 | |`B0` | 96|3 |10 | |`C0`¹ |`D13` |`C0`² |
97|3 |13 | |`E7` | 97|3 |11 | |`C1`¹ |`D14` |`C1`² |
98|3 |14 | |`E10` | 98|3 |12 | |`C2`¹ |`B0` |`C2`² |
99|3 |15 | |`E11` | 99|3 |13 | |`C3`¹ |`E7` |`C3`² |
100|3 |16 | |`E12` | 100|3 |14 | | |`E10` |`F4`² |
101|4 |1 | |`E14` | 101|3 |15 | | |`E11` |`F5`² |
102|4 |2 | |`B12` | 102|3 |16 | | |`E12` | |
103|4 |3 | |`B13` | 103|4 |1 | | |`E14` | |
104|4 |4 | |`B14` | 104|4 |2 | | |`E15` | |
105|4 |5 | |`B15` | 105|4 |3 | | |`B12` | |
106|4 |6 | |`E8` | 106|4 |4 | | |`B14` | |
107|4 |7 | |`D10` | 107|4 |5 | | |`B15` | |
108|4 |8 | |`D11` | 108|4 |6 | | |`E8` | |
109|4 |9 | |`D12` | 109|4 |7 | | |`D10` | |
110|4 |10 | |`D13` | 110|4 |8 | | |`D11` | |
111|4 |11 | |`D14` | 111|4 |9 | | |`D12` | |
112|4 |12 | |`D8` | 112|4 |10 | | |`D13` | |
113|4 |13 | |`D9` | 113|4 |11 | | |`D14` | |
114|4 |14 | | | 114|4 |12 | | |`D8` | |
115|4 |15 | | | 115|4 |13 | | |`D9` | |
116|4 |16 | | | 116|4 |14 | | | | |
117|4 |15 | | | | |
118|4 |16 | | | | |
119
120<sup>¹ As of ChibiOS 20.3.4, the ADC driver for STM32F1xx devices supports only ADC1, therefore any configurations involving ADC2 or ADC3 cannot actually be used. In particular, pins `F6`…`F10`, which are present at least on some STM32F103x[C-G] devices, cannot be used as ADC inputs because of this driver limitation.</sup>
121
122<sup>² Not all STM32F4xx devices have ADC2 and/or ADC3, therefore some configurations shown in this table may be unavailable; in particular, pins `F4`…`F10` cannot be used as ADC inputs on devices which do not have ADC3. Check the device datasheet to confirm which pin functions are supported.</sup>
117 123
118## Functions 124## Functions
119 125
@@ -141,10 +147,10 @@ Also note that the F0 and F3 use different numbering schemes. The F0 has a singl
141 147
142The ARM implementation of the ADC has a few additional options that you can override in your own keyboards and keymaps to change how it operates. Please consult the corresponding `hal_adc_lld.h` in ChibiOS for your specific microcontroller for further documentation on your available options. 148The ARM implementation of the ADC has a few additional options that you can override in your own keyboards and keymaps to change how it operates. Please consult the corresponding `hal_adc_lld.h` in ChibiOS for your specific microcontroller for further documentation on your available options.
143 149
144|`#define` |Type |Default |Description | 150|`#define` |Type |Default |Description |
145|---------------------|------|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| 151|---------------------|------|----------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
146|`ADC_CIRCULAR_BUFFER`|`bool`|`false` |If `true`, then the implementation will use a circular buffer. | 152|`ADC_CIRCULAR_BUFFER`|`bool`|`false` |If `true`, then the implementation will use a circular buffer. |
147|`ADC_NUM_CHANNELS` |`int` |`1` |Sets the number of channels that will be scanned as part of an ADC operation. The current implementation only supports `1`. | 153|`ADC_NUM_CHANNELS` |`int` |`1` |Sets the number of channels that will be scanned as part of an ADC operation. The current implementation only supports `1`. |
148|`ADC_BUFFER_DEPTH` |`int` |`2` |Sets the depth of each result. Since we are only getting a 12-bit result by default, we set this to 2 bytes so we can contain our one value. This could be set to 1 if you opt for an 8-bit or lower result.| 154|`ADC_BUFFER_DEPTH` |`int` |`2` |Sets the depth of each result. Since we are only getting a 10-bit result by default, we set this to 2 bytes so we can contain our one value. This could be set to 1 if you opt for an 8-bit or lower result.|
149|`ADC_SAMPLING_RATE` |`int` |`ADC_SMPR_SMP_1P5` |Sets the sampling rate of the ADC. By default, it is set to the fastest setting. | 155|`ADC_SAMPLING_RATE` |`int` |`ADC_SMPR_SMP_1P5` |Sets the sampling rate of the ADC. By default, it is set to the fastest setting. |
150|`ADC_RESOLUTION` |`int` |`ADC_CFGR1_RES_12BIT`|The resolution of your result. We choose 12 bit by default, but you can opt for 12, 10, 8, or 6 bit. | 156|`ADC_RESOLUTION` |`int` |`ADC_CFGR1_RES_10BIT` or `ADC_CFGR_RES_10BITS`|The resolution of your result. We choose 10 bit by default, but you can opt for 12, 10, 8, or 6 bit. Different MCUs use slightly different names for the resolution constants. |
diff --git a/docs/breaking_changes.md b/docs/breaking_changes.md
index 0503789cd..3e85a7076 100644
--- a/docs/breaking_changes.md
+++ b/docs/breaking_changes.md
@@ -6,6 +6,7 @@ The breaking change period is when we will merge PR's that change QMK in dangero
6 6
7## What has been included in past Breaking Changes? 7## What has been included in past Breaking Changes?
8 8
9* [2021 May 29](ChangeLog/20210529.md)
9* [2021 Feb 27](ChangeLog/20210227.md) 10* [2021 Feb 27](ChangeLog/20210227.md)
10* [2020 Nov 28](ChangeLog/20201128.md) 11* [2020 Nov 28](ChangeLog/20201128.md)
11* [2020 Aug 29](ChangeLog/20200829.md) 12* [2020 Aug 29](ChangeLog/20200829.md)
@@ -15,16 +16,16 @@ The breaking change period is when we will merge PR's that change QMK in dangero
15 16
16## When is the next Breaking Change? 17## When is the next Breaking Change?
17 18
18The next Breaking Change is scheduled for May 29, 2021. 19The next Breaking Change is scheduled for August 28, 2021.
19 20
20### Important Dates 21### Important Dates
21 22
22* [x] 2021 Feb 27 - `develop` is created. Each push to `master` is subsequently merged to `develop` 23* [x] 2021 May 29 - `develop` is created. Each push to `master` is subsequently merged to `develop`
23* [ ] 2021 May 01 - `develop` closed to new PR's. 24* [ ] 2021 Jul 31 - `develop` closed to new PR's.
24* [ ] 2021 May 01 - Call for testers. 25* [ ] 2021 Jul 31 - Call for testers.
25* [ ] 2021 May 27 - `master` is locked, no PR's merged. 26* [ ] 2021 Aug 26 - `master` is locked, no PR's merged.
26* [ ] 2021 May 29 - Merge `develop` to `master`. 27* [ ] 2021 Aug 28 - Merge `develop` to `master`.
27* [ ] 2021 May 29 - `master` is unlocked. PR's can be merged again. 28* [ ] 2021 Aug 28 - `master` is unlocked. PR's can be merged again.
28 29
29## What changes will be included? 30## What changes will be included?
30 31
diff --git a/docs/breaking_changes_history.md b/docs/breaking_changes_history.md
index dd474f1bb..6ba8fe3b0 100644
--- a/docs/breaking_changes_history.md
+++ b/docs/breaking_changes_history.md
@@ -2,6 +2,7 @@
2 2
3This page links to all previous changelogs from the QMK Breaking Changes process. 3This page links to all previous changelogs from the QMK Breaking Changes process.
4 4
5* [2021 May 29](ChangeLog/20210529.md) - version 0.13.0
5* [2021 Feb 27](ChangeLog/20210227.md) - version 0.12.0 6* [2021 Feb 27](ChangeLog/20210227.md) - version 0.12.0
6* [2020 Nov 28](ChangeLog/20201128.md) - version 0.11.0 7* [2020 Nov 28](ChangeLog/20201128.md) - version 0.11.0
7* [2020 Aug 29](ChangeLog/20200829.md) - version 0.10.0 8* [2020 Aug 29](ChangeLog/20200829.md) - version 0.10.0
diff --git a/docs/cli_commands.md b/docs/cli_commands.md
index 05e930607..581342093 100644
--- a/docs/cli_commands.md
+++ b/docs/cli_commands.md
@@ -107,6 +107,54 @@ This command lets you configure the behavior of QMK. For the full `qmk config` d
107qmk config [-ro] [config_token1] [config_token2] [...] [config_tokenN] 107qmk config [-ro] [config_token1] [config_token2] [...] [config_tokenN]
108``` 108```
109 109
110## `qmk console`
111
112This command lets you connect to keyboard consoles to get debugging messages. It only works if your keyboard firmware has been compiled with `CONSOLE_ENABLED=yes`.
113
114**Usage**:
115
116```
117qmk console [-d <pid>:<vid>[:<index>]] [-l] [-n] [-t] [-w <seconds>]
118```
119
120**Examples**:
121
122Connect to all available keyboards and show their console messages:
123
124```
125qmk console
126```
127
128List all devices:
129
130```
131qmk console -l
132```
133
134Show only messages from clueboard/66/rev3 keyboards:
135
136```
137qmk console -d C1ED:2370
138```
139
140Show only messages from the second clueboard/66/rev3:
141
142```
143qmk console -d C1ED:2370:2
144```
145
146Show timestamps and VID:PID instead of names:
147
148```
149qmk console -n -t
150```
151
152Disable bootloader messages:
153
154```
155qmk console --no-bootloaders
156```
157
110## `qmk doctor` 158## `qmk doctor`
111 159
112This command examines your environment and alerts you to potential build or flash problems. It can fix many of them if you want it to. 160This command examines your environment and alerts you to potential build or flash problems. It can fix many of them if you want it to.
diff --git a/docs/compatible_microcontrollers.md b/docs/compatible_microcontrollers.md
index 47a4844e7..0f5b140de 100644
--- a/docs/compatible_microcontrollers.md
+++ b/docs/compatible_microcontrollers.md
@@ -28,8 +28,11 @@ You can also use any ARM chip with USB that [ChibiOS](https://www.chibios.org) s
28 * [STM32F303](https://www.st.com/en/microcontrollers-microprocessors/stm32f303.html) 28 * [STM32F303](https://www.st.com/en/microcontrollers-microprocessors/stm32f303.html)
29 * [STM32F401](https://www.st.com/en/microcontrollers-microprocessors/stm32f401.html) 29 * [STM32F401](https://www.st.com/en/microcontrollers-microprocessors/stm32f401.html)
30 * [STM32F411](https://www.st.com/en/microcontrollers-microprocessors/stm32f411.html) 30 * [STM32F411](https://www.st.com/en/microcontrollers-microprocessors/stm32f411.html)
31 * [STM32F446](https://www.st.com/en/microcontrollers-microprocessors/stm32f446.html)
31 * [STM32G431](https://www.st.com/en/microcontrollers-microprocessors/stm32g4x1.html) 32 * [STM32G431](https://www.st.com/en/microcontrollers-microprocessors/stm32g4x1.html)
32 * [STM32G474](https://www.st.com/en/microcontrollers-microprocessors/stm32g4x4.html) 33 * [STM32G474](https://www.st.com/en/microcontrollers-microprocessors/stm32g4x4.html)
34 * [STM32L433](https://www.st.com/en/microcontrollers-microprocessors/stm32l4x3.html)
35 * [STM32L443](https://www.st.com/en/microcontrollers-microprocessors/stm32l4x3.html)
33 36
34### NXP (Kinetis) 37### NXP (Kinetis)
35 38
diff --git a/docs/feature_auto_shift.md b/docs/feature_auto_shift.md
index 8e04d9dd3..ec7eeaaa0 100644
--- a/docs/feature_auto_shift.md
+++ b/docs/feature_auto_shift.md
@@ -109,6 +109,33 @@ Do not Auto Shift numeric keys, zero through nine.
109 109
110Do not Auto Shift alpha characters, which include A through Z. 110Do not Auto Shift alpha characters, which include A through Z.
111 111
112### Auto Shift Per Key
113
114This is a function that allows you to determine which keys shold be autoshifted, much like the tap-hold keys.
115
116The default function looks like this:
117
118```c
119bool get_auto_shifted_key(uint16_t keycode, keyrecord_t *record) {
120 switch (keycode) {
121# ifndef NO_AUTO_SHIFT_ALPHA
122 case KC_A ... KC_Z:
123# endif
124# ifndef NO_AUTO_SHIFT_NUMERIC
125 case KC_1 ... KC_0:
126# endif
127# ifndef NO_AUTO_SHIFT_SPECIAL
128 case KC_TAB:
129 case KC_MINUS ... KC_SLASH:
130 case KC_NONUS_BSLASH:
131# endif
132 return true;
133 }
134 return false;
135}
136```
137This functionality is enabled by default, and does not need a define.
138
112### AUTO_SHIFT_REPEAT (simple define) 139### AUTO_SHIFT_REPEAT (simple define)
113 140
114Enables keyrepeat. 141Enables keyrepeat.
diff --git a/docs/feature_backlight.md b/docs/feature_backlight.md
index 74511dd43..d47ecc682 100644
--- a/docs/feature_backlight.md
+++ b/docs/feature_backlight.md
@@ -62,15 +62,17 @@ Valid driver values are `pwm`, `software`, `custom` or `no`. See below for help
62 62
63To configure the backlighting, `#define` these in your `config.h`: 63To configure the backlighting, `#define` these in your `config.h`:
64 64
65| Define | Default | Description | 65|Define |Default |Description |
66|------------------------|---------------|-------------------------------------------------------------------------------------------------------------------| 66|-----------------------------|------------------|-----------------------------------------------------------------------------------------------------------------|
67| `BACKLIGHT_PIN` | *Not defined* | The pin that controls the LED(s) | 67|`BACKLIGHT_PIN` |*Not defined* |The pin that controls the LED(s) |
68| `BACKLIGHT_LEVELS` | `3` | The number of brightness levels (maximum 31 excluding off) | 68|`BACKLIGHT_LEVELS` |`3` |The number of brightness levels (maximum 31 excluding off) |
69| `BACKLIGHT_CAPS_LOCK` | *Not defined* | Enable Caps Lock indicator using backlight (for keyboards without dedicated LED) | 69|`BACKLIGHT_CAPS_LOCK` |*Not defined* |Enable Caps Lock indicator using backlight (for keyboards without dedicated LED) |
70| `BACKLIGHT_BREATHING` | *Not defined* | Enable backlight breathing, if supported | 70|`BACKLIGHT_BREATHING` |*Not defined* |Enable backlight breathing, if supported |
71| `BREATHING_PERIOD` | `6` | The length of one backlight "breath" in seconds | 71|`BREATHING_PERIOD` |`6` |The length of one backlight "breath" in seconds |
72| `BACKLIGHT_ON_STATE` | `1` | The state of the backlight pin when the backlight is "on" - `1` for high, `0` for low | 72|`BACKLIGHT_ON_STATE` |`1` |The state of the backlight pin when the backlight is "on" - `1` for high, `0` for low |
73| `BACKLIGHT_LIMIT_VAL ` | `255` | The maximum duty cycle of the backlight -- `255` allows for full brightness, any lower will decrease the maximum. | 73|`BACKLIGHT_LIMIT_VAL` |`255` |The maximum duty cycle of the backlight -- `255` allows for full brightness, any lower will decrease the maximum.|
74|`BACKLIGHT_DEFAULT_LEVEL` |`BACKLIGHT_LEVELS`|The default backlight level to use upon clearing the EEPROM |
75|`BACKLIGHT_DEFAULT_BREATHING`|*Not defined* |Whether to enable backlight breathing upon clearing the EEPROM |
74 76
75Unless you are designing your own keyboard, you generally should not need to change the `BACKLIGHT_PIN` or `BACKLIGHT_ON_STATE`. 77Unless you are designing your own keyboard, you generally should not need to change the `BACKLIGHT_PIN` or `BACKLIGHT_ON_STATE`.
76 78
diff --git a/docs/feature_encoders.md b/docs/feature_encoders.md
index 4338c85e8..a56f093a3 100644
--- a/docs/feature_encoders.md
+++ b/docs/feature_encoders.md
@@ -53,15 +53,15 @@ If you are using different pinouts for the encoders on each half of a split keyb
53The callback functions can be inserted into your `<keyboard>.c`: 53The callback functions can be inserted into your `<keyboard>.c`:
54 54
55```c 55```c
56void encoder_update_kb(uint8_t index, bool clockwise) { 56bool encoder_update_kb(uint8_t index, bool clockwise) {
57 encoder_update_user(index, clockwise); 57 return encoder_update_user(index, clockwise);
58} 58}
59``` 59```
60 60
61or `keymap.c`: 61or `keymap.c`:
62 62
63```c 63```c
64void encoder_update_user(uint8_t index, bool clockwise) { 64bool encoder_update_user(uint8_t index, bool clockwise) {
65 if (index == 0) { /* First encoder */ 65 if (index == 0) { /* First encoder */
66 if (clockwise) { 66 if (clockwise) {
67 tap_code(KC_PGDN); 67 tap_code(KC_PGDN);
@@ -75,9 +75,12 @@ void encoder_update_user(uint8_t index, bool clockwise) {
75 tap_code(KC_UP); 75 tap_code(KC_UP);
76 } 76 }
77 } 77 }
78 return true;
78} 79}
79``` 80```
80 81
82!> If you return `true`, this will allow the keyboard level code to run, as well. Returning `false` will override the keyboard level code. Depending on how the keyboard level function is set up.
83
81## Hardware 84## Hardware
82 85
83The A an B lines of the encoders should be wired directly to the MCU, and the C/common lines should be wired to ground. 86The A an B lines of the encoders should be wired directly to the MCU, and the C/common lines should be wired to ground.
diff --git a/docs/feature_leader_key.md b/docs/feature_leader_key.md
index 41ff8f1a4..f10bca758 100644
--- a/docs/feature_leader_key.md
+++ b/docs/feature_leader_key.md
@@ -72,6 +72,19 @@ SEQ_THREE_KEYS(KC_C, KC_C, KC_C) {
72} 72}
73``` 73```
74 74
75## Infinite Leader key timeout
76
77Sometimes your leader key is not on a comfortable places as the rest of keys on your sequence. Imagine that your leader key is one of your outer top right keys, you may need to reposition your hand just to reach your leader key.
78This can make typing the entire sequence on time hard even if you are able to type most of the sequence fast. For example, if your sequence is `Leader + asd` typing `asd` fast is very easy once you have your hands in your home row. However starting the sequence in time after moving your hand out of the home row to reach the leader key and back is not.
79To remove the stress this situation produces to your hands you can enable an infinite timeout just for the leader key. This mean that, after you hit the leader key you will have an infinite amount of time to start the rest of the sequence, allowing you to proper position your hands on the best position to type the rest of the sequence comfortably.
80This infinite timeout only affects the leader key, so in our previous example of `Leader + asd` you will have an infinite amount of time between `Leader` and `a`, but once you start the sequence the timeout you have configured (global or per key) will work normally.
81This way you can configure a very short `LEADER_TIMEOUT` but still have plenty of time to position your hands.
82
83In order to enable this, place this in your `config.h`:
84```c
85#define LEADER_NO_TIMEOUT
86```
87
75## Strict Key Processing 88## Strict Key Processing
76 89
77By default, the Leader Key feature will filter the keycode out of [`Mod-Tap`](mod_tap.md) and [`Layer Tap`](feature_layers.md#switching-and-toggling-layers) functions when checking for the Leader sequences. That means if you're using `LT(3, KC_A)`, it will pick this up as `KC_A` for the sequence, rather than `LT(3, KC_A)`, giving a more expected behavior for newer users. 90By default, the Leader Key feature will filter the keycode out of [`Mod-Tap`](mod_tap.md) and [`Layer Tap`](feature_layers.md#switching-and-toggling-layers) functions when checking for the Leader sequences. That means if you're using `LT(3, KC_A)`, it will pick this up as `KC_A` for the sequence, rather than `LT(3, KC_A)`, giving a more expected behavior for newer users.
diff --git a/docs/feature_led_matrix.md b/docs/feature_led_matrix.md
index f4a661634..9c3e2c7f3 100644
--- a/docs/feature_led_matrix.md
+++ b/docs/feature_led_matrix.md
@@ -1,14 +1,14 @@
1# LED Matrix Lighting 1# LED Matrix Lighting :id=led-matrix-lighting
2 2
3This feature allows you to use LED matrices driven by external drivers. It hooks into the backlight system so you can use the same keycodes as backlighting to control it. 3This feature allows you to use LED matrices driven by external drivers. It hooks into the backlight system so you can use the same keycodes as backlighting to control it.
4 4
5If you want to use RGB LED's you should use the [RGB Matrix Subsystem](feature_rgb_matrix.md) instead. 5If you want to use RGB LED's you should use the [RGB Matrix Subsystem](feature_rgb_matrix.md) instead.
6 6
7## Driver configuration 7## Driver configuration :id=driver-configuration
8---
9### IS31FL3731 :id=is31fl3731
8 10
9### IS31FL3731 11There is basic support for addressable LED matrix lighting with the I2C IS31FL3731 LED controller. To enable it, add this to your `rules.mk`:
10
11There is basic support for addressable LED matrix lighting with the I2C IS31FL3731 RGB controller. To enable it, add this to your `rules.mk`:
12 12
13```make 13```make
14LED_MATRIX_ENABLE = yes 14LED_MATRIX_ENABLE = yes
@@ -19,7 +19,7 @@ You can use between 1 and 4 IS31FL3731 IC's. Do not specify `LED_DRIVER_ADDR_<N>
19 19
20| Variable | Description | Default | 20| Variable | Description | Default |
21|----------|-------------|---------| 21|----------|-------------|---------|
22| `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages | 100 | 22| `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages, in milliseconds | 100 |
23| `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 | 23| `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 |
24| `LED_DRIVER_COUNT` | (Required) How many LED driver IC's are present | | 24| `LED_DRIVER_COUNT` | (Required) How many LED driver IC's are present | |
25| `DRIVER_LED_TOTAL` | (Required) How many LED lights are present across all drivers | | 25| `DRIVER_LED_TOTAL` | (Required) How many LED lights are present across all drivers | |
@@ -42,59 +42,336 @@ Here is an example using 2 drivers.
42#define LED_DRIVER_ADDR_2 0b1110110 42#define LED_DRIVER_ADDR_2 0b1110110
43 43
44#define LED_DRIVER_COUNT 2 44#define LED_DRIVER_COUNT 2
45#define LED_DRIVER_1_LED_COUNT 25 45#define LED_DRIVER_1_LED_TOTAL 25
46#define LED_DRIVER_2_LED_COUNT 24 46#define LED_DRIVER_2_LED_TOTAL 24
47#define DRIVER_LED_TOTAL LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL 47#define DRIVER_LED_TOTAL (LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL)
48``` 48```
49 49
50Currently only 2 drivers are supported, but it would be trivial to support all 4 combinations. 50!> Note the parentheses, this is so when `LED_DRIVER_LED_TOTAL` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL)` will give very different results than `rand() % LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL`.
51 51
52Define these arrays listing all the LEDs in your `<keyboard>.c`: 52Define these arrays listing all the LEDs in your `<keyboard>.c`:
53 53
54```c 54```c
55 const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { 55const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
56 /* Refer to IS31 manual for these locations 56/* Refer to IS31 manual for these locations
57 * driver 57 * driver
58 * | LED address 58 * | LED address
59 * | | */ 59 * | | */
60 { 0, C1_1 }, 60 { 0, C1_1 },
61 { 0, C1_15 }, 61 { 0, C1_15 },
62 // ... 62 // ...
63 } 63}
64``` 64```
65 65
66Where `Cx_y` is the location of the LED in the matrix defined by [the datasheet](https://www.issi.com/WW/pdf/31FL3731.pdf) and the header file `drivers/issi/is31fl3731-simple.h`. The `driver` is the index of the driver you defined in your `config.h` (`0`, `1`, `2`, or `3` ). 66Where `Cx_y` is the location of the LED in the matrix defined by [the datasheet](https://www.issi.com/WW/pdf/31FL3731.pdf) and the header file `drivers/issi/is31fl3731-simple.h`. The `driver` is the index of the driver you defined in your `config.h` (`0`, `1`, `2`, or `3` ).
67 67
68## Keycodes 68---
69
70From this point forward the configuration is the same for all the drivers. The `led_config_t` struct provides a key electrical matrix to led index lookup table, what the physical position of each LED is on the board, and what type of key or usage the LED if the LED represents. Here is a brief example:
71
72```c
73led_config_t g_led_config = { {
74 // Key Matrix to LED Index
75 { 5, NO_LED, NO_LED, 0 },
76 { NO_LED, NO_LED, NO_LED, NO_LED },
77 { 4, NO_LED, NO_LED, 1 },
78 { 3, NO_LED, NO_LED, 2 }
79}, {
80 // LED Index to Physical Position
81 { 188, 16 }, { 187, 48 }, { 149, 64 }, { 112, 64 }, { 37, 48 }, { 38, 16 }
82}, {
83 // LED Index to Flag
84 1, 4, 4, 4, 4, 1
85} };
86```
87
88The first part, `// Key Matrix to LED Index`, tells the system what key this LED represents by using the key's electrical matrix row & col. The second part, `// LED Index to Physical Position` represents the LED's physical `{ x, y }` position on the keyboard. The default expected range of values for `{ x, y }` is the inclusive range `{ 0..224, 0..64 }`. This default expected range is due to effects that calculate the center of the keyboard for their animations. The easiest way to calculate these positions is imagine your keyboard is a grid, and the top left of the keyboard represents `{ x, y }` coordinate `{ 0, 0 }` and the bottom right of your keyboard represents `{ 224, 64 }`. Using this as a basis, you can use the following formula to calculate the physical position:
89
90```c
91x = 224 / (NUMBER_OF_COLS - 1) * COL_POSITION
92y = 64 / (NUMBER_OF_ROWS - 1) * ROW_POSITION
93```
94
95Where NUMBER_OF_COLS, NUMBER_OF_ROWS, COL_POSITION, & ROW_POSITION are all based on the physical layout of your keyboard, not the electrical layout.
96
97As mentioned earlier, the center of the keyboard by default is expected to be `{ 112, 32 }`, but this can be changed if you want to more accurately calculate the LED's physical `{ x, y }` positions. Keyboard designers can implement `#define LED_MATRIX_CENTER { 112, 32 }` in their config.h file with the new center point of the keyboard, or where they want it to be allowing more possibilities for the `{ x, y }` values. Do note that the maximum value for x or y is 255, and the recommended maximum is 224 as this gives animations runoff room before they reset.
98
99`// LED Index to Flag` is a bitmask, whether or not a certain LEDs is of a certain type. It is recommended that LEDs are set to only 1 type.
100
101## Flags :id=flags
102
103|Define |Value |Description |
104|----------------------------|------|-------------------------------------------------|
105|`HAS_FLAGS(bits, flags)` |*n/a* |Evaluates to `true` if `bits` has all `flags` set|
106|`HAS_ANY_FLAGS(bits, flags)`|*n/a* |Evaluates to `true` if `bits` has any `flags` set|
107|`LED_FLAG_NONE` |`0x00`|If this LED has no flags |
108|`LED_FLAG_ALL` |`0xFF`|If this LED has all flags |
109|`LED_FLAG_MODIFIER` |`0x01`|If the LED is on a modifier key |
110|`LED_FLAG_KEYLIGHT` |`0x04`|If the LED is for key backlight |
111|`LED_FLAG_INDICATOR` |`0x08`|If the LED is for keyboard state indication |
112
113## Keycodes :id=keycodes
114
115All LED matrix keycodes are currently shared with the [Backlight feature](feature_backlight.md).
116
117|Key |Description |
118|---------|-----------------------------|
119|`BL_TOGG`|Toggle LED Matrix on or off |
120|`BL_STEP`|Cycle through modes |
121|`BL_ON` |Turn on LED Matrix |
122|`BL_OFF` |Turn off LED Matrix |
123|`BL_INC` |Increase the brightness level|
124|`BL_DEC` |Decrease the brightness level|
125
126## LED Matrix Effects :id=led-matrix-effects
127
128These are the effects that are currently available:
129
130```c
131enum led_matrix_effects {
132 LED_MATRIX_NONE = 0,
133 LED_MATRIX_SOLID = 1, // Static single val, no speed support
134 LED_MATRIX_ALPHAS_MODS, // Static dual val, speed is val for LEDs marked as modifiers
135 LED_MATRIX_BREATHING, // Cycling brightness animation
136 LED_MATRIX_BAND, // Band fading brightness scrolling left to right
137 LED_MATRIX_BAND_PINWHEEL, // 3 blade spinning pinwheel fades brightness
138 LED_MATRIX_BAND_SPIRAL, // Spinning spiral fades brightness
139 LED_MATRIX_CYCLE_LEFT_RIGHT, // Full gradient scrolling left to right
140 LED_MATRIX_CYCLE_UP_DOWN, // Full gradient scrolling top to bottom
141 LED_MATRIX_CYCLE_OUT_IN, // Full gradient scrolling out to in
142 LED_MATRIX_DUAL_BEACON, // Full gradient spinning around center of keyboard
143#if defined(LED_MATRIX_KEYPRESSES) || defined(LED_MATRIX_KEYRELEASES)
144 LED_MATRIX_SOLID_REACTIVE_SIMPLE, // Pulses keys hit then fades out
145 LED_MATRIX_SOLID_REACTIVE_WIDE // Value pulses near a single key hit then fades out
146 LED_MATRIX_SOLID_REACTIVE_MULTIWIDE // Value pulses near multiple key hits then fades out
147 LED_MATRIX_SOLID_REACTIVE_CROSS // Value pulses the same column and row of a single key hit then fades out
148 LED_MATRIX_SOLID_REACTIVE_MULTICROSS // Value pulses the same column and row of multiple key hits then fades out
149 LED_MATRIX_SOLID_REACTIVE_NEXUS // Value pulses away on the same column and row of a single key hit then fades out
150 LED_MATRIX_SOLID_REACTIVE_MULTINEXUS // Value pulses away on the same column and row of multiple key hits then fades out
151 LED_MATRIX_SOLID_SPLASH, // Value pulses away from a single key hit then fades out
152 LED_MATRIX_SOLID_MULTISPLASH, // Value pulses away from multiple key hits then fades out
153#endif
154 LED_MATRIX_WAVE_LEFT_RIGHT // Sine wave scrolling from left to right
155 LED_MATRIX_WAVE_UP_DOWN // Sine wave scrolling from up to down
156 LED_MATRIX_EFFECT_MAX
157};
158```
159
160You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `config.h`:
161
162
163|Define |Description |
164|-------------------------------------------------------|-----------------------------------------------|
165|`#define DISABLE_LED_MATRIX_ALPHAS_MODS` |Disables `LED_MATRIX_ALPHAS_MODS` |
166|`#define DISABLE_LED_MATRIX_BREATHING` |Disables `LED_MATRIX_BREATHING` |
167|`#define DISABLE_LED_MATRIX_BAND` |Disables `LED_MATRIX_BAND` |
168|`#define DISABLE_LED_MATRIX_BAND_PINWHEEL` |Disables `LED_MATRIX_BAND_PINWHEEL` |
169|`#define DISABLE_LED_MATRIX_BAND_SPIRAL` |Disables `LED_MATRIX_BAND_SPIRAL` |
170|`#define DISABLE_LED_MATRIX_CYCLE_LEFT_RIGHT` |Disables `LED_MATRIX_CYCLE_LEFT_RIGHT` |
171|`#define DISABLE_LED_MATRIX_CYCLE_UP_DOWN` |Disables `LED_MATRIX_CYCLE_UP_DOWN` |
172|`#define DISABLE_LED_MATRIX_CYCLE_OUT_IN` |Disables `LED_MATRIX_CYCLE_OUT_IN` |
173|`#define DISABLE_LED_MATRIX_DUAL_BEACON` |Disables `LED_MATRIX_DUAL_BEACON` |
174|`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_SIMPLE` |Disables `LED_MATRIX_SOLID_REACTIVE_SIMPLE` |
175|`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_WIDE` |Disables `LED_MATRIX_SOLID_REACTIVE_WIDE` |
176|`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTIWIDE` |Disables `LED_MATRIX_SOLID_REACTIVE_MULTIWIDE` |
177|`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_CROSS` |Disables `LED_MATRIX_SOLID_REACTIVE_CROSS` |
178|`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTICROSS` |Disables `LED_MATRIX_SOLID_REACTIVE_MULTICROSS`|
179|`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS` |Disables `LED_MATRIX_SOLID_REACTIVE_NEXUS` |
180|`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS` |Disables `LED_MATRIX_SOLID_REACTIVE_MULTINEXUS`|
181|`#define DISABLE_LED_MATRIX_SOLID_SPLASH` |Disables `LED_MATRIX_SOLID_SPLASH` |
182|`#define DISABLE_LED_MATRIX_SOLID_MULTISPLASH` |Disables `LED_MATRIX_SOLID_MULTISPLASH` |
183|`#define DISABLE_LED_MATRIX_WAVE_LEFT_RIGHT` |Disables `LED_MATRIX_WAVE_LEFT_RIGHT` |
184|`#define DISABLE_LED_MATRIX_WAVE_UP_DOWN` |Disables `LED_MATRIX_WAVE_UP_DOWN` |
185
186## Custom LED Matrix Effects :id=custom-led-matrix-effects
187
188By setting `LED_MATRIX_CUSTOM_USER` (and/or `LED_MATRIX_CUSTOM_KB`) in `rules.mk`, new effects can be defined directly from userspace, without having to edit any QMK core files.
189
190To declare new effects, create a new `led_matrix_user/kb.inc` that looks something like this:
191
192`led_matrix_user.inc` should go in the root of the keymap directory.
193`led_matrix_kb.inc` should go in the root of the keyboard directory.
194
195To use custom effects in your code, simply prepend `LED_MATRIX_CUSTOM_` to the effect name specified in `LED_MATRIX_EFFECT()`. For example, an effect declared as `LED_MATRIX_EFFECT(my_cool_effect)` would be referenced with:
196
197```c
198led_matrix_mode(led_MATRIX_CUSTOM_my_cool_effect);
199```
200
201```c
202// !!! DO NOT ADD #pragma once !!! //
203
204// Step 1.
205// Declare custom effects using the LED_MATRIX_EFFECT macro
206// (note the lack of semicolon after the macro!)
207LED_MATRIX_EFFECT(my_cool_effect)
208LED_MATRIX_EFFECT(my_cool_effect2)
209
210// Step 2.
211// Define effects inside the `LED_MATRIX_CUSTOM_EFFECT_IMPLS` ifdef block
212#ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS
213
214// e.g: A simple effect, self-contained within a single method
215static bool my_cool_effect(effect_params_t* params) {
216 LED_MATRIX_USE_LIMITS(led_min, led_max);
217 for (uint8_t i = led_min; i < led_max; i++) {
218 led_matrix_set_value(i, 0xFF);
219 }
220 return led_max < DRIVER_LED_TOTAL;
221}
222
223// e.g: A more complex effect, relying on external methods and state, with
224// dedicated init and run methods
225static uint8_t some_global_state;
226static void my_cool_effect2_complex_init(effect_params_t* params) {
227 some_global_state = 1;
228}
229static bool my_cool_effect2_complex_run(effect_params_t* params) {
230 LED_MATRIX_USE_LIMITS(led_min, led_max);
231 for (uint8_t i = led_min; i < led_max; i++) {
232 led_matrix_set_value(i, some_global_state++);
233 }
234
235 return led_max < DRIVER_LED_TOTAL;
236}
237static bool my_cool_effect2(effect_params_t* params) {
238 if (params->init) my_cool_effect2_complex_init(params);
239 return my_cool_effect2_complex_run(params);
240}
241
242#endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
243```
244
245For inspiration and examples, check out the built-in effects under `quantum/led_matrix_animations/`
246
247
248
249
250
251
252
253
254
255## Additional `config.h` Options :id=additional-configh-options
256
257```c
258#define LED_MATRIX_KEYPRESSES // reacts to keypresses
259#define LED_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
260#define LED_MATRIX_FRAMEBUFFER_EFFECTS // enable framebuffer effects
261#define LED_DISABLE_TIMEOUT 0 // number of milliseconds to wait until led automatically turns off
262#define LED_DISABLE_AFTER_TIMEOUT 0 // OBSOLETE: number of ticks to wait until disabling effects
263#define LED_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended
264#define LED_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness)
265#define LED_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
266#define LED_MATRIX_MAXIMUM_BRIGHTNESS 255 // limits maximum brightness of LEDs
267#define LED_MATRIX_STARTUP_MODE LED_MATRIX_SOLID // Sets the default mode, if none has been set
268#define LED_MATRIX_STARTUP_VAL LED_MATRIX_MAXIMUM_BRIGHTNESS // Sets the default brightness value, if none has been set
269#define LED_MATRIX_STARTUP_SPD 127 // Sets the default animation speed, if none has been set
270#define LED_MATRIX_SPLIT { X, Y } // (Optional) For split keyboards, the number of LEDs connected on each half. X = left, Y = Right.
271 // If LED_MATRIX_KEYPRESSES or LED_MATRIX_KEYRELEASES is enabled, you also will want to enable SPLIT_TRANSPORT_MIRROR
272```
273
274## EEPROM storage :id=eeprom-storage
275
276The EEPROM for it is currently shared with the RGB Matrix system (it's generally assumed only one feature would be used at a time), but could be configured to use its own 32bit address with:
277
278```c
279#define EECONFIG_LED_MATRIX (uint32_t *)28
280```
281
282Where `28` is an unused index from `eeconfig.h`.
283
284### Direct Operation :id=direct-operation
285|Function |Description |
286|--------------------------------------------|-------------|
287|`led_matrix_set_value_all(v)` |Set all of the LEDs to the given value, where `v` is between 0 and 255 (not written to EEPROM) |
288|`led_matrix_set_value(index, v)` |Set a single LED to the given value, where `v` is between 0 and 255, and `index` is between 0 and `DRIVER_LED_TOTAL` (not written to EEPROM) |
289
290### Disable/Enable Effects :id=disable-enable-effects
291|Function |Description |
292|--------------------------------------------|-------------|
293|`led_matrix_toggle()` |Toggle effect range LEDs between on and off |
294|`led_matrix_toggle_noeeprom()` |Toggle effect range LEDs between on and off (not written to EEPROM) |
295|`led_matrix_enable()` |Turn effect range LEDs on, based on their previous state |
296|`led_matrix_enable_noeeprom()` |Turn effect range LEDs on, based on their previous state (not written to EEPROM) |
297|`led_matrix_disable()` |Turn effect range LEDs off, based on their previous state |
298|`led_matrix_disable_noeeprom()` |Turn effect range LEDs off, based on their previous state (not written to EEPROM) |
69 299
70All LED matrix keycodes are currently shared with the [backlight system](feature_backlight.md). 300### Change Effect Mode :id=change-effect-mode
301|Function |Description |
302|--------------------------------------------|-------------|
303|`led_matrix_mode(mode)` |Set the mode, if LED animations are enabled |
304|`led_matrix_mode_noeeprom(mode)` |Set the mode, if LED animations are enabled (not written to EEPROM) |
305|`led_matrix_step()` |Change the mode to the next LED animation in the list of enabled LED animations |
306|`led_matrix_step_noeeprom()` |Change the mode to the next LED animation in the list of enabled LED animations (not written to EEPROM) |
307|`led_matrix_step_reverse()` |Change the mode to the previous LED animation in the list of enabled LED animations |
308|`led_matrix_step_reverse_noeeprom()` |Change the mode to the previous LED animation in the list of enabled LED animations (not written to EEPROM) |
309|`led_matrix_increase_speed()` |Increase the speed of the animations |
310|`led_matrix_increase_speed_noeeprom()` |Increase the speed of the animations (not written to EEPROM) |
311|`led_matrix_decrease_speed()` |Decrease the speed of the animations |
312|`led_matrix_decrease_speed_noeeprom()` |Decrease the speed of the animations (not written to EEPROM) |
313|`led_matrix_set_speed(speed)` |Set the speed of the animations to the given value where `speed` is between 0 and 255 |
314|`led_matrix_set_speed_noeeprom(speed)` |Set the speed of the animations to the given value where `speed` is between 0 and 255 (not written to EEPROM) |
71 315
72## LED Matrix Effects 316### Change Value :id=change-value
317|Function |Description |
318|--------------------------------------------|-------------|
319|`led_matrix_increase_val()` |Increase the value for effect range LEDs. This wraps around at maximum value |
320|`led_matrix_increase_val_noeeprom()` |Increase the value for effect range LEDs. This wraps around at maximum value (not written to EEPROM) |
321|`led_matrix_decrease_val()` |Decrease the value for effect range LEDs. This wraps around at minimum value |
322|`led_matrix_decrease_val_noeeprom()` |Decrease the value for effect range LEDs. This wraps around at minimum value (not written to EEPROM) |
73 323
74Currently no LED matrix effects have been created. 324### Query Current Status :id=query-current-status
325|Function |Description |
326|---------------------------------|---------------------------|
327|`led_matrix_is_enabled()` |Gets current on/off status |
328|`led_matrix_get_mode()` |Gets current mode |
329|`led_matrix_get_val()` |Gets current val |
330|`led_matrix_get_speed()` |Gets current speed |
331|`led_matrix_get_suspend_state()` |Gets current suspend state |
75 332
76## Custom Layer Effects 333## Callbacks :id=callbacks
77 334
78Custom layer effects can be done by defining this in your `<keyboard>.c`: 335### Indicators :id=indicators
79 336
337If you want to set custom indicators, such as an LED for Caps Lock, or layer indication, you can use the `led_matrix_indicators_kb` or `led_matrix_indicators_user` function for that:
80```c 338```c
81void led_matrix_indicators_kb(void) { 339void led_matrix_indicators_kb(void) {
82 led_matrix_set_index_value(index, value); 340 led_matrix_set_color(index, value);
83} 341}
84``` 342```
85 343
86A similar function works in the keymap as `led_matrix_indicators_user`. 344In addition, there are the advanced indicator functions. These are aimed at those with heavily customized displays, where rendering every LED per cycle is expensive. This includes a special macro to help make this easier to use: `LED_MATRIX_INDICATOR_SET_VALUE(i, v)`.
345
346```c
347void led_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
348 LED_MATRIX_INDICATOR_SET_VALUE(index, value);
349}
350```
87 351
88## Suspended State 352## Suspended State :id=suspended-state
353To use the suspend feature, make sure that `#define LED_DISABLE_WHEN_USB_SUSPENDED true` is added to the `config.h` file.
89 354
90To use the suspend feature, add this to your `<keyboard>.c`: 355Additionally add this to your `<keyboard>.c`:
91 356
92```c 357```c
93void suspend_power_down_kb(void) { 358void suspend_power_down_kb(void) {
94 led_matrix_set_suspend_state(true); 359 led_matrix_set_suspend_state(true);
360 suspend_power_down_user();
95} 361}
96 362
97void suspend_wakeup_init_kb(void) { 363void suspend_wakeup_init_kb(void) {
98 led_matrix_set_suspend_state(false); 364 led_matrix_set_suspend_state(false);
365 suspend_wakeup_init_user();
366}
367```
368or add this to your `keymap.c`:
369```c
370void suspend_power_down_user(void) {
371 led_matrix_set_suspend_state(true);
372}
373
374void suspend_wakeup_init_user(void) {
375 led_matrix_set_suspend_state(false);
99} 376}
100``` \ No newline at end of file 377```
diff --git a/docs/feature_oled_driver.md b/docs/feature_oled_driver.md
index 44202487f..d2dc6103a 100644
--- a/docs/feature_oled_driver.md
+++ b/docs/feature_oled_driver.md
@@ -145,6 +145,8 @@ void oled_task_user(void) {
145|`OLED_FONT_WIDTH` |`6` |The font width | 145|`OLED_FONT_WIDTH` |`6` |The font width |
146|`OLED_FONT_HEIGHT` |`8` |The font height (untested) | 146|`OLED_FONT_HEIGHT` |`8` |The font height (untested) |
147|`OLED_TIMEOUT` |`60000` |Turns off the OLED screen after 60000ms of keyboard inactivity. Helps reduce OLED Burn-in. Set to 0 to disable. | 147|`OLED_TIMEOUT` |`60000` |Turns off the OLED screen after 60000ms of keyboard inactivity. Helps reduce OLED Burn-in. Set to 0 to disable. |
148|`OLED_FADE_OUT` |*Not defined* |Enables fade out animation. Use together with `OLED_TIMEOUT`. |
149|`OLED_FADE_OUT_INTERVAL` |`0` |The speed of fade out animation, from 0 to 15. Larger values are slower. |
148|`OLED_SCROLL_TIMEOUT` |`0` |Scrolls the OLED screen after 0ms of OLED inactivity. Helps reduce OLED Burn-in. Set to 0 to disable. | 150|`OLED_SCROLL_TIMEOUT` |`0` |Scrolls the OLED screen after 0ms of OLED inactivity. Helps reduce OLED Burn-in. Set to 0 to disable. |
149|`OLED_SCROLL_TIMEOUT_RIGHT`|*Not defined* |Scroll timeout direction is right when defined, left when undefined. | 151|`OLED_SCROLL_TIMEOUT_RIGHT`|*Not defined* |Scroll timeout direction is right when defined, left when undefined. |
150|`OLED_IC` |`OLED_IC_SSD1306`|Set to `OLED_IC_SH1106` if you're using the SH1106 OLED controller. | 152|`OLED_IC` |`OLED_IC_SSD1306`|Set to `OLED_IC_SH1106` if you're using the SH1106 OLED controller. |
diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md
index dd9c98c5e..169443fb8 100644
--- a/docs/feature_rgb_matrix.md
+++ b/docs/feature_rgb_matrix.md
@@ -15,7 +15,20 @@ RGB_MATRIX_ENABLE = yes
15RGB_MATRIX_DRIVER = IS31FL3731 15RGB_MATRIX_DRIVER = IS31FL3731
16``` 16```
17 17
18Configure the hardware via your `config.h`: 18You can use between 1 and 4 IS31FL3731 IC's. Do not specify `DRIVER_ADDR_<N>` defines for IC's that are not present on your keyboard. You can define the following items in `config.h`:
19
20| Variable | Description | Default |
21|----------|-------------|---------|
22| `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages, in milliseconds | 100 |
23| `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 |
24| `DRIVER_COUNT` | (Required) How many RGB driver IC's are present | |
25| `DRIVER_LED_TOTAL` | (Required) How many RGB lights are present across all drivers | |
26| `DRIVER_ADDR_1` | (Required) Address for the first RGB driver | |
27| `DRIVER_ADDR_2` | (Optional) Address for the second RGB driver | |
28| `DRIVER_ADDR_3` | (Optional) Address for the third RGB driver | |
29| `DRIVER_ADDR_4` | (Optional) Address for the fourth RGB driver | |
30
31Here is an example using 2 drivers.
19 32
20```c 33```c
21// This is a 7-bit address, that gets left-shifted and bit 0 34// This is a 7-bit address, that gets left-shifted and bit 0
@@ -36,8 +49,6 @@ Configure the hardware via your `config.h`:
36 49
37!> Note the parentheses, this is so when `DRIVER_LED_TOTAL` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)` will give very different results than `rand() % DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL`. 50!> Note the parentheses, this is so when `DRIVER_LED_TOTAL` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)` will give very different results than `rand() % DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL`.
38 51
39Currently only 2 drivers are supported, but it would be trivial to support all 4 combinations.
40
41Define these arrays listing all the LEDs in your `<keyboard>.c`: 52Define these arrays listing all the LEDs in your `<keyboard>.c`:
42 53
43```c 54```c
@@ -53,12 +64,10 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
53} 64}
54``` 65```
55 66
56Where `Cx_y` is the location of the LED in the matrix defined by [the datasheet](https://www.issi.com/WW/pdf/31FL3731.pdf) and the header file `drivers/issi/is31fl3731.h`. The `driver` is the index of the driver you defined in your `config.h` (`0` or `1` right now). 67Where `Cx_y` is the location of the LED in the matrix defined by [the datasheet](https://www.issi.com/WW/pdf/31FL3731.pdf) and the header file `drivers/issi/is31fl3731.h`. The `driver` is the index of the driver you defined in your `config.h` (`0`, `1`, `2`, or `3`).
57 68
58--- 69---
59### IS31FL3733/IS31FL3737 :id=is31fl3733is31fl3737 70### IS31FL3733 :id=is31fl3733
60
61!> For the IS31FL3737, replace all instances of `IS31FL3733` below with `IS31FL3737`.
62 71
63There is basic support for addressable RGB matrix lighting with the I2C IS31FL3733 RGB controller. To enable it, add this to your `rules.mk`: 72There is basic support for addressable RGB matrix lighting with the I2C IS31FL3733 RGB controller. To enable it, add this to your `rules.mk`:
64 73
@@ -67,7 +76,24 @@ RGB_MATRIX_ENABLE = yes
67RGB_MATRIX_DRIVER = IS31FL3733 76RGB_MATRIX_DRIVER = IS31FL3733
68``` 77```
69 78
70Configure the hardware via your `config.h`: 79You can use between 1 and 4 IS31FL3733 IC's. Do not specify `DRIVER_ADDR_<N>` defines for IC's that are not present on your keyboard. You can define the following items in `config.h`:
80
81| Variable | Description | Default |
82|----------|-------------|---------|
83| `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages, in milliseconds | 100 |
84| `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 |
85| `DRIVER_COUNT` | (Required) How many RGB driver IC's are present | |
86| `DRIVER_LED_TOTAL` | (Required) How many RGB lights are present across all drivers | |
87| `DRIVER_ADDR_1` | (Required) Address for the first RGB driver | |
88| `DRIVER_ADDR_2` | (Optional) Address for the second RGB driver | |
89| `DRIVER_ADDR_3` | (Optional) Address for the third RGB driver | |
90| `DRIVER_ADDR_4` | (Optional) Address for the fourth RGB driver | |
91| `DRIVER_SYNC_1` | (Optional) Sync configuration for the first RGB driver | 0 |
92| `DRIVER_SYNC_2` | (Optional) Sync configuration for the second RGB driver | 0 |
93| `DRIVER_SYNC_3` | (Optional) Sync configuration for the third RGB driver | 0 |
94| `DRIVER_SYNC_4` | (Optional) Sync configuration for the fourth RGB driver | 0 |
95
96Here is an example using 2 drivers.
71 97
72```c 98```c
73// This is a 7-bit address, that gets left-shifted and bit 0 99// This is a 7-bit address, that gets left-shifted and bit 0
@@ -81,6 +107,58 @@ Configure the hardware via your `config.h`:
81// ADDR2 represents A3:A2 of the 7-bit address. 107// ADDR2 represents A3:A2 of the 7-bit address.
82// The result is: 0b101(ADDR2)(ADDR1) 108// The result is: 0b101(ADDR2)(ADDR1)
83#define DRIVER_ADDR_1 0b1010000 109#define DRIVER_ADDR_1 0b1010000
110#define DRIVER_ADDR_2 0b1010011
111
112#define DRIVER_COUNT 2
113#define DRIVER_1_LED_TOTAL 58
114#define DRIVER_2_LED_TOTAL 10
115#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
116```
117
118!> Note the parentheses, this is so when `DRIVER_LED_TOTAL` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)` will give very different results than `rand() % DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL`.
119
120Currently only 4 drivers are supported, but it would be trivial to support all 8 combinations.
121
122Define these arrays listing all the LEDs in your `<keyboard>.c`:
123
124```c
125const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
126/* Refer to IS31 manual for these locations
127 * driver
128 * | R location
129 * | | G location
130 * | | | B location
131 * | | | | */
132 {0, B_1, A_1, C_1},
133 ....
134}
135```
136
137Where `X_Y` is the location of the LED in the matrix defined by [the datasheet](https://www.issi.com/WW/pdf/31FL3733.pdf) and the header file `drivers/issi/is31fl3733.h`. The `driver` is the index of the driver you defined in your `config.h` (`0`, `1`, `2`, or `3` for now).
138
139---
140### IS31FL3737 :id=is31fl3737
141
142There is basic support for addressable RGB matrix lighting with the I2C IS31FL3737 RGB controller. To enable it, add this to your `rules.mk`:
143
144```makefile
145RGB_MATRIX_ENABLE = yes
146RGB_MATRIX_DRIVER = IS31FL3737
147```
148
149Configure the hardware via your `config.h`:
150
151```c
152// This is a 7-bit address, that gets left-shifted and bit 0
153// set to 0 for write, 1 for read (as per I2C protocol)
154// The address will vary depending on your wiring:
155// 0000 <-> GND
156// 0101 <-> SCL
157// 1010 <-> SDA
158// 1111 <-> VCC
159// ADDR represents A3:A0 of the 7-bit address.
160// The result is: 0b101(ADDR)
161#define DRIVER_ADDR_1 0b1010000
84#define DRIVER_ADDR_2 0b1010000 // this is here for compliancy reasons. 162#define DRIVER_ADDR_2 0b1010000 // this is here for compliancy reasons.
85 163
86#define DRIVER_COUNT 2 164#define DRIVER_COUNT 2
@@ -105,7 +183,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
105} 183}
106``` 184```
107 185
108Where `X_Y` is the location of the LED in the matrix defined by [the datasheet](https://www.issi.com/WW/pdf/31FL3733.pdf) and the header file `drivers/issi/is31fl3733.h`. The `driver` is the index of the driver you defined in your `config.h` (Only `0` right now). 186Where `X_Y` is the location of the LED in the matrix defined by [the datasheet](https://www.issi.com/WW/pdf/31FL3737.pdf) and the header file `drivers/issi/is31fl3737.h`. The `driver` is the index of the driver you defined in your `config.h` (Only `0` right now).
109 187
110--- 188---
111 189
@@ -284,7 +362,6 @@ You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `con
284 362
285|Define |Description | 363|Define |Description |
286|-------------------------------------------------------|-----------------------------------------------| 364|-------------------------------------------------------|-----------------------------------------------|
287|`#define DISABLE_RGB_MATRIX_SOLID_COLOR` |Disables `RGB_MATRIX_SOLID_COLOR` |
288|`#define DISABLE_RGB_MATRIX_ALPHAS_MODS` |Disables `RGB_MATRIX_ALPHAS_MODS` | 365|`#define DISABLE_RGB_MATRIX_ALPHAS_MODS` |Disables `RGB_MATRIX_ALPHAS_MODS` |
289|`#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN` |Disables `RGB_MATRIX_GRADIENT_UP_DOWN` | 366|`#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN` |Disables `RGB_MATRIX_GRADIENT_UP_DOWN` |
290|`#define DISABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT` |Disables `MATRIX_GRADIENT_LEFT_RIGHT` | 367|`#define DISABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT` |Disables `MATRIX_GRADIENT_LEFT_RIGHT` |
@@ -399,7 +476,7 @@ static bool my_cool_effect2(effect_params_t* params) {
399#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 476#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
400``` 477```
401 478
402For inspiration and examples, check out the built-in effects under `quantum/rgb_matrix_animation/` 479For inspiration and examples, check out the built-in effects under `quantum/rgb_matrix_animations/`
403 480
404 481
405## Colors :id=colors 482## Colors :id=colors
@@ -438,7 +515,7 @@ These are defined in [`rgblight_list.h`](https://github.com/qmk/qmk_firmware/blo
438#define RGB_MATRIX_FRAMEBUFFER_EFFECTS // enable framebuffer effects 515#define RGB_MATRIX_FRAMEBUFFER_EFFECTS // enable framebuffer effects
439#define RGB_DISABLE_TIMEOUT 0 // number of milliseconds to wait until rgb automatically turns off 516#define RGB_DISABLE_TIMEOUT 0 // number of milliseconds to wait until rgb automatically turns off
440#define RGB_DISABLE_AFTER_TIMEOUT 0 // OBSOLETE: number of ticks to wait until disabling effects 517#define RGB_DISABLE_AFTER_TIMEOUT 0 // OBSOLETE: number of ticks to wait until disabling effects
441#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended 518#define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
442#define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness) 519#define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness)
443#define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness) 520#define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
444#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 521#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
@@ -448,11 +525,13 @@ These are defined in [`rgblight_list.h`](https://github.com/qmk/qmk_firmware/blo
448#define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS // Sets the default brightness value, if none has been set 525#define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS // Sets the default brightness value, if none has been set
449#define RGB_MATRIX_STARTUP_SPD 127 // Sets the default animation speed, if none has been set 526#define RGB_MATRIX_STARTUP_SPD 127 // Sets the default animation speed, if none has been set
450#define RGB_MATRIX_DISABLE_KEYCODES // disables control of rgb matrix by keycodes (must use code functions to control the feature) 527#define RGB_MATRIX_DISABLE_KEYCODES // disables control of rgb matrix by keycodes (must use code functions to control the feature)
528#define RGB_MATRIX_SPLIT { X, Y } // (Optional) For split keyboards, the number of LEDs connected on each half. X = left, Y = Right.
529 // If RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is enabled, you also will want to enable SPLIT_TRANSPORT_MIRROR
451``` 530```
452 531
453## EEPROM storage :id=eeprom-storage 532## EEPROM storage :id=eeprom-storage
454 533
455The EEPROM for it is currently shared with the RGBLIGHT system (it's generally assumed only one RGB would be used at a time), but could be configured to use its own 32bit address with: 534The EEPROM for it is currently shared with the LED Matrix system (it's generally assumed only one feature would be used at a time), but could be configured to use its own 32bit address with:
456 535
457```c 536```c
458#define EECONFIG_RGB_MATRIX (uint32_t *)28 537#define EECONFIG_RGB_MATRIX (uint32_t *)28
diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md
index 79977b7aa..994a014a2 100644
--- a/docs/feature_rgblight.md
+++ b/docs/feature_rgblight.md
@@ -74,6 +74,7 @@ Changing the **Value** sets the overall brightness.<br>
74|`RGB_MODE_XMAS` |`RGB_M_X` |Christmas animation mode | 74|`RGB_MODE_XMAS` |`RGB_M_X` |Christmas animation mode |
75|`RGB_MODE_GRADIENT`|`RGB_M_G` |Static gradient animation mode | 75|`RGB_MODE_GRADIENT`|`RGB_M_G` |Static gradient animation mode |
76|`RGB_MODE_RGBTEST` |`RGB_M_T` |Red, Green, Blue test animation mode | 76|`RGB_MODE_RGBTEST` |`RGB_M_T` |Red, Green, Blue test animation mode |
77|`RGB_MODE_TWINKLE` |`RGB_M_TW`|Twinkle animation mode |
77 78
78!> By default, if you have both the RGB Light and the [RGB Matrix](feature_rgb_matrix.md) feature enabled, these keycodes will work for both features, at the same time. You can disable the keycode functionality by defining the `*_DISABLE_KEYCODES` option for the specific feature. 79!> By default, if you have both the RGB Light and the [RGB Matrix](feature_rgb_matrix.md) feature enabled, these keycodes will work for both features, at the same time. You can disable the keycode functionality by defining the `*_DISABLE_KEYCODES` option for the specific feature.
79 80
@@ -309,6 +310,18 @@ void post_process_record_user(uint16_t keycode, keyrecord_t *record) {
309} 310}
310``` 311```
311 312
313You can also use `rgblight_blink_layer_repeat` to specify the amount of times the layer is supposed to blink. Using the layers from above,
314```c
315void post_process_record_user(uint16_t keycode, keyrecord_t *record) {
316 switch (keycode) {
317 case DEBUG:
318 rgblight_blink_layer_repeat(debug_enable ? 0 : 1, 200, 3);
319 break;
320 }
321}
322```
323would turn the layer 0 (or 1) on and off again three times when `DEBUG` is pressed.
324
312### Overriding RGB Lighting on/off status 325### Overriding RGB Lighting on/off status
313 326
314Normally lighting layers are not shown when RGB Lighting is disabled (e.g. with `RGB_TOG` keycode). If you would like lighting layers to work even when the RGB Lighting is otherwise off, add `#define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF` to your `config.h`. 327Normally lighting layers are not shown when RGB Lighting is disabled (e.g. with `RGB_TOG` keycode). If you would like lighting layers to work even when the RGB Lighting is otherwise off, add `#define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF` to your `config.h`.
diff --git a/docs/feature_swap_hands.md b/docs/feature_swap_hands.md
index 009477d20..cbc574b6b 100644
--- a/docs/feature_swap_hands.md
+++ b/docs/feature_swap_hands.md
@@ -7,7 +7,7 @@ The swap-hands action allows support for one-handed typing without requiring a s
7The configuration table is a simple 2-dimensional array to map from column/row to new column/row. Example `hand_swap_config` for Planck: 7The configuration table is a simple 2-dimensional array to map from column/row to new column/row. Example `hand_swap_config` for Planck:
8 8
9```C 9```C
10const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { 10const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
11 {{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, 11 {{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}},
12 {{11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}}, 12 {{11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}},
13 {{11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}}, 13 {{11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}},
diff --git a/docs/feature_unicode.md b/docs/feature_unicode.md
index 1208ac006..6c3e2a1a2 100644
--- a/docs/feature_unicode.md
+++ b/docs/feature_unicode.md
@@ -230,7 +230,7 @@ send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻");
230 230
231Example uses include sending Unicode strings when a key is pressed, as described in [Macros](feature_macros.md). 231Example uses include sending Unicode strings when a key is pressed, as described in [Macros](feature_macros.md).
232 232
233### `send_unicode_hex_string()` 233### `send_unicode_hex_string()` (Deprecated)
234 234
235Similar to `send_unicode_string()`, but the characters are represented by their Unicode code points, written in hexadecimal and separated by spaces. For example, the table flip above would be achieved with: 235Similar to `send_unicode_string()`, but the characters are represented by their Unicode code points, written in hexadecimal and separated by spaces. For example, the table flip above would be achieved with:
236 236
diff --git a/docs/feature_wpm.md b/docs/feature_wpm.md
index 12dd08057..c8ec3a7f3 100644
--- a/docs/feature_wpm.md
+++ b/docs/feature_wpm.md
@@ -1,25 +1,62 @@
1# Word Per Minute (WPM) Calculcation 1# Word Per Minute (WPM) Calculcation
2 2
3The WPM feature uses time between keystrokes to compute a rolling average words 3The WPM feature uses time between keystrokes to compute a rolling average words per minute rate and makes this available for various uses.
4per minute rate and makes this available for various uses.
5 4
6Enable the WPM system by adding this to your `rules.mk`: 5Enable the WPM system by adding this to your `rules.mk`:
7 6
8 WPM_ENABLE = yes 7 WPM_ENABLE = yes
9 8
10For split keyboards using soft serial, the computed WPM 9For split keyboards using soft serial, the computed WPM score will be available on the master AND slave half.
11score will be available on the master AND slave half.
12 10
13## Public Functions 11## Configuration
14
15`uint8_t get_current_wpm(void);`
16This function returns the current WPM as an unsigned integer.
17 12
13|Define |Default | Description |
14|-----------------------------|--------------|------------------------------------------------------------------------------------------|
15|`WPM_SMOOTHING` |`0.0487` | Sets the smoothing to about 40 keystrokes |
16|`WPM_ESTIMATED_WORD_SIZE` |`5` | This is the value used when estimating average word size (for regression and normal use) |
17|`WPM_ALLOW_COUNT_REGRESSOIN` |_Not defined_ | If defined allows the WPM to be decreased when hitting Delete or Backspace |
18## Public Functions
18 19
19## Customized keys for WPM calc 20|Function |Description |
20 21|--------------------------|--------------------------------------------------|
21By default, the WPM score only includes letters, numbers, space and some 22|`get_current_wpm(void)` | Returns the current WPM as a value between 0-255 |
22punctuation. If you want to change the set of characters considered as part of 23|`set_current_wpm(x)` | Sets the current WPM to `x` (between 0-255) |
23the WPM calculation, you can implement `wpm_keycode_user(uint16_t keycode)` 24
24and return true for any characters you would like included in the calculation, 25## Callbacks
25or false to not count that particular keycode. 26
27By default, the WPM score only includes letters, numbers, space and some punctuation. If you want to change the set of characters considered as part of the WPM calculation, you can implement your own `bool wpm_keycode_user(uint16_t keycode)` and return true for any characters you would like included in the calculation, or false to not count that particular keycode.
28
29For instance, the default is:
30
31```c
32bool wpm_keycode_user(uint16_t keycode) {
33 if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) || (keycode >= QK_MODS && keycode <= QK_MODS_MAX)) {
34 keycode = keycode & 0xFF;
35 } else if (keycode > 0xFF) {
36 keycode = 0;
37 }
38 if ((keycode >= KC_A && keycode <= KC_0) || (keycode >= KC_TAB && keycode <= KC_SLASH)) {
39 return true;
40 }
41
42 return false;
43}
44```
45
46Additionally, if `WPM_ALLOW_COUNT_REGRESSION` is defined, there is the `uint8_t wpm_regress_count(uint16_t keycode)` function that allows you to decrease the WPM. This is useful if you want to be able to penalize certain keycodes (or even combinations).
47
48__attribute__((weak)) uint8_t wpm_regress_count(uint16_t keycode) {
49 bool weak_modded = (keycode >= QK_LCTL && keycode < QK_LSFT) || (keycode >= QK_RCTL && keycode < QK_RSFT);
50
51 if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) || (keycode >= QK_MODS && keycode <= QK_MODS_MAX)) {
52 keycode = keycode & 0xFF;
53 } else if (keycode > 0xFF) {
54 keycode = 0;
55 }
56 if (((get_mods() | get_oneshot_mods()) & MOD_MASK_CTRL} || weak_modded) && (keycode == KC_DEL || keycode == KC_BSPC)) {
57 return WPM_ESTIMATED_WORD_SIZE;
58 }
59 if (keycode == KC_DEL || keycode == KC_BSPC) {
60 return 1;
61 }
62}
diff --git a/docs/flashing.md b/docs/flashing.md
index 7804a6bad..83c97444e 100644
--- a/docs/flashing.md
+++ b/docs/flashing.md
@@ -249,3 +249,29 @@ Flashing sequence:
2492. Wait for the OS to detect the device 2492. Wait for the OS to detect the device
2503. Flash a .bin file 2503. Flash a .bin file
2514. Reset the device into application mode (may be done automatically) 2514. Reset the device into application mode (may be done automatically)
252
253## tinyuf2
254
255Keyboards may opt into supporting the tinyuf2 bootloader. This is currently only supported on the F411 blackpill.
256
257The `rules.mk` setting for this bootloader is `tinyuf2`, and can be specified at the keymap or user level.
258
259To ensure compatibility with the tinyuf2 bootloader, make sure this block is present in your `rules.mk`:
260
261```make
262# Bootloader selection
263BOOTLOADER = tinyuf2
264```
265
266Compatible flashers:
267
268* Any application able to copy a file from one place to another, such as _macOS Finder_ or _Windows Explorer_.
269
270Flashing sequence:
271
2721. Enter the bootloader using any of the following methods:
273 * Tap the `RESET` keycode
274 * Double-tap the `nRST` button on the PCB.
2752. Wait for the OS to detect the device
2763. Copy the .uf2 file to the new USB disk
2774. Wait for the keyboard to become available
diff --git a/docs/ja/compatible_microcontrollers.md b/docs/ja/compatible_microcontrollers.md
index fdd11f14f..b675b038d 100644
--- a/docs/ja/compatible_microcontrollers.md
+++ b/docs/ja/compatible_microcontrollers.md
@@ -33,8 +33,11 @@ QMK は十分な容量のフラッシュメモリを備えた USB 対応 AVR ま
33* [STM32F303](https://www.st.com/en/microcontrollers-microprocessors/stm32f303.html) 33* [STM32F303](https://www.st.com/en/microcontrollers-microprocessors/stm32f303.html)
34* [STM32F401](https://www.st.com/en/microcontrollers-microprocessors/stm32f401.html) 34* [STM32F401](https://www.st.com/en/microcontrollers-microprocessors/stm32f401.html)
35* [STM32F411](https://www.st.com/en/microcontrollers-microprocessors/stm32f411.html) 35* [STM32F411](https://www.st.com/en/microcontrollers-microprocessors/stm32f411.html)
36* [STM32F446](https://www.st.com/en/microcontrollers-microprocessors/stm32f446.html)
36* [STM32G431](https://www.st.com/en/microcontrollers-microprocessors/stm32g4x1.html) 37* [STM32G431](https://www.st.com/en/microcontrollers-microprocessors/stm32g4x1.html)
37* [STM32G474](https://www.st.com/en/microcontrollers-microprocessors/stm32g4x4.html) 38* [STM32G474](https://www.st.com/en/microcontrollers-microprocessors/stm32g4x4.html)
39* [STM32L433](https://www.st.com/en/microcontrollers-microprocessors/stm32l4x3.html)
40* [STM32L443](https://www.st.com/en/microcontrollers-microprocessors/stm32l4x3.html)
38 41
39### NXP (Kinetis) 42### NXP (Kinetis)
40 43
diff --git a/docs/ja/feature_led_matrix.md b/docs/ja/feature_led_matrix.md
index b73487ca6..62e22859f 100644
--- a/docs/ja/feature_led_matrix.md
+++ b/docs/ja/feature_led_matrix.md
@@ -76,7 +76,7 @@ I2C IS31FL3731 RGB コントローラを使ったアドレス指定可能な LED
76カスタムレイヤー効果は `<keyboard>.c` 内で以下を定義することで行うことができます: 76カスタムレイヤー効果は `<keyboard>.c` 内で以下を定義することで行うことができます:
77 77
78 void led_matrix_indicators_kb(void) { 78 void led_matrix_indicators_kb(void) {
79 led_matrix_set_index_value(index, value); 79 led_matrix_set_value(index, value);
80 } 80 }
81 81
82同様の関数がキーマップ内で `led_matrix_indicators_user` として動作します。 82同様の関数がキーマップ内で `led_matrix_indicators_user` として動作します。
diff --git a/docs/ja/feature_swap_hands.md b/docs/ja/feature_swap_hands.md
index 3150801c5..5164584e8 100644
--- a/docs/ja/feature_swap_hands.md
+++ b/docs/ja/feature_swap_hands.md
@@ -12,7 +12,7 @@
12設定テーブルは列/行から新しい列/行にマップするための単純な2次元配列です。Planck の `hand_swap_config` の例: 12設定テーブルは列/行から新しい列/行にマップするための単純な2次元配列です。Planck の `hand_swap_config` の例:
13 13
14```C 14```C
15const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { 15const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
16 {{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, 16 {{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}},
17 {{11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}}, 17 {{11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}},
18 {{11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}}, 18 {{11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}},
diff --git a/docs/keycodes.md b/docs/keycodes.md
index 9acf8b683..f3c519b13 100644
--- a/docs/keycodes.md
+++ b/docs/keycodes.md
@@ -516,6 +516,9 @@ See also: [One Shot Keys](one_shot_keys.md)
516|------------|----------------------------------| 516|------------|----------------------------------|
517|`OSM(mod)` |Hold `mod` for one keypress | 517|`OSM(mod)` |Hold `mod` for one keypress |
518|`OSL(layer)`|Switch to `layer` for one keypress| 518|`OSL(layer)`|Switch to `layer` for one keypress|
519|`OS_ON` |Turns One Shot keys on |
520|`OS_OFF` |Turns One Shot keys off |
521|`OS_TOGG` |Toggles One Shot keys status |
519 522
520## Space Cadet :id=space-cadet 523## Space Cadet :id=space-cadet
521 524
diff --git a/docs/one_shot_keys.md b/docs/one_shot_keys.md
index 9a082d7d6..9fc548629 100644
--- a/docs/one_shot_keys.md
+++ b/docs/one_shot_keys.md
@@ -17,6 +17,9 @@ You can control the behavior of one shot keys by defining these in `config.h`:
17 17
18* `OSM(mod)` - Momentarily hold down *mod*. You must use the `MOD_*` keycodes as shown in [Mod Tap](mod_tap.md), not the `KC_*` codes. 18* `OSM(mod)` - Momentarily hold down *mod*. You must use the `MOD_*` keycodes as shown in [Mod Tap](mod_tap.md), not the `KC_*` codes.
19* `OSL(layer)` - momentary switch to *layer*. 19* `OSL(layer)` - momentary switch to *layer*.
20* `OS_ON` - Turns on One Shot keys.
21* `OS_OFF` - Turns off One Shot keys. OSM act as regular mod keys, OSL act like `MO`.
22* `ON_TOGG` - Toggles the one shot key status.
20 23
21Sometimes, you want to activate a one-shot key as part of a macro or tap dance routine. 24Sometimes, you want to activate a one-shot key as part of a macro or tap dance routine.
22 25
diff --git a/docs/serial_driver.md b/docs/serial_driver.md
index c98f4c117..359fc5955 100644
--- a/docs/serial_driver.md
+++ b/docs/serial_driver.md
@@ -3,16 +3,18 @@ This driver powers the [Split Keyboard](feature_split_keyboard.md) feature.
3 3
4?> Serial in this context should be read as **sending information one bit at a time**, rather than implementing UART/USART/RS485/RS232 standards. 4?> Serial in this context should be read as **sending information one bit at a time**, rather than implementing UART/USART/RS485/RS232 standards.
5 5
6All drivers in this category have the following characteristics: 6Drivers in this category have the following characteristics:
7* Provides data and signaling over a single conductor 7* bit bang and USART Half-duplex provide data and signaling over a single conductor
8* Limited to single master, single slave 8* USART Full-duplex provide data and signaling over two conductors
9* They are all limited to single master and single slave communication scheme
9 10
10## Supported Driver Types 11## Supported Driver Types
11 12
12| | AVR | ARM | 13| | AVR | ARM |
13|-------------------|--------------------|--------------------| 14| ----------------- | ------------------ | ------------------ |
14| bit bang | :heavy_check_mark: | :heavy_check_mark: | 15| bit bang | :heavy_check_mark: | :heavy_check_mark: |
15| USART Half-duplex | | :heavy_check_mark: | 16| USART Half-duplex | | :heavy_check_mark: |
17| USART Full-duplex | | :heavy_check_mark: |
16 18
17## Driver configuration 19## Driver configuration
18 20
@@ -42,7 +44,7 @@ Configure the driver via your config.h:
42Along with the generic options above, you must also turn on the `PAL_USE_CALLBACKS` feature in your halconf.h. 44Along with the generic options above, you must also turn on the `PAL_USE_CALLBACKS` feature in your halconf.h.
43 45
44### USART Half-duplex 46### USART Half-duplex
45Targeting STM32 boards where communication is offloaded to a USART hardware device. The advantage is that this provides fast and accurate timings. `SOFT_SERIAL_PIN` for this driver is the configured USART TX pin. **The TX pin must have appropriate pull-up resistors**. To configure it, add this to your rules.mk: 47Targeting STM32 boards where communication is offloaded to a USART hardware device. The advantage over bitbang is that this provides fast and accurate timings. `SERIAL_PIN_TX` for this driver is the configured USART TX pin. As this Pin is configured in open-drain mode an **external pull-up resistor is needed to keep the line high** (resistor values of 1.5k to 8.2k are known to work). To configure it, add this to your rules.mk:
46 48
47```make 49```make
48SERIAL_DRIVER = usart 50SERIAL_DRIVER = usart
@@ -50,7 +52,8 @@ SERIAL_DRIVER = usart
50 52
51Configure the hardware via your config.h: 53Configure the hardware via your config.h:
52```c 54```c
53#define SOFT_SERIAL_PIN B6 // USART TX pin 55#define SOFT_SERIAL_PIN B6 // USART TX pin
56//#define USART1_REMAP // Remap USART TX and RX pins on STM32F103 MCUs, see table below.
54#define SELECT_SOFT_SERIAL_SPEED 1 // or 0, 2, 3, 4, 5 57#define SELECT_SOFT_SERIAL_SPEED 1 // or 0, 2, 3, 4, 5
55 // 0: about 460800 baud 58 // 0: about 460800 baud
56 // 1: about 230400 baud (default) 59 // 1: about 230400 baud (default)
@@ -58,7 +61,7 @@ Configure the hardware via your config.h:
58 // 3: about 57600 baud 61 // 3: about 57600 baud
59 // 4: about 38400 baud 62 // 4: about 38400 baud
60 // 5: about 19200 baud 63 // 5: about 19200 baud
61#define SERIAL_USART_DRIVER SD1 // USART driver of TX pin. default: SD1 64#define SERIAL_USART_DRIVER SD1 // USART driver of TX pin. default: SD1
62#define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7 65#define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
63#define SERIAL_USART_TIMEOUT 100 // USART driver timeout. default 100 66#define SERIAL_USART_TIMEOUT 100 // USART driver timeout. default 100
64``` 67```
@@ -68,3 +71,140 @@ You must also enable the ChibiOS `SERIAL` feature:
68* In your board's mcuconf.h: `#define STM32_SERIAL_USE_USARTn TRUE` (where 'n' matches the peripheral number of your selected USART on the MCU) 71* In your board's mcuconf.h: `#define STM32_SERIAL_USE_USARTn TRUE` (where 'n' matches the peripheral number of your selected USART on the MCU)
69 72
70Do note that the configuration required is for the `SERIAL` peripheral, not the `UART` peripheral. 73Do note that the configuration required is for the `SERIAL` peripheral, not the `UART` peripheral.
74
75### USART Full-duplex
76Targeting STM32 boards where communication is offloaded to a USART hardware device. The advantage over bitbang is that this provides fast and accurate timings. USART Full-Duplex requires two conductors **without** pull-up resistors instead of one conductor with a pull-up resistor unlike the Half-duplex driver, but it is more efficent as it uses DMA transfers, which can result in even faster transmission speeds.
77
78#### Pin configuration
79
80`SERIAL_USART_TX_PIN` is the USART `TX` pin, `SERIAL_USART_RX_PIN` is the USART `RX` pin. No external pull-up resistors are needed as the `TX` pin operates in push-pull mode. To use this driver the usart peripherals `TX` and `RX` pins must be configured with the correct Alternate-functions. If you are using a Proton-C everything is already setup, same is true for STM32F103 MCUs. For MCUs which are using a modern flexible GPIO configuration you have to specify these by setting `SERIAL_USART_TX_PAL_MODE` and `SERIAL_USART_RX_PAL_MODE`. Refeer to the corresponding datasheets of your MCU or find those settings in the table below.
81
82#### Connecting the halves and Pin Swap
83Please note that `TX` of the master half has to be connected with the `RX` pin of the slave half and `RX` of the master half has to be connected with the `TX` pin of the slave half! Usually this pin swap has to be done outside of the MCU e.g. with cables or on the pcb. Some MCUs like the STM32F303 used on the Proton-C allow this pin swap directly inside the MCU, this feature can be enabled using `#define SERIAL_USART_PIN_SWAP` in your config.h.
84
85#### Setup
86To use the driver, add this to your rules.mk:
87
88```make
89SERIAL_DRIVER = usart_duplex
90```
91
92Next configure the hardware via your config.h:
93
94```c
95#define SERIAL_USART_TX_PIN B6 // USART TX pin
96#define SERIAL_USART_RX_PIN B7 // USART RX pin
97//#define USART1_REMAP // Remap USART TX and RX pins on STM32F103 MCUs, see table below.
98//#define SERIAL_USART_PIN_SWAP // Swap TX and RX pins if keyboard is master halve.
99 // Check if this feature is necessary with your keyboard design and available on the mcu.
100#define SELECT_SOFT_SERIAL_SPEED 1 // or 0, 2, 3, 4, 5
101 // 0: 460800 baud
102 // 1: 230400 baud (default)
103 // 2: 115200 baud
104 // 3: 57600 baud
105 // 4: 38400 baud
106 // 5: 19200 baud
107#define SERIAL_USART_DRIVER UARTD1 // USART driver of TX and RX pin. default: UARTD1
108#define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
109#define SERIAL_USART_RX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
110#define SERIAL_USART_TIMEOUT 100 // USART driver timeout. default 100
111```
112
113You must also enable the ChibiOS `UART` with blocking api feature:
114* In your board's halconf.h: `#define HAL_USE_UART TRUE` and `#define UART_USE_WAIT TRUE`
115* In your board's mcuconf.h: `#define STM32_UART_USE_USARTn TRUE` (where 'n' matches the peripheral number of your selected USART on the MCU)
116
117Do note that the configuration required is for the `UART` peripheral, not the `SERIAL` peripheral.
118
119#### Pins for USART Peripherals with Alternate Functions for selected STM32 MCUs
120
121##### STM32F303 / Proton-C [Datasheet](https://www.st.com/resource/en/datasheet/stm32f303cc.pdf)
122
123Pin Swap available: :heavy_check_mark:
124
125| Pin | Function | Mode |
126| ---------- | -------- | ---- |
127| **USART1** | | |
128| PA9 | TX | AF7 |
129| PA10 | RX | AF7 |
130| PB6 | TX | AF7 |
131| PB7 | RX | AF7 |
132| PC4 | TX | AF7 |
133| PC5 | RX | AF7 |
134| PE0 | TX | AF7 |
135| PE1 | RX | AF7 |
136| **USART2** | | |
137| PA2 | TX | AF7 |
138| PA3 | RX | AF7 |
139| PA14 | TX | AF7 |
140| PA15 | RX | AF7 |
141| PB3 | TX | AF7 |
142| PB4 | RX | AF7 |
143| PD5 | TX | AF7 |
144| PD6 | RX | AF7 |
145| **USART3** | | |
146| PB10 | TX | AF7 |
147| PB11 | RX | AF7 |
148| PC10 | TX | AF7 |
149| PC11 | RX | AF7 |
150| PD8 | TX | AF7 |
151| PD9 | RX | AF7 |
152
153##### STM32F072 [Datasheet](https://www.st.com/resource/en/datasheet/stm32f072c8.pdf)
154
155Pin Swap available: :heavy_check_mark:
156
157| Pin | Function | Mode |
158| ------ | -------- | ---- |
159| USART1 | | |
160| PA9 | TX | AF1 |
161| PA10 | RX | AF1 |
162| PB6 | TX | AF0 |
163| PB7 | RX | AF0 |
164| USART2 | | |
165| PA2 | TX | AF1 |
166| PA3 | RX | AF1 |
167| PA14 | TX | AF1 |
168| PA15 | RX | AF1 |
169| USART3 | | |
170| PB10 | TX | AF4 |
171| PB11 | RX | AF4 |
172| PC4 | TX | AF1 |
173| PC5 | RX | AF1 |
174| PC10 | TX | AF1 |
175| PC11 | RX | AF1 |
176| PD8 | TX | AF0 |
177| PD9 | RX | AF0 |
178| USART4 | | |
179| PA0 | TX | AF4 |
180| PA1 | RX | AF4 |
181
182##### STM32F103 Medium Density (C8-CB) [Datasheet](https://www.st.com/resource/en/datasheet/stm32f103c8.pdf)
183
184Pin Swap available: N/A
185
186TX Pin is always Alternate Function Push-Pull, RX Pin is always regular input pin for any USART peripheral. **For STM32F103 no additional Alternate Function configuration is necessary. QMK is already configured.**
187
188Pin remapping:
189
190The pins of USART Peripherals use default Pins that can be remapped to use other pins using the AFIO registers. Default pins are marked **bold**. Add the appropriate defines to your config.h file.
191
192| Pin | Function | Mode | USART_REMAP |
193| ---------- | -------- | ---- | ------------------- |
194| **USART1** | | | |
195| **PA9** | TX | AFPP | |
196| **PA10** | RX | IN | |
197| PB6 | TX | AFPP | USART1_REMAP |
198| PB7 | RX | IN | USART1_REMAP |
199| **USART2** | | | |
200| **PA2** | TX | AFPP | |
201| **PA3** | RX | IN | |
202| PD5 | TX | AFPP | USART2_REMAP |
203| PD6 | RX | IN | USART2_REMAP |
204| **USART3** | | | |
205| **PB10** | TX | AFPP | |
206| **PB11** | RX | IN | |
207| PC10 | TX | AFPP | USART3_PARTIALREMAP |
208| PC11 | RX | IN | USART3_PARTIALREMAP |
209| PD8 | TX | AFPP | USART3_FULLREMAP |
210| PD9 | RX | IN | USART3_FULLREMAP |
diff --git a/docs/ws2812_driver.md b/docs/ws2812_driver.md
index cca6827ec..e69400364 100644
--- a/docs/ws2812_driver.md
+++ b/docs/ws2812_driver.md
@@ -77,6 +77,25 @@ Configure the hardware via your config.h:
77 77
78You must also turn on the SPI feature in your halconf.h and mcuconf.h 78You must also turn on the SPI feature in your halconf.h and mcuconf.h
79 79
80#### Circular Buffer Mode
81Some boards may flicker while in the normal buffer mode. To fix this issue, circular buffer mode may be used to rectify the issue.
82
83By default, the circular buffer mode is disabled.
84
85To enable this alternative buffer mode, place this into your `config.h` file:
86```c
87#define WS2812_SPI_USE_CIRCULAR_BUFFER
88```
89
90#### Setting baudrate with divisor
91To adjust the baudrate at which the SPI peripheral is configured, users will need to derive the target baudrate from the clock tree provided by STM32CubeMX.
92
93Only divisors of 2, 4, 8, 16, 32, 64, 128 and 256 are supported by hardware.
94
95|Define |Default|Description |
96|--------------------|-------|-------------------------------------|
97|`WS2812_SPI_DIVISOR`|`16` |SPI source clock peripheral divisor |
98
80#### Testing Notes 99#### Testing Notes
81 100
82While not an exhaustive list, the following table provides the scenarios that have been partially validated: 101While not an exhaustive list, the following table provides the scenarios that have been partially validated:
@@ -102,11 +121,14 @@ Configure the hardware via your config.h:
102#define WS2812_PWM_DRIVER PWMD2 // default: PWMD2 121#define WS2812_PWM_DRIVER PWMD2 // default: PWMD2
103#define WS2812_PWM_CHANNEL 2 // default: 2 122#define WS2812_PWM_CHANNEL 2 // default: 2
104#define WS2812_PWM_PAL_MODE 2 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2 123#define WS2812_PWM_PAL_MODE 2 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2
124//#define WS2812_PWM_COMPLEMENTARY_OUTPUT // Define for a complementary timer output (TIMx_CHyN); omit for a normal timer output (TIMx_CHy).
105#define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. 125#define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
106#define WS2812_DMA_CHANNEL 2 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. 126#define WS2812_DMA_CHANNEL 2 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
107#define WS2812_DMAMUX_ID STM32_DMAMUX1_TIM2_UP // DMAMUX configuration for TIMx_UP -- only required if your MCU has a DMAMUX peripheral, see the respective reference manual for the appropriate values for your MCU. 127#define WS2812_DMAMUX_ID STM32_DMAMUX1_TIM2_UP // DMAMUX configuration for TIMx_UP -- only required if your MCU has a DMAMUX peripheral, see the respective reference manual for the appropriate values for your MCU.
108``` 128```
109 129
130Note that using a complementary timer output (TIMx_CHyN) is possible only for advanced-control timers (TIM1, TIM8, TIM20 on STM32), and the `STM32_PWM_USE_ADVANCED` option in mcuconf.h must be set to `TRUE`. Complementary outputs of general-purpose timers are not supported due to ChibiOS limitations.
131
110You must also turn on the PWM feature in your halconf.h and mcuconf.h 132You must also turn on the PWM feature in your halconf.h and mcuconf.h
111 133
112#### Testing Notes 134#### Testing Notes