From c3dd7b694d30a56b9dc9a0ebec6f9f475f63149d Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Thu, 16 Jul 2020 23:41:55 -0400 Subject: [PATCH] Initial Lily58 shield definition. --- .github/workflows/build.yml | 6 ++- app/boards/shields/lily58/Kconfig.defconfig | 7 +++ app/boards/shields/lily58/Kconfig.shield | 8 +++ .../shields/lily58/keymap/keymap.overlay | 36 +++++++++++++ app/boards/shields/lily58/lily58.conf | 0 app/boards/shields/lily58/lily58.dtsi | 50 +++++++++++++++++++ app/boards/shields/lily58/lily58_left.overlay | 19 +++++++ .../shields/lily58/lily58_right.overlay | 23 +++++++++ 8 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 app/boards/shields/lily58/Kconfig.defconfig create mode 100644 app/boards/shields/lily58/Kconfig.shield create mode 100644 app/boards/shields/lily58/keymap/keymap.overlay create mode 100644 app/boards/shields/lily58/lily58.conf create mode 100644 app/boards/shields/lily58/lily58.dtsi create mode 100644 app/boards/shields/lily58/lily58_left.overlay create mode 100644 app/boards/shields/lily58/lily58_right.overlay diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ea5f24dc..41091612 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 00000000..9ec58344 --- /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 00000000..932e33b3 --- /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 00000000..2414ad74 --- /dev/null +++ b/app/boards/shields/lily58/keymap/keymap.overlay @@ -0,0 +1,36 @@ +#include +#include +#include + +/ { + 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 00000000..e69de29b diff --git a/app/boards/shields/lily58/lily58.dtsi b/app/boards/shields/lily58/lily58.dtsi new file mode 100644 index 00000000..5fd73418 --- /dev/null +++ b/app/boards/shields/lily58/lily58.dtsi @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2020 Pete Johanson + * + * SPDX-License-Identifier: MIT + */ + +#include + +/ { + 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 00000000..c8e22130 --- /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 00000000..748be145 --- /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> + ; +}; +