Skip to content

Commit

Permalink
refactor: Update boards/shields for encoders.
Browse files Browse the repository at this point in the history
* Update existing boards/shields for new `steps` and
  `triggers-per-rotation` set up.
  • Loading branch information
petejohanson committed Nov 3, 2023
1 parent 4990e2a commit 703de1a
Show file tree
Hide file tree
Showing 22 changed files with 69 additions and 51 deletions.
7 changes: 4 additions & 3 deletions app/boards/arm/bdn9/bdn9_rev2.dts
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,31 @@
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 {
compatible = "alps,ec11";
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 {
compatible = "alps,ec11";
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";
};

sensors: sensors {
compatible = "zmk,keymap-sensors";
status = "disabled";
sensors = <>;
triggers-per-rotation = <20>;
};
};

Expand Down
5 changes: 3 additions & 2 deletions app/boards/arm/bt60/bt60.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
zmk,matrix_transform = &default_transform;
};

sensors {
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder>;
triggers-per-rotation = <20>;
};


Expand All @@ -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";
};

Expand Down
9 changes: 5 additions & 4 deletions app/boards/arm/ckp/ckp.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
zmk,battery = &vbatt;
};

sensors {
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&encoder_1>;
triggers-per-rotation = <20>;
};

kscan0: kscan_0 {
Expand Down Expand Up @@ -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";
};

Expand All @@ -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";
};

Expand All @@ -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";
};

Expand Down
7 changes: 4 additions & 3 deletions app/boards/shields/knob_goblin/knob_goblin.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -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";
};

Expand All @@ -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>;
};

};
Expand Down
7 changes: 4 additions & 3 deletions app/boards/shields/kyria/kyria_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions app/boards/shields/lily58/lily58.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
};
};

Expand Down
7 changes: 4 additions & 3 deletions app/boards/shields/lotus58/lotus58.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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";
};

Expand All @@ -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>;
};
};

Expand Down
1 change: 1 addition & 0 deletions app/boards/shields/murphpad/murphpad.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
sensors {
compatible = "zmk,keymap-sensors";
sensors = <&encoder_1 &encoder_2>;
triggers-per-rotation = <20>;
};


Expand Down
4 changes: 2 additions & 2 deletions app/boards/shields/murphpad/murphpad.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -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";
};

Expand All @@ -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";
};

Expand Down
1 change: 1 addition & 0 deletions app/boards/shields/nibble/nibble.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
sensors {
compatible = "zmk,keymap-sensors";
sensors = <&encoder_1>;
triggers-per-rotation = <20>;
};

keymap {
Expand Down
2 changes: 1 addition & 1 deletion app/boards/shields/nibble/nibble.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -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";
};

Expand Down
5 changes: 3 additions & 2 deletions app/boards/shields/reviung5/reviung5.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
};
};
5 changes: 3 additions & 2 deletions app/boards/shields/romac_plus/romac_plus.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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)?
Expand Down
4 changes: 2 additions & 2 deletions app/boards/shields/snap/snap.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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";
};

Expand Down
1 change: 1 addition & 0 deletions app/boards/shields/snap/snap.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder &right_encoder>;
triggers-per-rotation = <20>;
};

keymap {
Expand Down
7 changes: 4 additions & 3 deletions app/boards/shields/sofle/sofle.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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";
};

Expand All @@ -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>;
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand All @@ -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>;
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand All @@ -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>;
};
};

Expand Down
Loading

0 comments on commit 703de1a

Please sign in to comment.