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.
This commit is contained in:
mantas 2021-01-30 14:03:00 +02:00 committed by Pete Johanson
parent c94943da1c
commit b4d63fb52c
3 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1,3 @@
# Uncomment lines below to enable encoder
# CONFIG_EC11=y
# CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y

View file

@ -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 &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 &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 { 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 &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 &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 { 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 &trans &trans &trans &trans &mo 3 &trans &trans &trans &kp C_NEXT &kp C_VOL_DN &kp C_VOL_UP &kp C_PP
>; >;
}; };
control { control {
bindings = < bindings = <
&reset &bootloader &bt BT_CLR &bt BT_PRV &bt BT_NXT &trans &trans &trans &trans &trans &trans &trans &reset &bootloader &bt BT_CLR &bt BT_PRV &bt BT_NXT &trans &trans &trans &trans &trans &trans &trans

View file

@ -38,4 +38,18 @@
, <&pro_micro_a 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> , <&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>;
};
}; };