Skip to content

Commit

Permalink
compile
Browse files Browse the repository at this point in the history
  • Loading branch information
sashalex007 committed Apr 19, 2024
1 parent fdc51a9 commit 46b5323
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 89 deletions.
31 changes: 31 additions & 0 deletions config/boards/shields/ergoalex/ergoalex.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include <dt-bindings/zmk/matrix_transform.h>

/ {
chosen {
zmk,matrix-transform = &default_transform;
zmk,battery = &vbatt;
};

vbatt: vbatt {
compatible = "zmk,battery-voltage-divider";
label = "BATTERY";
io-channels = <&adc 2>;
output-ohms = <2000000>;
full-ohms = <(2000000 +806000)>;
};


default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
rows = <4>;
columns = <10>;

map = <
RC(0, 0) RC(0, 1) RC(0, 2) RC(0, 3) RC(0, 4) RC(0, 5) RC(0, 6) RC(0, 7) RC(0, 8) RC(0, 9)
RC(1, 0) RC(1, 1) RC(1, 2) RC(1, 3) RC(1, 4) RC(1, 5) RC(1, 6) RC(1, 7) RC(1, 8) RC(1, 9)
RC(2, 0) 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(3, 3) RC(3, 4) RC(3, 5) RC(3, 6)
>;
};
};

62 changes: 17 additions & 45 deletions config/boards/shields/ergoalex/ergoalex_left.overlay
Original file line number Diff line number Diff line change
@@ -1,48 +1,20 @@
#include <dt-bindings/zmk/matrix_transform.h>

/ {
chosen {
zmk,kscan = &kscan;
zmk,matrix_transform = &transform;
zmk,battery = &vbatt;
};

vbatt: vbatt {
compatible = "zmk,battery-voltage-divider";
label = "BATTERY";
io-channels = <&adc 2>;
output-ohms = <2000000>;
full-ohms = <(2000000 +806000)>;
};

kscan: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";

row-gpios = <&gpio0 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>,
<&gpio0 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>,
<&gpio1 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>,
<&gpio0 11 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;

col-gpios = <&gpio0 17 (GPIO_ACTIVE_HIGH)>,
<&gpio1 6 (GPIO_ACTIVE_HIGH)>,
<&gpio0 20 (GPIO_ACTIVE_HIGH)>,
<&gpio0 22 (GPIO_ACTIVE_HIGH)>,
<&gpio0 24 (GPIO_ACTIVE_HIGH)>;
};
#include "ergoalex.dtsi"

&kscan0 {
compatible = "zmk,kscan-gpio-matrix";
diode-direction = "col2row";
row-gpios = <&gpio0 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>,
<&gpio0 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>,
<&gpio1 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>,
<&gpio0 11 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;

col-gpios = <&gpio0 17 (GPIO_ACTIVE_HIGH)>,
<&gpio1 6 (GPIO_ACTIVE_HIGH)>,
<&gpio0 20 (GPIO_ACTIVE_HIGH)>,
<&gpio0 22 (GPIO_ACTIVE_HIGH)>,
<&gpio0 24 (GPIO_ACTIVE_HIGH)>;
};

transform: matrix_transform {
compatible = "zmk,matrix-transform";
rows = <4>;
columns = <10>;


map = <
RC(0, 0) RC(0, 1) RC(0, 2) RC(0, 3) RC(0, 4) RC(0, 5) RC(0, 6) RC(0, 7) RC(0, 8) RC(0, 9)
RC(1, 0) RC(1, 1) RC(1, 2) RC(1, 3) RC(1, 4) RC(1, 5) RC(1, 6) RC(1, 7) RC(1, 8) RC(1, 9)
RC(2, 0) 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(3, 3) RC(3, 4) RC(3, 5) RC(3, 6)
>;
};
};

1 change: 0 additions & 1 deletion config/boards/shields/ergoalex/ergoalex_right.conf

This file was deleted.

61 changes: 18 additions & 43 deletions config/boards/shields/ergoalex/ergoalex_right.overlay
Original file line number Diff line number Diff line change
@@ -1,48 +1,23 @@
#include <dt-bindings/zmk/matrix_transform.h>
#include "ergoalex.dtsi"

/ {
chosen {
zmk,kscan = &kscan;
zmk,matrix_transform = &transform;
zmk,battery = &vbatt;
};

vbatt: vbatt {
compatible = "zmk,battery-voltage-divider";
label = "BATTERY";
io-channels = <&adc 2>;
output-ohms = <2000000>;
full-ohms = <(2000000 +806000)>;
};

kscan: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";

row-gpios = <&gpio1 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>,
<&gpio0 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>,
<&gpio0 29 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>,
<&gpio0 17 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
&default_transform {
col-offset = <5>;
};

col-gpios = <&gpio1 13 (GPIO_ACTIVE_HIGH)>,
<&gpio1 11 (GPIO_ACTIVE_HIGH)>,
<&gpio0 9 (GPIO_ACTIVE_HIGH)>,
<&gpio0 10 (GPIO_ACTIVE_HIGH)>,
<&gpio0 31 (GPIO_ACTIVE_HIGH)>;
};
&kscan0 {
compatible = "zmk,kscan-gpio-matrix";
diode-direction = "col2row";
row-gpios = <&gpio1 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>,
<&gpio0 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>,
<&gpio0 29 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>,
<&gpio0 17 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;

col-gpios = <&gpio1 13 (GPIO_ACTIVE_HIGH)>,
<&gpio1 11 (GPIO_ACTIVE_HIGH)>,
<&gpio0 9 (GPIO_ACTIVE_HIGH)>,
<&gpio0 10 (GPIO_ACTIVE_HIGH)>,
<&gpio0 31 (GPIO_ACTIVE_HIGH)>;
};

transform: matrix_transform {
compatible = "zmk,matrix-transform";
rows = <4>;
columns = <10>;

map = <
RC(0, 0) RC(0, 1) RC(0, 2) RC(0, 3) RC(0, 4) RC(0, 5) RC(0, 6) RC(0, 7) RC(0, 8) RC(0, 9)
RC(1, 0) RC(1, 1) RC(1, 2) RC(1, 3) RC(1, 4) RC(1, 5) RC(1, 6) RC(1, 7) RC(1, 8) RC(1, 9)
RC(2, 0) 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(3, 3) RC(3, 4) RC(3, 5) RC(3, 6)
>;
};
};

0 comments on commit 46b5323

Please sign in to comment.