aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSeth Milliken <[email protected]>2024-02-09 01:02:49 -0800
committerPete Johanson <[email protected]>2024-02-19 17:01:10 -0800
commitb44ec381f69233d1c2d32c6501189e4e339ff876 (patch)
treef80e5b8e2f9f9ea70a3f2ec0f39b9f40b7e97066
parentccf038017993dd2e7f00bdd355e28c5009621dd5 (diff)
downloadzmk-b44ec381f69233d1c2d32c6501189e4e339ff876.tar.gz
zmk-b44ec381f69233d1c2d32c6501189e4e339ff876.zip
feat(boards): add encoder support to planck
-rw-r--r--app/boards/arm/planck/planck_rev6.dts14
-rw-r--r--app/boards/arm/planck/planck_rev6.keymap6
-rw-r--r--app/boards/arm/planck/planck_rev6.zmk.yml1
-rw-r--r--app/boards/arm/planck/planck_rev6_defconfig4
4 files changed, 25 insertions, 0 deletions
diff --git a/app/boards/arm/planck/planck_rev6.dts b/app/boards/arm/planck/planck_rev6.dts
index b6f6fca431..5b8e16b2ef 100644
--- a/app/boards/arm/planck/planck_rev6.dts
+++ b/app/boards/arm/planck/planck_rev6.dts
@@ -44,6 +44,20 @@
;
};
+ encoder: encoder {
+ compatible = "alps,ec11";
+ a-gpios = <&gpiob 12 GPIO_PULL_UP>;
+ b-gpios = <&gpiob 13 GPIO_PULL_UP>;
+ steps = <80>;
+ status = "disabled";
+ };
+
+ sensors: sensors {
+ compatible = "zmk,keymap-sensors";
+ sensors = <&encoder>;
+ triggers-per-rotation = <20>;
+ };
+
layout_grid_transform:
keymap_transform_0 {
compatible = "zmk,matrix-transform";
diff --git a/app/boards/arm/planck/planck_rev6.keymap b/app/boards/arm/planck/planck_rev6.keymap
index 6513805728..1386eadd18 100644
--- a/app/boards/arm/planck/planck_rev6.keymap
+++ b/app/boards/arm/planck/planck_rev6.keymap
@@ -7,6 +7,11 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
+/* Uncomment this block if using an encoder */
+//&encoder {
+// status = "okay";
+//};
+
/ {
keymap {
compatible = "zmk,keymap";
@@ -23,6 +28,7 @@
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp SLASH &kp RET
&trans &kp LCTL &kp LALT &kp LGUI &mo 1 &trans &kp SPACE &mo 2 &kp LEFT &kp DOWN &kp UP &kp RIGHT
>;
+ sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
};
lower {
diff --git a/app/boards/arm/planck/planck_rev6.zmk.yml b/app/boards/arm/planck/planck_rev6.zmk.yml
index 56c0000671..f9d4242474 100644
--- a/app/boards/arm/planck/planck_rev6.zmk.yml
+++ b/app/boards/arm/planck/planck_rev6.zmk.yml
@@ -5,6 +5,7 @@ type: board
arch: arm
features:
- keys
+ - encoder
outputs:
- usb
url: https://olkb.com/collections/planck
diff --git a/app/boards/arm/planck/planck_rev6_defconfig b/app/boards/arm/planck/planck_rev6_defconfig
index ce08f41dff..f453063900 100644
--- a/app/boards/arm/planck/planck_rev6_defconfig
+++ b/app/boards/arm/planck/planck_rev6_defconfig
@@ -14,3 +14,7 @@ CONFIG_GPIO=y
CONFIG_CLOCK_CONTROL=y
CONFIG_ZMK_USB=y
+
+# Uncomment these two lines to add support for encoder to your firmware
+#CONFIG_EC11=y
+#CONFIG_EC11_TRIGGER_OWN_THREAD=y