refactor: Update boards/shields for encoders.

* Update existing boards/shields for new `steps` and
  `triggers-per-rotation` set up.
This commit is contained in:
Peter Johanson 2023-10-18 02:33:03 +00:00 committed by Pete Johanson
parent 8d09809ef0
commit 34c8b3f1e3
22 changed files with 69 additions and 51 deletions

View file

@ -43,7 +43,7 @@
label = "LEFT_ENCODER";
a-gpios = <&gpioa 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&gpioa 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};
mid_encoder: encoder_mid {
@ -51,7 +51,7 @@
label = "MID_ENCODER";
a-gpios = <&gpioa 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&gpioa 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};
right_encoder: encoder_right {
@ -59,7 +59,7 @@
label = "RIGHT_ENCODER";
a-gpios = <&gpioa 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&gpiob 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};
@ -67,6 +67,7 @@
compatible = "zmk,keymap-sensors";
status = "disabled";
sensors = <>;
triggers-per-rotation = <20>;
};
};

View file

@ -22,9 +22,10 @@
zmk,matrix_transform = &default_transform;
};
sensors {
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder>;
triggers-per-rotation = <20>;
};
@ -34,7 +35,7 @@
label = "LEFT_ENCODER";
a-gpios = <&gpio1 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&gpio1 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "okay";
};

View file

@ -26,9 +26,10 @@
zmk,battery = &vbatt;
};
sensors {
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&encoder_1>;
triggers-per-rotation = <20>;
};
kscan0: kscan_0 {
@ -76,7 +77,7 @@
label = "ENCODER_ONE";
a-gpios = <&gpio0 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&gpio0 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "okay";
};
@ -85,7 +86,7 @@
label = "ENCODER_TWO";
a-gpios = <&gpio0 26 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&gpio0 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "okay";
};
@ -94,7 +95,7 @@
label = "encoder_3";
a-gpios = <&gpio0 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&gpio0 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "okay";
};

View file

@ -39,7 +39,7 @@
label = "TOP_ENCODER";
a-gpios = <&pro_micro 19 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 18 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "okay";
};
@ -48,13 +48,14 @@
label = "BOTTOM_ENCODER";
a-gpios = <&pro_micro 20 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 21 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "okay";
};
sensors {
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&top_encoder &bottom_encoder>;
triggers-per-rotation = <20>;
};
};

View file

@ -23,20 +23,21 @@
left_encoder: encoder_left {
compatible = "alps,ec11";
label = "LEFT_ENCODER";
resolution = <4>;
steps = <80>;
status = "disabled";
};
right_encoder: encoder_right {
compatible = "alps,ec11";
label = "RIGHT_ENCODER";
resolution = <4>;
steps = <80>;
status = "disabled";
};
sensors {
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder &right_encoder>;
triggers-per-rotation = <20>;
};
// TODO: RGB node(s)

View file

@ -51,12 +51,13 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(4,5) RC(4,6) RC(3,6) RC(3,7)
label = "LEFT_ENCODER";
a-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
};
sensors {
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder>;
triggers-per-rotation = <20>;
};
};

View file

@ -50,7 +50,7 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(4,5) RC(4,6) RC(3,6) RC(3,7
label = "LEFT_ENCODER";
a-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};
@ -59,13 +59,14 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(4,5) RC(4,6) RC(3,6) RC(3,7
label = "RIGHT_ENCODER";
a-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};
sensors {
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder &right_encoder>;
triggers-per-rotation = <20>;
};
};

View file

@ -48,6 +48,7 @@
sensors {
compatible = "zmk,keymap-sensors";
sensors = <&encoder_1 &encoder_2>;
triggers-per-rotation = <20>;
};

View file

@ -39,7 +39,7 @@
label = "Encoder 1";
a-gpios = <&pro_micro 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};
@ -48,7 +48,7 @@
label = "Encoder 2";
a-gpios = <&pro_micro 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};

View file

@ -12,6 +12,7 @@
sensors {
compatible = "zmk,keymap-sensors";
sensors = <&encoder_1>;
triggers-per-rotation = <20>;
};
keymap {

View file

@ -18,7 +18,7 @@
label = "Encoder 1";
a-gpios = <&pro_micro 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "okay";
};

View file

@ -43,12 +43,13 @@
label = "encoder";
a-gpios = <&pro_micro 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "okay";
};
sensors {
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&encoder>;
triggers-per-rotation = <20>;
};
};

View file

@ -43,13 +43,14 @@ RC(3,0) RC(3,1) RC(3,2)
label = "LEFT_ENCODER";
a-gpios = <&pro_micro 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};
sensors {
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder>;
triggers-per-rotation = <20>;
};
// TODO: per-key RGB node(s)?

