Added Encoder support

This commit is contained in:
JW2586 2022-02-18 15:44:08 +00:00
parent 6ac0516f15
commit 8e8e291960
5 changed files with 11 additions and 9 deletions

View file

@ -1,6 +1,6 @@
# Uncomment these two line to add support for encoders to your firmware
# CONFIG_EC11=y
# CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
CONFIG_EC11=y
CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
# Uncomment the following line to enable the Kyria OLED Display
# CONFIG_ZMK_DISPLAY=y

View file

@ -42,22 +42,20 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8
};
left_encoder: encoder_left {
left_encoder: encoder_left { //roller
compatible = "alps,ec11";
label = "LEFT_ENCODER";
a-gpios = <&pro_micro 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
status = "disabled";
};
right_encoder: encoder_right {
right_encoder: encoder_right { //Standard encoder on left half
compatible = "alps,ec11";
label = "RIGHT_ENCODER";
a-gpios = <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
status = "disabled";
resolution = <2>;
};
sensors {

View file

@ -33,7 +33,7 @@
&kp N1 &lt 3 DEL &lt 1 SPACE &kp TAB &kp N2 &kp N3 &kp ESC &kp BSPC &lt 2 RET &kp N4
>;
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>;
sensor-bindings = <&inc_dec_kp C_AC_SCROLL_UP C_AC_SCROLL_DOWN &inc_dec_kp TAB LS(TAB)>;
};
navnum_layer {
@ -76,7 +76,7 @@
*/
bindings = <
&kp PRCNT &kp LS(QUOT) &kp LBKT &kp RBKT &kp NON_US_BSLH &kp RA(GRAVE) &kp LS(GRAVE) &kp CARET &trans &trans
&kp NON_US_HASH &kp EXCL &kp LPAR &kp RPAR &kp PIPE &kp UNDER &kp APOS &kp LS(N2) &kp LS(NON_US_HASH) &kp GRAVE
&kp NON_US_HASH &kp EXCL &kp LPAR &kp RPAR &kp LS(NON_US_BSLH) &kp UNDER &kp APOS &kp LS(N2) &kp LS(NON_US_HASH) &kp GRAVE
&kp DLLR &kp LS(N3) &kp LBRC &kp RBRC &kp AMPS &trans &trans &trans &trans &trans
&kp N1 &lt 3 DEL &lt 1 SPACE &kp TAB &kp N2 &kp N3 &kp ESC &kp BSPC &lt 2 RET &kp N4
>;

View file

@ -0,0 +1,2 @@
CONFIG_EC11=y
CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y

View file

@ -0,0 +1,2 @@
CONFIG_EC11=y
CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y