aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/ChangeLog/20210529/PR12172.md13
-rw-r--r--docs/adc_driver.md154
-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_leader_key.md13
-rw-r--r--docs/feature_led_matrix.md356
-rw-r--r--docs/feature_oled_driver.md2
-rw-r--r--docs/feature_rgb_matrix.md8
-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/ws2812_driver.md22
20 files changed, 628 insertions, 141 deletions
diff --git a/docs/ChangeLog/20210529/PR12172.md b/docs/ChangeLog/20210529/PR12172.md
new file mode 100644
index 000000000..0c355c151
--- /dev/null
+++ b/docs/ChangeLog/20210529/PR12172.md
@@ -0,0 +1,13 @@
1## Bootmagic Deprecation and Refactor ([#12172](https://github.com/qmk/qmk_firmware/pull/12172))
2
3QMK has decided to deprecate the full Bootmagic feature and leave Bootmagic Lite as the only remaining option.
4
5This pull request changes the behavior of `BOOTMAGIC_ENABLE` such that specifying `BOOTMAGIC_ENABLE = yes` enables Bootmagic Lite instead of full Bootmagic.
6
7### Tentative Deprecation Schedule
8
9This is the current planned roadmap for the behavior of `BOOTMAGIC_ENABLE`:
10
11- From 2021-05-29, setting `BOOTMAGIC_ENABLE = yes` will enable Bootmagic Lite instead of full Bootmagic.
12- From 2021-08-28, `BOOTMAGIC_ENABLE` must be either `yes`, `lite`, or `no` – setting `BOOTMAGIC_ENABLE = full` will cause compilation to fail.
13- From 2021-11-27, `BOOTMAGIC_ENABLE` must be either `yes` or `no` – setting `BOOTMAGIC_ENABLE = lite` will cause compilation to fail.
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/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_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..7834b940d 100644
--- a/docs/feature_led_matrix.md
+++ b/docs/feature_led_matrix.md
@@ -1,34 +1,21 @@
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
15LED_MATRIX_DRIVER = IS31FL3731 15LED_MATRIX_DRIVER = IS31FL3731
16``` 16```
17 17
18You can use between 1 and 4 IS31FL3731 IC's. Do not specify `LED_DRIVER_ADDR_<N>` defines for IC's that are not present on your keyboard. You can define the following items in `config.h`: 18Configure the hardware via your `config.h`:
19
20| Variable | Description | Default |
21|----------|-------------|---------|
22| `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages | 100 |
23| `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 |
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 | |
26| `LED_DRIVER_ADDR_1` | (Required) Address for the first LED driver | |
27| `LED_DRIVER_ADDR_2` | (Optional) Address for the second LED driver | |
28| `LED_DRIVER_ADDR_3` | (Optional) Address for the third LED driver | |
29| `LED_DRIVER_ADDR_4` | (Optional) Address for the fourth LED driver | |
30
31Here is an example using 2 drivers.
32 19
33```c 20```c
34// This is a 7-bit address, that gets left-shifted and bit 0 21// This is a 7-bit address, that gets left-shifted and bit 0
@@ -38,63 +25,342 @@ Here is an example using 2 drivers.
38// 0b1110111 AD <-> VCC 25// 0b1110111 AD <-> VCC
39// 0b1110101 AD <-> SCL 26// 0b1110101 AD <-> SCL
40// 0b1110110 AD <-> SDA 27// 0b1110110 AD <-> SDA
41#define LED_DRIVER_ADDR_1 0b1110100 28#define DRIVER_ADDR_1 0b1110100
42#define LED_DRIVER_ADDR_2 0b1110110 29#define DRIVER_ADDR_2 0b1110110
43 30
44#define LED_DRIVER_COUNT 2 31#define DRIVER_COUNT 2
45#define LED_DRIVER_1_LED_COUNT 25 32#define DRIVER_1_LED_TOTAL 25
46#define LED_DRIVER_2_LED_COUNT 24 33#define DRIVER_2_LED_TOTAL 24
47#define DRIVER_LED_TOTAL LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL 34#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
48``` 35```
49 36
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`.
38
50Currently only 2 drivers are supported, but it would be trivial to support all 4 combinations. 39Currently only 2 drivers are supported, but it would be trivial to support all 4 combinations.
51 40
52Define these arrays listing all the LEDs in your `<keyboard>.c`: 41Define these arrays listing all the LEDs in your `<keyboard>.c`:
53 42
54```c 43```c
55 const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { 44const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
56 /* Refer to IS31 manual for these locations 45/* Refer to IS31 manual for these locations
57 * driver 46 * driver
58 * | LED address 47 * | LED address
59 * | | */ 48 * | | */
60 { 0, C1_1 }, 49 { 0, C1_1 },
61 { 0, C1_15 }, 50 { 0, C1_15 },
62 // ... 51 // ...
63 } 52}
64``` 53```
65 54
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` ). 55Where `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 56
68## Keycodes 57---
58
59From 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:
60
61```c
62led_config_t g_led_config = { {
63 // Key Matrix to LED Index
64 { 5, NO_LED, NO_LED, 0 },
65 { NO_LED, NO_LED, NO_LED, NO_LED },
66 { 4, NO_LED, NO_LED, 1 },
67 { 3, NO_LED, NO_LED, 2 }
68}, {
69 // LED Index to Physical Position
70 { 188, 16 }, { 187, 48 }, { 149, 64 }, { 112, 64 }, { 37, 48 }, { 38, 16 }
71}, {
72 // LED Index to Flag
73 1, 4, 4, 4, 4, 1
74} };
75```
76
77The 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:
78
79```c
80x = 224 / (NUMBER_OF_COLS - 1) * COL_POSITION
81y = 64 / (NUMBER_OF_ROWS - 1) * ROW_POSITION
82```
83
84Where NUMBER_OF_COLS, NUMBER_OF_ROWS, COL_POSITION, & ROW_POSITION are all based on the physical layout of your keyboard, not the electrical layout.
85
86As 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.
87
88`// 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.
89
90## Flags :id=flags
91
92|Define |Value |Description |
93|----------------------------|------|-------------------------------------------------|
94|`HAS_FLAGS(bits, flags)` |*n/a* |Evaluates to `true` if `bits` has all `flags` set|
95|`HAS_ANY_FLAGS(bits, flags)`|*n/a* |Evaluates to `true` if `bits` has any `flags` set|
96|`LED_FLAG_NONE` |`0x00`|If this LED has no flags |
97|`LED_FLAG_ALL` |`0xFF`|If this LED has all flags |
98|`LED_FLAG_MODIFIER` |`0x01`|If the LED is on a modifier key |
99|`LED_FLAG_KEYLIGHT` |`0x04`|If the LED is for key backlight |
100|`LED_FLAG_INDICATOR` |`0x08`|If the LED is for keyboard state indication |
101
102## Keycodes :id=keycodes
103
104All LED matrix keycodes are currently shared with the [Backlight feature](feature_backlight.md).
105
106|Key |Description |
107|---------|-----------------------------|
108|`BL_TOGG`|Toggle LED Matrix on or off |
109|`BL_STEP`|Cycle through modes |
110|`BL_ON` |Turn on LED Matrix |
111|`BL_OFF` |Turn off LED Matrix |
112|`BL_INC` |Increase the brightness level|
113|`BL_DEC` |Decrease the brightness level|
69 114
70All LED matrix keycodes are currently shared with the [backlight system](feature_backlight.md). 115## LED Matrix Effects :id=led-matrix-effects
71 116
72## LED Matrix Effects 117These are the effects that are currently available:
73 118
74Currently no LED matrix effects have been created. 119```c
120enum led_matrix_effects {
121 LED_MATRIX_NONE = 0,
122 LED_MATRIX_SOLID = 1, // Static single val, no speed support
123 LED_MATRIX_ALPHAS_MODS, // Static dual val, speed is val for LEDs marked as modifiers
124 LED_MATRIX_BREATHING, // Cycling brightness animation
125 LED_MATRIX_BAND, // Band fading brightness scrolling left to right
126 LED_MATRIX_BAND_PINWHEEL, // 3 blade spinning pinwheel fades brightness
127 LED_MATRIX_BAND_SPIRAL, // Spinning spiral fades brightness
128 LED_MATRIX_CYCLE_LEFT_RIGHT, // Full gradient scrolling left to right
129 LED_MATRIX_CYCLE_UP_DOWN, // Full gradient scrolling top to bottom
130 LED_MATRIX_CYCLE_OUT_IN, // Full gradient scrolling out to in
131 LED_MATRIX_DUAL_BEACON, // Full gradient spinning around center of keyboard
132#if defined(LED_MATRIX_KEYPRESSES) || defined(LED_MATRIX_KEYRELEASES)
133 LED_MATRIX_SOLID_REACTIVE_SIMPLE, // Pulses keys hit then fades out
134 LED_MATRIX_SOLID_REACTIVE_WIDE // Value pulses near a single key hit then fades out
135 LED_MATRIX_SOLID_REACTIVE_MULTIWIDE // Value pulses near multiple key hits then fades out
136 LED_MATRIX_SOLID_REACTIVE_CROSS // Value pulses the same column and row of a single key hit then fades out
137 LED_MATRIX_SOLID_REACTIVE_MULTICROSS // Value pulses the same column and row of multiple key hits then fades out
138 LED_MATRIX_SOLID_REACTIVE_NEXUS // Value pulses away on the same column and row of a single key hit then fades out
139 LED_MATRIX_SOLID_REACTIVE_MULTINEXUS // Value pulses away on the same column and row of multiple key hits then fades out
140 LED_MATRIX_SOLID_SPLASH, // Value pulses away from a single key hit then fades out
141 LED_MATRIX_SOLID_MULTISPLASH, // Value pulses away from multiple key hits then fades out
142#endif
143 LED_MATRIX_WAVE_LEFT_RIGHT // Sine wave scrolling from left to right
144 LED_MATRIX_WAVE_UP_DOWN // Sine wave scrolling from up to down
145 LED_MATRIX_EFFECT_MAX
146};
147```
148
149You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `config.h`:
150
151
152|Define |Description |
153|-------------------------------------------------------|-----------------------------------------------|
154|`#define DISABLE_LED_MATRIX_SOLID` |Disables `LED_MATRIX_SOLID` |
155|`#define DISABLE_LED_MATRIX_ALPHAS_MODS` |Disables `LED_MATRIX_ALPHAS_MODS` |
156|`#define DISABLE_LED_MATRIX_BREATHING` |Disables `LED_MATRIX_BREATHING` |
157|`#define DISABLE_LED_MATRIX_BAND` |Disables `LED_MATRIX_BAND` |
158|`#define DISABLE_LED_MATRIX_BAND_PINWHEEL` |Disables `LED_MATRIX_BAND_PINWHEEL` |
159|`#define DISABLE_LED_MATRIX_BAND_SPIRAL` |Disables `LED_MATRIX_BAND_SPIRAL` |
160|`#define DISABLE_LED_MATRIX_CYCLE_LEFT_RIGHT` |Disables `LED_MATRIX_CYCLE_LEFT_RIGHT` |
161|`#define DISABLE_LED_MATRIX_CYCLE_UP_DOWN` |Disables `LED_MATRIX_CYCLE_UP_DOWN` |
162|`#define DISABLE_LED_MATRIX_CYCLE_OUT_IN` |Disables `LED_MATRIX_CYCLE_OUT_IN` |
163|`#define DISABLE_LED_MATRIX_DUAL_BEACON` |Disables `LED_MATRIX_DUAL_BEACON` |
164|`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_SIMPLE` |Disables `LED_MATRIX_SOLID_REACTIVE_SIMPLE` |
165|`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_WIDE` |Disables `LED_MATRIX_SOLID_REACTIVE_WIDE` |
166|`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTIWIDE` |Disables `LED_MATRIX_SOLID_REACTIVE_MULTIWIDE` |
167|`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_CROSS` |Disables `LED_MATRIX_SOLID_REACTIVE_CROSS` |
168|`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTICROSS` |Disables `LED_MATRIX_SOLID_REACTIVE_MULTICROSS`|
169|`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS` |Disables `LED_MATRIX_SOLID_REACTIVE_NEXUS` |
170|`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS` |Disables `LED_MATRIX_SOLID_REACTIVE_MULTINEXUS`|
171|`#define DISABLE_LED_MATRIX_SOLID_SPLASH` |Disables `LED_MATRIX_SOLID_SPLASH` |
172|`#define DISABLE_LED_MATRIX_SOLID_MULTISPLASH` |Disables `LED_MATRIX_SOLID_MULTISPLASH` |
173|`#define DISABLE_LED_MATRIX_WAVE_LEFT_RIGHT` |Disables `LED_MATRIX_WAVE_LEFT_RIGHT` |
174|`#define DISABLE_LED_MATRIX_WAVE_UP_DOWN` |Disables `LED_MATRIX_WAVE_UP_DOWN` |
175
176## Custom LED Matrix Effects :id=custom-led-matrix-effects
75 177
76## Custom Layer Effects 178By 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.
77 179
78Custom layer effects can be done by defining this in your `<keyboard>.c`: 180To declare new effects, create a new `led_matrix_user/kb.inc` that looks something like this:
181
182`led_matrix_user.inc` should go in the root of the keymap directory.
183`led_matrix_kb.inc` should go in the root of the keyboard directory.
184
185To 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:
186
187```c
188led_matrix_mode(led_MATRIX_CUSTOM_my_cool_effect);
189```
79 190
80```c 191```c
192// !!! DO NOT ADD #pragma once !!! //
193
194// Step 1.
195// Declare custom effects using the LED_MATRIX_EFFECT macro
196// (note the lack of semicolon after the macro!)
197LED_MATRIX_EFFECT(my_cool_effect)
198LED_MATRIX_EFFECT(my_cool_effect2)
199
200// Step 2.
201// Define effects inside the `LED_MATRIX_CUSTOM_EFFECT_IMPLS` ifdef block
202#ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS
203
204// e.g: A simple effect, self-contained within a single method
205static bool my_cool_effect(effect_params_t* params) {
206 LED_MATRIX_USE_LIMITS(led_min, led_max);
207 for (uint8_t i = led_min; i < led_max; i++) {
208 led_matrix_set_value(i, 0xFF);
209 }
210 return led_max < DRIVER_LED_TOTAL;
211}
212
213// e.g: A more complex effect, relying on external methods and state, with
214// dedicated init and run methods
215static uint8_t some_global_state;
216static void my_cool_effect2_complex_init(effect_params_t* params) {
217 some_global_state = 1;
218}
219static bool my_cool_effect2_complex_run(effect_params_t* params) {
220 LED_MATRIX_USE_LIMITS(led_min, led_max);
221 for (uint8_t i = led_min; i < led_max; i++) {
222 led_matrix_set_value(i, some_global_state++);
223 }
224
225 return led_max < DRIVER_LED_TOTAL;
226}
227static bool my_cool_effect2(effect_params_t* params) {
228 if (params->init) my_cool_effect2_complex_init(params);
229 return my_cool_effect2_complex_run(params);
230}
231
232#endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
233```
234
235For inspiration and examples, check out the built-in effects under `quantum/led_matrix_animations/`
236
237
238
239
240
241
242
243
244
245## Additional `config.h` Options :id=additional-configh-options
246
247```c
248#define LED_MATRIX_KEYPRESSES // reacts to keypresses
249#define LED_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
250#define LED_DISABLE_TIMEOUT 0 // number of milliseconds to wait until led automatically turns off
251#define LED_DISABLE_AFTER_TIMEOUT 0 // OBSOLETE: number of ticks to wait until disabling effects
252#define LED_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended
253#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)
254#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)
255#define LED_MATRIX_MAXIMUM_BRIGHTNESS 255 // limits maximum brightness of LEDs
256#define LED_MATRIX_STARTUP_MODE LED_MATRIX_SOLID // Sets the default mode, if none has been set
257#define LED_MATRIX_STARTUP_VAL LED_MATRIX_MAXIMUM_BRIGHTNESS // Sets the default brightness value, if none has been set
258#define LED_MATRIX_STARTUP_SPD 127 // Sets the default animation speed, if none has been set
259#define LED_MATRIX_SPLIT { X, Y } // (Optional) For split keyboards, the number of LEDs connected on each half. X = left, Y = Right.
260 // If LED_MATRIX_KEYPRESSES or LED_MATRIX_KEYRELEASES is enabled, you also will want to enable SPLIT_TRANSPORT_MIRROR
261```
262
263## EEPROM storage :id=eeprom-storage
264
265The 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:
266
267```c
268#define EECONFIG_LED_MATRIX (uint32_t *)28
269```
270
271Where `28` is an unused index from `eeconfig.h`.
272
273### Direct Operation :id=direct-operation
274|Function |Description |
275|--------------------------------------------|-------------|
276|`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) |
277|`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) |
278
279### Disable/Enable Effects :id=disable-enable-effects
280|Function |Description |
281|--------------------------------------------|-------------|
282|`led_matrix_toggle()` |Toggle effect range LEDs between on and off |
283|`led_matrix_toggle_noeeprom()` |Toggle effect range LEDs between on and off (not written to EEPROM) |
284|`led_matrix_enable()` |Turn effect range LEDs on, based on their previous state |
285|`led_matrix_enable_noeeprom()` |Turn effect range LEDs on, based on their previous state (not written to EEPROM) |
286|`led_matrix_disable()` |Turn effect range LEDs off, based on their previous state |
287|`led_matrix_disable_noeeprom()` |Turn effect range LEDs off, based on their previous state (not written to EEPROM) |
288
289### Change Effect Mode :id=change-effect-mode
290|Function |Description |
291|--------------------------------------------|-------------|
292|`led_matrix_mode(mode)` |Set the mode, if LED animations are enabled |
293|`led_matrix_mode_noeeprom(mode)` |Set the mode, if LED animations are enabled (not written to EEPROM) |
294|`led_matrix_step()` |Change the mode to the next LED animation in the list of enabled LED animations |
295|`led_matrix_step_noeeprom()` |Change the mode to the next LED animation in the list of enabled LED animations (not written to EEPROM) |
296|`led_matrix_step_reverse()` |Change the mode to the previous LED animation in the list of enabled LED animations |
297|`led_matrix_step_reverse_noeeprom()` |Change the mode to the previous LED animation in the list of enabled LED animations (not written to EEPROM) |
298|`led_matrix_increase_speed()` |Increase the speed of the animations |
299|`led_matrix_increase_speed_noeeprom()` |Increase the speed of the animations (not written to EEPROM) |
300|`led_matrix_decrease_speed()` |Decrease the speed of the animations |
301|`led_matrix_decrease_speed_noeeprom()` |Decrease the speed of the animations (not written to EEPROM) |
302|`led_matrix_set_speed(speed)` |Set the speed of the animations to the given value where `speed` is between 0 and 255 |
303|`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) |
304
305### Change Value :id=change-value
306|Function |Description |
307|--------------------------------------------|-------------|
308|`led_matrix_increase_val()` |Increase the value for effect range LEDs. This wraps around at maximum value |
309|`led_matrix_increase_val_noeeprom()` |Increase the value for effect range LEDs. This wraps around at maximum value (not written to EEPROM) |
310|`led_matrix_decrease_val()` |Decrease the value for effect range LEDs. This wraps around at minimum value |
311|`led_matrix_decrease_val_noeeprom()` |Decrease the value for effect range LEDs. This wraps around at minimum value (not written to EEPROM) |
312
313### Query Current Status :id=query-current-status
314|Function |Description |
315|---------------------------------|---------------------------|
316|`led_matrix_is_enabled()` |Gets current on/off status |
317|`led_matrix_get_mode()` |Gets current mode |
318|`led_matrix_get_val()` |Gets current val |
319|`led_matrix_get_speed()` |Gets current speed |
320|`led_matrix_get_suspend_state()` |Gets current suspend state |
321
322## Callbacks :id=callbacks
323
324### Indicators :id=indicators
325
326If 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:
327```c
81void led_matrix_indicators_kb(void) { 328void led_matrix_indicators_kb(void) {
82 led_matrix_set_index_value(index, value); 329 led_matrix_set_color(index, value);
83} 330}
84``` 331```
85 332
86A similar function works in the keymap as `led_matrix_indicators_user`. 333In 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)`.
334
335```c
336void led_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
337 LED_MATRIX_INDICATOR_SET_VALUE(index, value);
338}
339```
87 340
88## Suspended State 341## Suspended State :id=suspended-state
342To use the suspend feature, make sure that `#define LED_DISABLE_WHEN_USB_SUSPENDED true` is added to the `config.h` file.
89 343
90To use the suspend feature, add this to your `<keyboard>.c`: 344Additionally add this to your `<keyboard>.c`:
91 345
92```c 346```c
93void suspend_power_down_kb(void) { 347void suspend_power_down_kb(void) {
94 led_matrix_set_suspend_state(true); 348 led_matrix_set_suspend_state(true);
349 suspend_power_down_user();
95} 350}
96 351
97void suspend_wakeup_init_kb(void) { 352void suspend_wakeup_init_kb(void) {
98 led_matrix_set_suspend_state(false); 353 led_matrix_set_suspend_state(false);
354 suspend_wakeup_init_user();
355}
356```
357or add this to your `keymap.c`:
358```c
359void suspend_power_down_user(void) {
360 led_matrix_set_suspend_state(true);
361}
362
363void suspend_wakeup_init_user(void) {
364 led_matrix_set_suspend_state(false);
99} 365}
100``` \ No newline at end of file 366```
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 e996caddd..ffbb8c0b6 100644
--- a/docs/feature_rgb_matrix.md
+++ b/docs/feature_rgb_matrix.md
@@ -399,7 +399,7 @@ static bool my_cool_effect2(effect_params_t* params) {
399#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 399#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
400``` 400```
401 401
402For inspiration and examples, check out the built-in effects under `quantum/rgb_matrix_animation/` 402For inspiration and examples, check out the built-in effects under `quantum/rgb_matrix_animations/`
403 403
404 404
405## Colors :id=colors 405## Colors :id=colors
@@ -437,7 +437,7 @@ These are defined in [`rgblight_list.h`](https://github.com/qmk/qmk_firmware/blo
437#define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses) 437#define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
438#define RGB_DISABLE_TIMEOUT 0 // number of milliseconds to wait until rgb automatically turns off 438#define RGB_DISABLE_TIMEOUT 0 // number of milliseconds to wait until rgb automatically turns off
439#define RGB_DISABLE_AFTER_TIMEOUT 0 // OBSOLETE: number of ticks to wait until disabling effects 439#define RGB_DISABLE_AFTER_TIMEOUT 0 // OBSOLETE: number of ticks to wait until disabling effects
440#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended 440#define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
441#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) 441#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)
442#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) 442#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)
443#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 443#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
@@ -447,11 +447,13 @@ These are defined in [`rgblight_list.h`](https://github.com/qmk/qmk_firmware/blo
447#define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS // Sets the default brightness value, if none has been set 447#define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS // Sets the default brightness value, if none has been set
448#define RGB_MATRIX_STARTUP_SPD 127 // Sets the default animation speed, if none has been set 448#define RGB_MATRIX_STARTUP_SPD 127 // Sets the default animation speed, if none has been set
449#define RGB_MATRIX_DISABLE_KEYCODES // disables control of rgb matrix by keycodes (must use code functions to control the feature) 449#define RGB_MATRIX_DISABLE_KEYCODES // disables control of rgb matrix by keycodes (must use code functions to control the feature)
450#define RGB_MATRIX_SPLIT { X, Y } // (Optional) For split keyboards, the number of LEDs connected on each half. X = left, Y = Right.
451 // If RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is enabled, you also will want to enable SPLIT_TRANSPORT_MIRROR
450``` 452```
451 453
452## EEPROM storage :id=eeprom-storage 454## EEPROM storage :id=eeprom-storage
453 455
454The 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: 456The 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:
455 457
456```c 458```c
457#define EECONFIG_RGB_MATRIX (uint32_t *)28 459#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/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