View file

@ -16,14 +16,14 @@
left_encoder: encoder_left {
compatible = "alps,ec11";
label = "LEFT_ENCODER";
resolution = <4>;
steps = <80>;
status = "disabled";
};
right_encoder: encoder_right {
compatible = "alps,ec11";
label = "RIGHT_ENCODER";
resolution = <4>;
steps = <80>;
status = "disabled";
};

View file

@ -13,6 +13,7 @@
sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder &right_encoder>;
triggers-per-rotation = <20>;
};
keymap {

View file

@ -50,7 +50,7 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(4,5) RC(4,6) RC(3,6) RC(3,7)
label = "LEFT_ENCODER";
a-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};
@ -59,13 +59,14 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(4,5) RC(4,6) RC(3,6) RC(3,7)
label = "RIGHT_ENCODER";
a-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};
sensors {
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder &right_encoder>;
triggers-per-rotation = <20>;
};
};

View file

@ -48,7 +48,7 @@ RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10
left_encoder: left_encoder {
compatible = "alps,ec11";
label = "L_ENCODER";
resolution = <4>;
steps = <80>;
status = "disabled";
a-gpios = <&pro_micro 4 GPIO_PULL_UP>;
@ -58,16 +58,17 @@ RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10
right_encoder: right_encoder {
compatible = "alps,ec11";
label = "R_ENCODER";
resolution = <4>;
steps = <80>;
status = "disabled";
a-gpios = <&pro_micro 19 GPIO_PULL_UP>;
b-gpios = <&pro_micro 18 GPIO_PULL_UP>;
};
sensors {
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder &right_encoder>;
triggers-per-rotation = <20>;
};
};

View file

@ -34,7 +34,7 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(4,1) RC(4,10) RC(3,6) RC(3,7)
left_encoder: left_encoder {
compatible = "alps,ec11";
label = "L_ENCODER";
resolution = <4>;
steps = <80>;
status = "disabled";
a-gpios = <&pro_micro 5 GPIO_PULL_UP>;
@ -44,16 +44,17 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(4,1) RC(4,10) RC(3,6) RC(3,7)
right_encoder: right_encoder {
compatible = "alps,ec11";
label = "R_ENCODER";
resolution = <4>;
steps = <80>;
status = "disabled";
a-gpios = <&pro_micro 18 GPIO_PULL_UP>;
b-gpios = <&pro_micro 19 GPIO_PULL_UP>;
};
sensors {
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder &right_encoder>;
triggers-per-rotation = <20>;
};
};

View file

@ -28,34 +28,35 @@
left_encoder1: left_encoder1 {
compatible = "alps,ec11";
label = "L_ENCODER1";
resolution = <4>;
steps = <80>;
status = "disabled";
};
left_encoder2: left_encoder2 {
compatible = "alps,ec11";
label = "L_ENCODER2";
resolution = <4>;
steps = <80>;
status = "disabled";
};
right_encoder1: right_encoder1 {
compatible = "alps,ec11";
label = "R_ENCODER1";
resolution = <4>;
steps = <80>;
status = "disabled";
};
right_encoder2: right_encoder2 {
compatible = "alps,ec11";
label = "R_ENCODER2";
resolution = <4>;
steps = <80>;
status = "disabled";
};
sensors {
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder1 &right_encoder1>;
triggers-per-rotation = <20>;
};
};

View file

@ -49,7 +49,7 @@
label = "Top Row Encoder";
a-gpios = <&pro_micro 16 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};
@ -58,7 +58,7 @@
label = "Encoder 1";
a-gpios = <&pro_micro 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 16 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};
@ -67,7 +67,7 @@
label = "Encoder 2";
a-gpios = <&pro_micro 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};
@ -76,7 +76,7 @@
label = "Encoder 3";
a-gpios = <&pro_micro 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};
@ -85,7 +85,7 @@
label = "Encoder 4";
a-gpios = <&pro_micro 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};

View file

@ -17,6 +17,7 @@
sensors {
compatible = "zmk,keymap-sensors";
sensors = <&encoder_1_top_row>;
triggers-per-rotation = <20>;
};
keymap {

View file

@ -50,7 +50,7 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,5) RC(4,6) RC(4,7) R
label = "LEFT_ENCODER";
a-gpios = <&pro_micro 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};
@ -59,13 +59,14 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,5) RC(4,6) RC(4,7) R
label = "RIGHT_ENCODER";
a-gpios = <&pro_micro 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};
sensors {
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder &right_encoder>;
triggers-per-rotation = <20>;
};
};