You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/blog/2021-01-27-zmk-sotf-4.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ The initial [combos](/docs/features/combos) work has landed! The amazing [okke-f
25
25
26
26
An example, that would send the `ESC` keycode when pressing both the first and second positions on your keyboard:
27
27
28
-
```
28
+
```dts
29
29
/ {
30
30
combos {
31
31
compatible = "zmk,combos";
@@ -46,13 +46,13 @@ Combos currently are "global", and not scoped to a given active layer. There is
46
46
47
47
[okke-formsma] also contributed the initial "sticky keys" behavior, which can be used for functionality sometimes called "one shot mods" or "one shot layers". In your keymap, this would like like:
48
48
49
-
```
49
+
```dts
50
50
&sk LEFT_CONTROL
51
51
```
52
52
53
53
for a sticky key/modifier, or:
54
54
55
-
```
55
+
```dts
56
56
&sl NAV
57
57
```
58
58
@@ -68,7 +68,7 @@ This is most frequently used when using multiple core base layers with different
68
68
69
69
[okke-formsma] added an implementation of the "Grave Escape" behavior, developing a more generic "mod-morph" behavior to do so. Adding
if [ -f "build/zephyr/${{ matrix.board }}.pre.tmp" ]; then cat -n build/zephyr/${{ matrix.board }}.pre.tmp; fi
37
+
if [ -f "build/zephyr/zephyr.dts" ]; then cat -n build/zephyr/zephyr.dts; fi
38
38
```
39
39
40
40
:::note
@@ -76,7 +76,7 @@ The following changes have [already been completed](https://github.com/zmkfirmwa
76
76
77
77
Zephyr's WS2812 `led_strip` driver added a new required property. When adding [underglow](/docs/features/underglow#adding-rgb-underglow-to-a-board) to a board, you now must also add the additional include `#include <dt-bindings/led/led.h>` at the top of your devicetree file, and add a `color-mapping` property like:
78
78
79
-
```
79
+
```dts
80
80
led_strip: ws2812@0 {
81
81
compatible = "worldsemi,ws2812-spi";
82
82
label = "WS2812";
@@ -108,7 +108,7 @@ Zephyr moved to using a `chosen` node named `zephyr,display` to select the displ
108
108
109
109
For example, for a shield with:
110
110
111
-
```
111
+
```dts
112
112
&pro_micro_i2c {
113
113
status = "okay";
114
114
@@ -132,7 +132,7 @@ For example, for a shield with:
132
132
133
133
You would add a `chosen` node like:
134
134
135
-
```
135
+
```dts
136
136
/ {
137
137
chosen {
138
138
zephyr,display = &oled;
@@ -148,7 +148,7 @@ two sections of the `<board>.dts` file need updating.
148
148
149
149
Underneath the USB device, add the CDC ACM node:
150
150
151
-
```
151
+
```dts
152
152
&usbd {
153
153
status = "okay";
154
154
cdc_acm_uart: cdc_acm_uart {
@@ -160,7 +160,7 @@ Underneath the USB device, add the CDC ACM node:
160
160
161
161
Then, an additional `chosen` node (near the top of the file) will mark the CDC ACM device as the console:
162
162
163
-
```
163
+
```dts
164
164
/ {
165
165
chosen {
166
166
...
@@ -175,7 +175,7 @@ Then, an additional `chosen` node (near the top of the file) will mark the CDC A
175
175
Previously, to get ZMK to build a UF2 image to flash to a given board required adding a `CMakeLists.txt` file that added a custom post build command.
176
176
Now, the only thing necessary to have Zephyr build a UF2 is to add the following to your `<board>_defconfig` file:
177
177
178
-
```
178
+
```ini
179
179
CONFIG_BUILD_OUTPUT_UF2=y
180
180
```
181
181
@@ -187,7 +187,7 @@ For more details on the implementation, see [zephyr#31066](https://github.com/ze
187
187
188
188
Clock configuration moved to devicetree as well, out of the Kconfig files. Here is a sample config for a board that uses the HSI for the PLL source:
Copy file name to clipboardexpand all lines: docs/blog/2022-04-10-zmk-sotf-5.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ to the host capitalized until a non-alpha, non-"continue list" keycode is sent.
32
32
33
33
[petejohanson], taking heavy inspiration on the initial work from [okke-formsma], added [macro support](/docs/behaviors/macros) in [#1168](https://github.com/zmkfirmware/zmk/pull/1166). Several [common patterns](/docs/behaviors/macros#common-patterns) are documented, but one example, changing the underglow color as you activate/deactivate a layer, looks like:
34
34
35
-
```
35
+
```dts
36
36
ZMK_MACRO(layer_color_macro,
37
37
wait-ms = <0>;
38
38
tap-ms = <0>;
@@ -50,7 +50,7 @@ ZMK_MACRO(layer_color_macro,
50
50
[kurtis-lew] worked diligently to add the [tap-dance behavior](/docs/behaviors/tap-dance) in [#1139](https://github.com/zmkfirmware/zmk/pull/1139), allowing different behaviors to be invoked based on the number of times
51
51
a user taps a single key in their keymap, e.g.
52
52
53
-
```
53
+
```dts
54
54
/ {
55
55
behaviors {
56
56
td0: tap_dance_0 {
@@ -80,7 +80,7 @@ a user taps a single key in their keymap, e.g.
80
80
81
81
Example:
82
82
83
-
```
83
+
```dts
84
84
/ {
85
85
conditional_layers {
86
86
compatible = "zmk,conditional-layers";
@@ -164,7 +164,7 @@ using "high voltage mode" with that SoC.
164
164
165
165
[petejohanson]'s work on the HID foundation also included adding support for full NKRO HID in [#726](https://github.com/zmkfirmware/zmk/pull/726) that can be enabled by adding the following to your `.conf` file for your config:
166
166
167
-
```
167
+
```ini
168
168
CONFIG_ZMK_HID_REPORT_TYPE_NKRO=y
169
169
```
170
170
@@ -176,7 +176,7 @@ It's been live for a while, but [nicell] added an amazing [power profiler](/powe
176
176
177
177
[malinges](https://github.com/malinges) added support for configuring min/max underglow brightness in [#944](https://github.com/zmkfirmware/zmk/pull/944) by setting the values in your `.conf` file as percentages of full:
if [ -f "build/zephyr/${{ matrix.board }}.pre.tmp" ]; then cat -n build/zephyr/${{ matrix.board }}.pre.tmp; fi
71
+
if [ -f "build/zephyr/zephyr.dts" ]; then cat -n build/zephyr/zephyr.dts; fi
72
72
```
73
73
74
74
### VS Code & Docker (Dev Container)
@@ -107,7 +107,7 @@ A few testers have reported inconsistent issues with bluetooth connections on Wi
107
107
108
108
Zephyr 3.2 introduced [a new Kconfig setting](https://github.com/zephyrproject-rtos/zephyr/pull/48929) that can be used to work around a bug in Windows related to battery reporting. Check out our [bluetooth config](/docs/config/bluetooth) for the full details. The key new configuration that can be set if using Windows is:
109
109
110
-
```
110
+
```ini
111
111
CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION=n
112
112
```
113
113
@@ -133,7 +133,7 @@ The main area this affects existing shields is those with board specific overrid
133
133
134
134
Previously in ZMK, we relied on per-driver devicetree source properties to set the alternate pin functions for things like SPI or I2C. For example, here is the I2C bus setup as it was previously on the `nice_nano` board:
135
135
136
-
```
136
+
```dts
137
137
&i2c0 {
138
138
compatible = "nordic,nrf-twi";
139
139
sda-pin = <17>;
@@ -143,7 +143,7 @@ Previously in ZMK, we relied on per-driver devicetree source properties to set t
143
143
144
144
With the move to the `pinctrl` system, this setup now look like:
145
145
146
-
```
146
+
```dts
147
147
&i2c0 {
148
148
compatible = "nordic,nrf-twi";
149
149
pinctrl-0 = <&i2c0_default>;
@@ -154,7 +154,7 @@ With the move to the `pinctrl` system, this setup now look like:
154
154
155
155
which references the `pinctrl` configuration:
156
156
157
-
```
157
+
```dts
158
158
&pinctrl {
159
159
i2c0_default: i2c0_default {
160
160
group1 {
@@ -185,7 +185,7 @@ The approach is the following when updating a _board_:
185
185
1. Add a new file with the naming convention `<board>-pinctrl.dtsi` to your board directory.
186
186
1. In the new file, add your `pinctrl` entries that set up different pin control configurations for whatever peripherals/buses are needed. Here's the nice!nano file as an example:
187
187
188
-
```
188
+
```dts
189
189
/*
190
190
* Copyright (c) 2022 The ZMK Contributors
191
191
* SPDX-License-Identifier: MIT
@@ -230,7 +230,7 @@ The approach is the following when updating a _board_:
230
230
1. From the main `<board>.dts` file, add an `#include "<board>-pinctrl.dtsi"` to have the C-preprocessor combine the files.
231
231
1. Update the various peripheral nodes to use the new `pinctrl` configurations. For example, the following old configuration:
232
232
233
-
```
233
+
```dts
234
234
&i2c0 {
235
235
compatible = "nordic,nrf-twi";
236
236
sda-pin = <15>;
@@ -240,7 +240,7 @@ The approach is the following when updating a _board_:
Copy file name to clipboardexpand all lines: docs/blog/2023-06-18-encoder-refactors.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ Splitting these two parts of the encoder configuration allows greater flexibilit
35
35
36
36
Previously, an encoder configuration looked like:
37
37
38
-
```
38
+
```dts
39
39
left_encoder: encoder_left {
40
40
compatible = "alps,ec11";
41
41
label = "LEFT_ENCODER";
@@ -47,7 +47,7 @@ Previously, an encoder configuration looked like:
47
47
48
48
Here, the `resolution` property was used to indicate how many encoder pulses should trigger the sensor behavior one time. Next, the encoder is selected in the sensors node:
49
49
50
-
```
50
+
```dts
51
51
sensors {
52
52
compatible = "zmk,keymap-sensors";
53
53
sensors = <&left_encoder &right_encoder>;
@@ -58,7 +58,7 @@ That was the entirety of the configuration for encoders.
58
58
59
59
### New Configuration
60
60
61
-
```
61
+
```dts
62
62
left_encoder: encoder_left {
63
63
compatible = "alps,ec11";
64
64
label = "LEFT_ENCODER";
@@ -70,7 +70,7 @@ That was the entirety of the configuration for encoders.
70
70
71
71
Here, the `steps` property is now used to indicate how many encoder pulses there are in a single complete rotation of the encoder. Next, the encoder is selected in the sensors node as before, but an additional configuration is used to indicate how many times the encoder should trigger the behavior in your keymap per rotation:
72
72
73
-
```
73
+
```dts
74
74
sensors {
75
75
compatible = "zmk,keymap-sensors";
76
76
sensors = <&left_encoder &right_encoder>;
@@ -84,7 +84,7 @@ For tactile encoders that have detents, the `triggers-per-rotation` would match
84
84
85
85
The configuration changes bring ZMK's code in line with how upstream Zephyr sensor drivers handle rotations. This has the added advantage of allowing us to leverage other sensor drivers. On Nordic MCUs, like nRF52840, the NRFX QDEC driver can be used, for example:
0 commit comments