From f687679f36ee49b3af282efef75899e84f18eb38 Mon Sep 17 00:00:00 2001 From: Alexander Krikun Date: Mon, 7 Oct 2024 05:29:48 +0400 Subject: [PATCH] Move to ZMK module for the keyboard, add Studio This commit moves the config repository to build from a ZMK module. This allows the developer of the keyboard to add/tweak features without the users having to pull changes - they can just re-build their firmware and enjoy all the latest features. As an example - this commit adds ZMK studio support with all the necessary physical layout work done in the module. --- README.md | 2 +- .../shields/ergonaut_one/Kconfig.defconfig | 19 ----- .../shields/ergonaut_one/Kconfig.shield | 8 --- .../shields/ergonaut_one/ergonaut_one.dtsi | 52 -------------- .../shields/ergonaut_one/ergonaut_one.keymap | 65 ----------------- .../shields/ergonaut_one/ergonaut_one.zmk.yml | 11 --- .../ergonaut_one/ergonaut_one_left.conf | 2 - .../ergonaut_one/ergonaut_one_left.overlay | 18 ----- .../ergonaut_one/ergonaut_one_right.conf | 2 - .../ergonaut_one/ergonaut_one_right.overlay | 22 ------ config/ergonaut_one.keymap | 70 ++++++++++++++++++- config/west.yml | 5 ++ 12 files changed, 75 insertions(+), 201 deletions(-) delete mode 100644 config/boards/shields/ergonaut_one/Kconfig.defconfig delete mode 100644 config/boards/shields/ergonaut_one/Kconfig.shield delete mode 100644 config/boards/shields/ergonaut_one/ergonaut_one.dtsi delete mode 100644 config/boards/shields/ergonaut_one/ergonaut_one.keymap delete mode 100644 config/boards/shields/ergonaut_one/ergonaut_one.zmk.yml delete mode 100644 config/boards/shields/ergonaut_one/ergonaut_one_left.conf delete mode 100644 config/boards/shields/ergonaut_one/ergonaut_one_left.overlay delete mode 100644 config/boards/shields/ergonaut_one/ergonaut_one_right.conf delete mode 100644 config/boards/shields/ergonaut_one/ergonaut_one_right.overlay mode change 120000 => 100644 config/ergonaut_one.keymap diff --git a/README.md b/README.md index 2b9f23c..ddece00 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ You have two options on how to configure your desired keymap: #### Option 2. Manual -1. Make changes to the [ergonaut_one.keymap](config/boards/shields/ergonaut_one/ergonaut_one.keymap) file using your favorite text editor. +1. Make changes to the [ergonaut_one.keymap](config/ergonaut_one.keymap) file using your favorite text editor. 2. Commit changes to your repository. 3. Go to `Actions` tab in your Github repository, locate the latest build and wait for it to complete. 4. Grab the `firmware.zip` archive diff --git a/config/boards/shields/ergonaut_one/Kconfig.defconfig b/config/boards/shields/ergonaut_one/Kconfig.defconfig deleted file mode 100644 index db1b767..0000000 --- a/config/boards/shields/ergonaut_one/Kconfig.defconfig +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2020 The ZMK Contributors -# SPDX-License-Identifier: MIT - -if SHIELD_ERGONAUT_ONE_LEFT - -config ZMK_KEYBOARD_NAME - default "Ergonaut One" - -config ZMK_SPLIT_ROLE_CENTRAL - default y - -endif - -if SHIELD_ERGONAUT_ONE_LEFT || SHIELD_ERGONAUT_ONE_RIGHT - -config ZMK_SPLIT - default y - -endif diff --git a/config/boards/shields/ergonaut_one/Kconfig.shield b/config/boards/shields/ergonaut_one/Kconfig.shield deleted file mode 100644 index f085401..0000000 --- a/config/boards/shields/ergonaut_one/Kconfig.shield +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2020 The ZMK Contributors -# SPDX-License-Identifier: MIT - -config SHIELD_ERGONAUT_ONE_LEFT - def_bool $(shields_list_contains,ergonaut_one_left) - -config SHIELD_ERGONAUT_ONE_RIGHT - def_bool $(shields_list_contains,ergonaut_one_right) diff --git a/config/boards/shields/ergonaut_one/ergonaut_one.dtsi b/config/boards/shields/ergonaut_one/ergonaut_one.dtsi deleted file mode 100644 index c074463..0000000 --- a/config/boards/shields/ergonaut_one/ergonaut_one.dtsi +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#include - -/ { - chosen { - zmk,kscan = &kscan0; - zmk,matrix_transform = &default_transform; - /* /delete-property/ zephyr,console; */ - /* /delete-property/ zephyr,shell-uart; */ - }; - - default_transform: keymap_transform_0 { - compatible = "zmk,matrix-transform"; - columns = <12>; - rows = <4>; - - // | SW1 | SW2 | SW3 | SW4 | SW5 | SW6 | | SW6 | SW5 | SW4 | SW3 | SW2 | SW1 | - // | SW7 | SW8 | SW9 | SW10 | SW11 | SW12 | | SW12 | SW11 | SW10 | SW9 | SW8 | SW7 | - // | SW13 | SW14 | SW15 | SW16 | SW17 | SW18 | | SW18 | SW17 | SW16 | SW15 | SW14 | SW13 | - // | | | | SW20 | SW21 | SW22 | | SW22 | SW21 | SW20 | | | | - - map = < - RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,11) RC(0,10) RC(0,9) RC(0,8) RC(0,7) RC(0,6) - RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,11) RC(1,10) RC(1,9) RC(1,8) RC(1,7) RC(1,6) - RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,11) RC(2,10) RC(2,9) RC(2,8) RC(2,7) RC(2,6) - RC(3,3) RC(3,4) RC(3,5) RC(3,11) RC(3,10) RC(3,9) - >; - }; - - kscan0: kscan_0 { - compatible = "zmk,kscan-gpio-matrix"; - label = "KSCAN"; - wakeup-source; - - diode-direction = "col2row"; - row-gpios - = <&xiao_d 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&xiao_d 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&xiao_d 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&xiao_d 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - ; - }; -}; - -&xiao_spi { status = "disabled"; }; -&xiao_i2c { status = "disabled"; }; -&xiao_serial { status = "disabled"; }; diff --git a/config/boards/shields/ergonaut_one/ergonaut_one.keymap b/config/boards/shields/ergonaut_one/ergonaut_one.keymap deleted file mode 100644 index 6ee719e..0000000 --- a/config/boards/shields/ergonaut_one/ergonaut_one.keymap +++ /dev/null @@ -1,65 +0,0 @@ -#include -#include -#include - -#define DEF 0 -#define LWR 1 -#define RSE 2 -#define ADJ 3 - -< { - quick-tap-ms = <200>; -}; - -&mt { - quick-tap-ms = <200>; -}; - -/ { - conditional_layers { - compatible = "zmk,conditional-layers"; - - tri-layer { - if-layers = <1 2>; - then-layer = <3>; - }; - }; - - keymap { - compatible = "zmk,keymap"; - - default_layer { - bindings = < - &mt LGUI RBKT &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT - &mt LCTRL GRAVE &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &mt RCTRL SQT - &mt LALT MINUS &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &mt RALT BSLH - < RSE TAB &mt LSHFT SPACE < LWR RET < LWR ESC &mt RSHFT BSPC < RSE DEL - >; - }; - lower_layer { - bindings = < - &mt LGUI F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 - &mt LCTRL PLUS &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp STAR &kp LPAR &kp RPAR &mt RCTRL MINUS - &mt LALT EQUAL &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp RALT - &trans &trans &trans &trans &trans &trans - >; - }; - - raise_layer { - bindings = < - &mt LGUI KP_NUM &kp KP_SLASH &kp KP_N7 &kp KP_N8 &kp KP_N9 &kp KP_MINUS &kp C_VOL_UP &kp HOME &kp PSCRN &kp PG_UP &kp SLCK &kp CLCK - &mt LCTRL EQUAL &kp KP_MULTIPLY &kp KP_N4 &kp KP_N5 &kp KP_N6 &kp KP_PLUS &kp C_MUTE &kp LEFT &kp UP &kp RIGHT &kp INS &mt RCTRL K_APP - &kp LALT &kp KP_N0 &kp KP_N1 &kp KP_N2 &kp KP_N3 &kp KP_DOT &kp C_VOL_DN &kp END &kp DOWN &kp PG_DN &kp PAUSE_BREAK &kp RALT - &trans &trans &trans &trans &trans &trans - >; - }; - adjust_layer { - bindings = < - &bootloader &none &none &none &none &none &none &none &none &none &none &bootloader - &bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &bt BT_SEL 4 &bt BT_SEL 3 &bt BT_SEL 2 &bt BT_SEL 1 &bt BT_SEL 0 &bt BT_CLR - &sys_reset &none &none &none &none &none &none &none &none &none &none &sys_reset - &trans &none &trans &none &trans &trans - >; - }; - }; -}; diff --git a/config/boards/shields/ergonaut_one/ergonaut_one.zmk.yml b/config/boards/shields/ergonaut_one/ergonaut_one.zmk.yml deleted file mode 100644 index d7c537f..0000000 --- a/config/boards/shields/ergonaut_one/ergonaut_one.zmk.yml +++ /dev/null @@ -1,11 +0,0 @@ -file_format: '1' -id: ergonaut_one -name: Ergonaut One -type: shield -url: https://github.com/ergonautkb/one -requires: [seeeduino_xiao_ble] -features: - - keys -siblings: - - ergonaut_one_left - - ergonaut_one_right diff --git a/config/boards/shields/ergonaut_one/ergonaut_one_left.conf b/config/boards/shields/ergonaut_one/ergonaut_one_left.conf deleted file mode 100644 index c9f7988..0000000 --- a/config/boards/shields/ergonaut_one/ergonaut_one_left.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Copyright (c) 2020 The ZMK Contributors -# SPDX-License-Identifier: MIT diff --git a/config/boards/shields/ergonaut_one/ergonaut_one_left.overlay b/config/boards/shields/ergonaut_one/ergonaut_one_left.overlay deleted file mode 100644 index c63045b..0000000 --- a/config/boards/shields/ergonaut_one/ergonaut_one_left.overlay +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#include "ergonaut_one.dtsi" - -&kscan0 { - col-gpios - = <&xiao_d 0 GPIO_ACTIVE_HIGH> - , <&xiao_d 1 GPIO_ACTIVE_HIGH> - , <&xiao_d 2 GPIO_ACTIVE_HIGH> - , <&xiao_d 3 GPIO_ACTIVE_HIGH> - , <&xiao_d 4 GPIO_ACTIVE_HIGH> - , <&xiao_d 5 GPIO_ACTIVE_HIGH> - ; -}; diff --git a/config/boards/shields/ergonaut_one/ergonaut_one_right.conf b/config/boards/shields/ergonaut_one/ergonaut_one_right.conf deleted file mode 100644 index c9f7988..0000000 --- a/config/boards/shields/ergonaut_one/ergonaut_one_right.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Copyright (c) 2020 The ZMK Contributors -# SPDX-License-Identifier: MIT diff --git a/config/boards/shields/ergonaut_one/ergonaut_one_right.overlay b/config/boards/shields/ergonaut_one/ergonaut_one_right.overlay deleted file mode 100644 index b4a6cb5..0000000 --- a/config/boards/shields/ergonaut_one/ergonaut_one_right.overlay +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#include "ergonaut_one.dtsi" - -&default_transform { - col-offset = <6>; -}; - -&kscan0 { - col-gpios - = <&xiao_d 0 GPIO_ACTIVE_HIGH> - , <&xiao_d 1 GPIO_ACTIVE_HIGH> - , <&xiao_d 2 GPIO_ACTIVE_HIGH> - , <&xiao_d 3 GPIO_ACTIVE_HIGH> - , <&xiao_d 4 GPIO_ACTIVE_HIGH> - , <&xiao_d 5 GPIO_ACTIVE_HIGH> - ; -}; diff --git a/config/ergonaut_one.keymap b/config/ergonaut_one.keymap deleted file mode 120000 index d6403e1..0000000 --- a/config/ergonaut_one.keymap +++ /dev/null @@ -1 +0,0 @@ -boards/shields/ergonaut_one/ergonaut_one.keymap \ No newline at end of file diff --git a/config/ergonaut_one.keymap b/config/ergonaut_one.keymap new file mode 100644 index 0000000..285fa23 --- /dev/null +++ b/config/ergonaut_one.keymap @@ -0,0 +1,69 @@ +#include +#include +#include + +#define DEF 0 +#define LWR 1 +#define RSE 2 +#define ADJ 3 + +< { + quick-tap-ms = <200>; +}; + +&mt { + quick-tap-ms = <200>; +}; + +/ { + conditional_layers { + compatible = "zmk,conditional-layers"; + + tri-layer { + if-layers = ; + then-layer = ; + }; + }; + + keymap { + compatible = "zmk,keymap"; + + default_layer { + display-name = "MAIN"; + bindings = < + &mt LGUI RBKT &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT + &mt LCTRL GRAVE &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &mt RCTRL SQT + &mt LALT MINUS &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &mt RALT BSLH + < RSE TAB &mt LSHFT SPACE < LWR RET < LWR ESC &mt RSHFT BSPC < RSE DEL + >; + }; + lower_layer { + display-name = "SYM"; + bindings = < + &mt LGUI F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 + &mt LCTRL PLUS &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp STAR &kp LPAR &kp RPAR &mt RCTRL MINUS + &mt LALT EQUAL &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp RALT + &trans &trans &trans &trans &trans &trans + >; + }; + + raise_layer { + display-name = "NUM"; + bindings = < + &mt LGUI KP_NUM &kp KP_SLASH &kp KP_N7 &kp KP_N8 &kp KP_N9 &kp KP_MINUS &kp C_VOL_UP &kp HOME &kp PSCRN &kp PG_UP &kp SLCK &kp CLCK + &mt LCTRL EQUAL &kp KP_MULTIPLY &kp KP_N4 &kp KP_N5 &kp KP_N6 &kp KP_PLUS &kp C_MUTE &kp LEFT &kp UP &kp RIGHT &kp INS &mt RCTRL K_APP + &kp LALT &kp KP_N0 &kp KP_N1 &kp KP_N2 &kp KP_N3 &kp KP_DOT &kp C_VOL_DN &kp END &kp DOWN &kp PG_DN &kp PAUSE_BREAK &kp RALT + &trans &trans &trans &trans &trans &trans + >; + }; + adjust_layer { + display-name = "ADJ"; + bindings = < + &bootloader &studio_unlock &none &none &none &none &none &none &none &none &studio_unlock &bootloader + &bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &bt BT_SEL 4 &bt BT_SEL 3 &bt BT_SEL 2 &bt BT_SEL 1 &bt BT_SEL 0 &bt BT_CLR + &sys_reset &none &none &none &none &none &none &none &none &none &none &sys_reset + &trans &none &trans &none &trans &trans + >; + }; + }; +}; diff --git a/config/west.yml b/config/west.yml index 379d291..094d487 100644 --- a/config/west.yml +++ b/config/west.yml @@ -2,10 +2,15 @@ manifest: remotes: - name: zmkfirmware url-base: https://github.com/zmkfirmware + - name: ergonautkb + url-base: https://github.com/ergonautkb projects: - name: zmk remote: zmkfirmware revision: main import: app/west.yml + - name: one-zmk-module + remote: ergonautkb + revision: main self: path: config