aboutsummaryrefslogtreecommitdiffhomepage
path: root/app
diff options
context:
space:
mode:
authorPeter Johanson <[email protected]>2023-12-31 00:57:00 +0000
committerPete Johanson <[email protected]>2024-03-27 20:59:26 -0700
commitc3144055e8534169bf1a6d798b1ee712f6c1d002 (patch)
treec1d9eeb61a2c544388cdd79b893a375a38a5c736 /app
parenta0ad1d4c9402fbfe5e3dee8996057150a3f0f209 (diff)
downloadzmk-c3144055e8534169bf1a6d798b1ee712f6c1d002.tar.gz
zmk-c3144055e8534169bf1a6d798b1ee712f6c1d002.zip
refactor(boards): Move ZMK Uno 1P3T slider to sideband
* Invoke output selection from the slider on the ZMK Uno via sideband behavior setup, to simplify keymap.
Diffstat (limited to 'app')
-rw-r--r--app/boards/shields/zmk_uno/zmk_uno.dtsi36
-rw-r--r--app/boards/shields/zmk_uno/zmk_uno.keymap21
-rw-r--r--app/boards/shields/zmk_uno/zmk_uno.overlay40
-rw-r--r--app/boards/shields/zmk_uno/zmk_uno_split.dtsi10
-rw-r--r--app/boards/shields/zmk_uno/zmk_uno_split.keymap18
5 files changed, 46 insertions, 79 deletions
diff --git a/app/boards/shields/zmk_uno/zmk_uno.dtsi b/app/boards/shields/zmk_uno/zmk_uno.dtsi
index 196ac8b500..e8ba79d6d0 100644
--- a/app/boards/shields/zmk_uno/zmk_uno.dtsi
+++ b/app/boards/shields/zmk_uno/zmk_uno.dtsi
@@ -40,7 +40,7 @@ nice_view_spi: &arduino_spi {
/ {
chosen {
- zmk,kscan = &kscan_matrix_comp;
+ zmk,kscan = &kscan_matrix;
zmk,backlight = &backlight;
zmk,underglow = &led_strip;
zmk,matrix-transform = &matrix_transform;
@@ -74,7 +74,6 @@ nice_view_spi: &arduino_spi {
map = <
RC(0,0) RC(0,1)
RC(1,0) RC(1,1)
- RC(2,0) RC(2,1) RC(2,2)
>;
};
@@ -86,42 +85,9 @@ nice_view_spi: &arduino_spi {
map = <
RC(0,0) RC(0,1)
RC(0,2) RC(0,3)
- RC(1,0) RC(1,1) RC(1,2)
>;
};
-
- kscan_matrix_comp: kscan_matrix_comp {
- compatible = "zmk,kscan-composite";
- rows = <1>;
- columns = <7>;
-
- matrix {
- kscan = <&kscan_matrix>;
- };
-
- toggle {
- kscan = <&kscan_sp3t_toggle>;
- row-offset = <2>;
- };
-
- };
-
- kscan_direct_comp: kscan_direct_comp {
- compatible = "zmk,kscan-composite";
- status = "disabled";
-
- matrix {
- kscan = <&kscan_direct>;
- };
-
- toggle {
- kscan = <&kscan_sp3t_toggle>;
- row-offset = <1>;
- };
-
- };
-
kscan_matrix: kscan_matrix {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diff --git a/app/boards/shields/zmk_uno/zmk_uno.keymap b/app/boards/shields/zmk_uno/zmk_uno.keymap
index 0e0fc7954c..e416ff5e6c 100644
--- a/app/boards/shields/zmk_uno/zmk_uno.keymap
+++ b/app/boards/shields/zmk_uno/zmk_uno.keymap
@@ -9,42 +9,25 @@
#include <dt-bindings/zmk/backlight.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/ext_power.h>
-#include <dt-bindings/zmk/outputs.h>
#include <dt-bindings/zmk/rgb.h>
// Uncomment the following block if using the "Direct Wire" jumper to switch the matrix to a direct wire.
/* :REMOVE ME
-&kscan_direct_comp { status = "okay"; };
&kscan_direct { status = "okay"; };
-&kscan_matrix_comp { status = "disabled"; };
&kscan_matrix { status = "disabled"; };
/ {
chosen {
zmk,matrix-transform = &direct_matrix_transform;
- zmk,kscan = &kscan_direct_comp;
+ zmk,kscan = &kscan_direct;
};
};
REMOVE ME: */
-
/ {
- macros {
- ZMK_MACRO(ble_zero,
- wait-ms = <1>;
- tap-ms = <1>;
- bindings = <&out OUT_BLE &bt BT_SEL 0>;
- )
- ZMK_MACRO(ble_one,
- wait-ms = <1>;
- tap-ms = <1>;
- bindings = <&out OUT_BLE &bt BT_SEL 1>;
- )
- };
-
keymap {
compatible = "zmk,keymap";
@@ -52,8 +35,6 @@ REMOVE ME: */
bindings = <
&kp A &bl BL_TOG
&rgb_ug RGB_EFF &bt BT_CLR
-
- &out OUT_USB &ble_zero &ble_one
>;
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
diff --git a/app/boards/shields/zmk_uno/zmk_uno.overlay b/app/boards/shields/zmk_uno/zmk_uno.overlay
index 4999c82c7e..c86f6e5c9e 100644
--- a/app/boards/shields/zmk_uno/zmk_uno.overlay
+++ b/app/boards/shields/zmk_uno/zmk_uno.overlay
@@ -6,6 +6,10 @@
#include "zmk_uno.dtsi"
+#include <behaviors.dtsi>
+#include <dt-bindings/zmk/bt.h>
+#include <dt-bindings/zmk/outputs.h>
+
/ {
chosen {
zmk,matrix-transform = &matrix_transform;
@@ -19,4 +23,40 @@
};
};
+ macros {
+ ZMK_MACRO(ble_zero,
+ wait-ms = <1>;
+ tap-ms = <1>;
+ bindings = <&out OUT_BLE &bt BT_SEL 0>;
+ )
+ ZMK_MACRO(ble_one,
+ wait-ms = <1>;
+ tap-ms = <1>;
+ bindings = <&out OUT_BLE &bt BT_SEL 1>;
+ )
+ };
+
+ endpoint_sideband_behaviors {
+ compatible = "zmk,kscan-sideband-behaviors";
+ kscan = <&kscan_sp3t_toggle>;
+
+ usb {
+ row = <0>;
+ column = <0>;
+ bindings = <&out OUT_USB>;
+ };
+
+ ble_zero {
+ row = <0>;
+ column = <1>;
+ bindings = <&ble_zero>;
+ };
+
+ ble_one {
+ row = <0>;
+ column = <2>;
+ bindings = <&ble_one>;
+ };
+ };
+
};
diff --git a/app/boards/shields/zmk_uno/zmk_uno_split.dtsi b/app/boards/shields/zmk_uno/zmk_uno_split.dtsi
index 516213bd44..dac6fc3e4e 100644
--- a/app/boards/shields/zmk_uno/zmk_uno_split.dtsi
+++ b/app/boards/shields/zmk_uno/zmk_uno_split.dtsi
@@ -17,16 +17,15 @@
split_matrix_transform: split_matrix_transform {
compatible = "zmk,matrix-transform";
- rows = <3>;
- columns = <4>;
+ rows = <4>;
+ columns = <2>;
map = <
RC(0,0) RC(0,1)
RC(1,0) RC(1,1)
- RC(2,0) RC(2,1) RC(2,2)
+
RC(3,0) RC(3,1)
RC(4,0) RC(4,1)
- RC(5,0) RC(5,1) RC(5,2)
>;
};
@@ -38,10 +37,9 @@
map = <
RC(0,0) RC(0,1)
RC(0,2) RC(0,3)
- RC(1,0) RC(1,1) RC(1,2)
+
RC(2,0) RC(2,1)
RC(2,2) RC(2,3)
- RC(3,0) RC(3,1) RC(3,2)
>;
};
diff --git a/app/boards/shields/zmk_uno/zmk_uno_split.keymap b/app/boards/shields/zmk_uno/zmk_uno_split.keymap
index 05f0ffb0b0..1e46042a7e 100644
--- a/app/boards/shields/zmk_uno/zmk_uno_split.keymap
+++ b/app/boards/shields/zmk_uno/zmk_uno_split.keymap
@@ -16,9 +16,7 @@
/* :REMOVE ME
-&kscan_direct_comp { status = "okay"; };
&kscan_direct { status = "okay"; };
-&kscan_matrix_comp { status = "disabled"; };
&kscan_matrix { status = "disabled"; };
/ {
@@ -30,20 +28,7 @@
REMOVE ME: */
-
/ {
- macros {
- ZMK_MACRO(ble_zero,
- wait-ms = <1>;
- tap-ms = <1>;
- bindings = <&out OUT_BLE &bt BT_SEL 0>;
- )
- ZMK_MACRO(ble_one,
- wait-ms = <1>;
- tap-ms = <1>;
- bindings = <&out OUT_BLE &bt BT_SEL 1>;
- )
- };
keymap {
compatible = "zmk,keymap";
@@ -53,11 +38,8 @@ REMOVE ME: */
&kp A &bl BL_TOG
&rgb_ug RGB_EFF &bt BT_CLR
- &out OUT_USB &ble_zero &ble_one
-
&kp C &kp D
&kp E &kp F
- &none &none &none
>;
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>;