summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormantas <mantas@tarakonas.lt>2021-01-30 14:03:00 +0200
committerPete Johanson <peter@peterjohanson.com>2021-02-03 23:49:59 -0500
commitb4d63fb52cde20f910e0bd05724e80370c441981 (patch)
tree036a9895686f2f3a143fd7c1022b2891dcd7659c
parentc94943da1c31c295c063811336cb3a7bee983ccc (diff)
feat(shields) Add encoder support to CRBN
Pin A maps to A2 (F5), pin B to A3 (F4). Added keymappings to encoder on default and lower layers.
-rw-r--r--app/boards/shields/crbn/crbn.conf3
-rw-r--r--app/boards/shields/crbn/crbn.keymap5
-rw-r--r--app/boards/shields/crbn/crbn.overlay14
3 files changed, 22 insertions, 0 deletions
diff --git a/app/boards/shields/crbn/crbn.conf b/app/boards/shields/crbn/crbn.conf
index e69de29..15f65fb 100644
--- a/app/boards/shields/crbn/crbn.conf
+++ b/app/boards/shields/crbn/crbn.conf
@@ -0,0 +1,3 @@
+# Uncomment lines below to enable encoder
+# CONFIG_EC11=y
+# CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y \ No newline at end of file
diff --git a/app/boards/shields/crbn/crbn.keymap b/app/boards/shields/crbn/crbn.keymap
index 023d3ec..d9aeaa9 100644
--- a/app/boards/shields/crbn/crbn.keymap
+++ b/app/boards/shields/crbn/crbn.keymap
@@ -24,6 +24,8 @@
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp BSLH &kp RET
&trans &kp LGUI &kp LALT &kp LCTRL &mo 1 &kp SPACE &trans &mo 2 &kp LEFT &kp DOWN &kp UP &kp RIGHT
>;
+
+ sensor-bindings = <&inc_dec_kp PG_UP PG_DN>;
};
lower {
@@ -33,6 +35,8 @@
&trans &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &kp LS(HASH) &kp LS(BSLH) &kp HOME &kp END &trans
&trans &trans &trans &trans &trans &trans &trans &mo 3 &kp C_NEXT &kp C_VOL_DN &kp C_VOL_UP &kp C_PP
>;
+
+ sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
};
raise {
@@ -43,6 +47,7 @@
&trans &trans &trans &trans &mo 3 &trans &trans &trans &kp C_NEXT &kp C_VOL_DN &kp C_VOL_UP &kp C_PP
>;
};
+
control {
bindings = <
&reset &bootloader &bt BT_CLR &bt BT_PRV &bt BT_NXT &trans &trans &trans &trans &trans &trans &trans
diff --git a/app/boards/shields/crbn/crbn.overlay b/app/boards/shields/crbn/crbn.overlay
index ebb3a0a..7520dae 100644
--- a/app/boards/shields/crbn/crbn.overlay
+++ b/app/boards/shields/crbn/crbn.overlay
@@ -38,4 +38,18 @@
, <&pro_micro_a 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};
+
+ encoder: encoder {
+ compatible = "alps,ec11";
+ label = "ENCODER";
+ a-gpios = <&pro_micro_a 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
+ b-gpios = <&pro_micro_a 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
+ resolution = <2>;
+ status = "okay";
+ };
+
+ sensors {
+ compatible = "zmk,keymap-sensors";
+ sensors = <&encoder>;
+ };
};