summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Johanson <peter@peterjohanson.com>2020-07-16 23:41:55 -0400
committerPete Johanson <peter@peterjohanson.com>2020-07-16 23:41:55 -0400
commitc3dd7b694d30a56b9dc9a0ebec6f9f475f63149d (patch)
tree03c91d845aacc65b2419370ef73e14e000f51d9f
parent4f6e2a6694f7f3a5c7d04b984aed218bfff934b1 (diff)
Initial Lily58 shield definition.
-rw-r--r--.github/workflows/build.yml6
-rw-r--r--app/boards/shields/lily58/Kconfig.defconfig7
-rw-r--r--app/boards/shields/lily58/Kconfig.shield8
-rw-r--r--app/boards/shields/lily58/keymap/keymap.overlay36
-rw-r--r--app/boards/shields/lily58/lily58.conf0
-rw-r--r--app/boards/shields/lily58/lily58.dtsi50
-rw-r--r--app/boards/shields/lily58/lily58_left.overlay19
-rw-r--r--app/boards/shields/lily58/lily58_right.overlay23
8 files changed, 148 insertions, 1 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index ea5f24d..4109161 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -9,7 +9,11 @@ jobs:
strategy:
matrix:
board: [proton_c, nice_nano]
- shield: [kyria_left, kyria_right, petejohanson_pro_micro_handwire]
+ shield:
+ - kyria_left
+ - kyria_right
+ - lily58_left
+ - lily58_right
steps:
# To use this repository's private action,
# you must check out the repository
diff --git a/app/boards/shields/lily58/Kconfig.defconfig b/app/boards/shields/lily58/Kconfig.defconfig
new file mode 100644
index 0000000..9ec5834
--- /dev/null
+++ b/app/boards/shields/lily58/Kconfig.defconfig
@@ -0,0 +1,7 @@
+
+if SHIELD_LILY58_LEFT || SHIELD_LILY58_RIGHT
+
+config ZMK_KEYBOARD_NAME
+ default "Lily58"
+
+endif
diff --git a/app/boards/shields/lily58/Kconfig.shield b/app/boards/shields/lily58/Kconfig.shield
new file mode 100644
index 0000000..932e33b
--- /dev/null
+++ b/app/boards/shields/lily58/Kconfig.shield
@@ -0,0 +1,8 @@
+# Copyright (c) 2020 Pete Johanson
+# SPDX-License-Identifier: MIT
+
+config SHIELD_LILY58_LEFT
+ def_bool $(shields_list_contains,lily58_left)
+
+config SHIELD_LILY58_RIGHT
+ def_bool $(shields_list_contains,lily58_right)
diff --git a/app/boards/shields/lily58/keymap/keymap.overlay b/app/boards/shields/lily58/keymap/keymap.overlay
new file mode 100644
index 0000000..2414ad7
--- /dev/null
+++ b/app/boards/shields/lily58/keymap/keymap.overlay
@@ -0,0 +1,36 @@
+#include <behaviors.dtsi>
+#include <dt-bindings/zmk/keys.h>
+#include <dt-bindings/zmk/matrix-transform.h>
+
+/ {
+ chosen {
+ zmk,keymap = &keymap0;
+ };
+
+ keymap0: keymap {
+ compatible = "zmk,keymap";
+ label ="Default Lily58 Keymap";
+ layers = <&default>;
+ };
+
+ layers {
+ compatible = "zmk,layers";
+
+ default: layer_0 {
+ label = "DEFAULT";
+// ---------------------------------------------------------------------------------------------------------------------------------
+// | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ` |
+// | TAB | Q | W | E | R | T | | Y | U | I | O | P | \ |
+// | CTRL | A | S | D | F | G | | H | J | K | L | ; | ' |
+// | SHIFT | Z | X | C | V | B | "[" | | "]" | N | M | , | . | / | CTRL |
+// | GUI | DEL | RET | SPACE | | SPACE | TAB | BSPC | R-ALT |
+ bindings = <
+&kp ESC &kp NUM_1 &kp NUM_2 &kp NUM_3 &kp NUM_4 &kp NUM_5 &kp NUM_6 &kp NUM_7 &kp NUM_8 &kp NUM_9 &kp NUM_0 &kp BSLH
+&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH
+&kp LCTL &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SCLN &kp QUOT
+&kp LSFT &kp Z &kp X &kp C &kp V &kp B &kp LBKT &kp RBKT &kp N &kp M &kp CMMA &kp DOT &kp FSLH &kp RCTL
+ &kp LGUI &kp DEL &kp RET &kp SPC &kp SPC &kp TAB &kp BKSP &kp RALT
+ >;
+ };
+ };
+};
diff --git a/app/boards/shields/lily58/lily58.conf b/app/boards/shields/lily58/lily58.conf
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/app/boards/shields/lily58/lily58.conf
diff --git a/app/boards/shields/lily58/lily58.dtsi b/app/boards/shields/lily58/lily58.dtsi
new file mode 100644
index 0000000..5fd7341
--- /dev/null
+++ b/app/boards/shields/lily58/lily58.dtsi
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2020 Pete Johanson
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#include <dt-bindings/zmk/matrix-transform.h>
+
+/ {
+ chosen {
+ zmk,kscan = &kscan0;
+ zmk,matrix_transform = &default_transform;
+ };
+
+ default_transform: keymap_transform_0 {
+ compatible = "zmk,matrix-transform";
+ columns = <16>;
+ rows = <4>;
+// | SW6 | SW5 | SW4 | SW3 | SW2 | SW1 | | SW1 | SW2 | SW3 | SW4 | SW5 | SW6 |
+// | SW12 | SW11 | SW10 | SW9 | SW8 | SW7 | | SW7 | SW8 | SW9 | SW10 | SW11 | SW12 |
+// | SW18 | SW17 | SW16 | SW15 | SW14 | SW13 | | SW13 | SW14 | SW15 | SW16 | SW17 | SW18 |
+// | SW24 | SW23 | SW22 | SW21 | SW20 | SW19 | SW25 | | SW25 | SW19 | SW20 | SW21 | SW22 | SW23 | SW24 |
+// | SW29 | SW28 | SW27 | SW26 | | SW26 | SW27 | SW28 | SW29 |
+ 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(0,10) RC(0,11)
+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(1,10) RC(1,11)
+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(2,10) RC(2,11)
+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) RC(3,8) RC(3,9) RC(3,10) RC(3,11)
+ RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,7) RC(4,8) RC(4,9) RC(4,10)
+ >;
+ };
+
+ kscan0: kscan {
+ compatible = "zmk,kscan-gpio-matrix";
+ label = "KSCAN";
+
+ diode-direction = "col2row";
+ row-gpios
+ = <&pro_micro_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
+ , <&pro_micro_d 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
+ , <&pro_micro_d 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
+ , <&pro_micro_d 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
+ , <&pro_micro_d 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
+ ;
+
+ };
+
+ // TODO: OLED node
+};
+
diff --git a/app/boards/shields/lily58/lily58_left.overlay b/app/boards/shields/lily58/lily58_left.overlay
new file mode 100644
index 0000000..c8e2213
--- /dev/null
+++ b/app/boards/shields/lily58/lily58_left.overlay
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2020 Pete Johanson
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#include "lily58.dtsi"
+
+&kscan0 {
+ col-gpios
+ = <&pro_micro_a 1 GPIO_ACTIVE_HIGH>
+ , <&pro_micro_a 0 GPIO_ACTIVE_HIGH>
+ , <&pro_micro_d 15 GPIO_ACTIVE_HIGH>
+ , <&pro_micro_d 14 GPIO_ACTIVE_HIGH>
+ , <&pro_micro_d 16 GPIO_ACTIVE_HIGH>
+ , <&pro_micro_d 10 GPIO_ACTIVE_HIGH>
+ ;
+};
+
diff --git a/app/boards/shields/lily58/lily58_right.overlay b/app/boards/shields/lily58/lily58_right.overlay
new file mode 100644
index 0000000..748be14
--- /dev/null
+++ b/app/boards/shields/lily58/lily58_right.overlay
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2020 Pete Johanson
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#include "lily58.dtsi"
+
+&default_transform {
+ col-offset = <6>;
+};
+
+&kscan0 {
+ col-gpios
+ = <&pro_micro_d 10 GPIO_ACTIVE_HIGH>
+ , <&pro_micro_d 16 GPIO_ACTIVE_HIGH>
+ , <&pro_micro_d 14 GPIO_ACTIVE_HIGH>
+ , <&pro_micro_d 15 GPIO_ACTIVE_HIGH>
+ , <&pro_micro_a 0 GPIO_ACTIVE_HIGH>
+ , <&pro_micro_a 1 GPIO_ACTIVE_HIGH>
+ ;
+};
+