From 4c317e0febdb9b507ca202b03aebba05384c7646 Mon Sep 17 00:00:00 2001 From: Sam Mohr Date: Sun, 30 Jan 2022 15:55:22 -0500 Subject: [PATCH] Add support for the Clog (#1092) * Add support for the Clog * format DTSI definition * add a default keymap * update copyright year, reduce conf to minimum --- app/boards/shields/clog/Kconfig.defconfig | 19 ++++ app/boards/shields/clog/Kconfig.shield | 8 ++ app/boards/shields/clog/README.md | 8 ++ app/boards/shields/clog/clog.conf | 0 app/boards/shields/clog/clog.dtsi | 51 ++++++++++ app/boards/shields/clog/clog.keymap | 113 +++++++++++++++++++++ app/boards/shields/clog/clog.zmk.yml | 11 ++ app/boards/shields/clog/clog_left.overlay | 7 ++ app/boards/shields/clog/clog_right.overlay | 11 ++ 9 files changed, 228 insertions(+) create mode 100644 app/boards/shields/clog/Kconfig.defconfig create mode 100644 app/boards/shields/clog/Kconfig.shield create mode 100644 app/boards/shields/clog/README.md create mode 100644 app/boards/shields/clog/clog.conf create mode 100644 app/boards/shields/clog/clog.dtsi create mode 100644 app/boards/shields/clog/clog.keymap create mode 100644 app/boards/shields/clog/clog.zmk.yml create mode 100644 app/boards/shields/clog/clog_left.overlay create mode 100644 app/boards/shields/clog/clog_right.overlay diff --git a/app/boards/shields/clog/Kconfig.defconfig b/app/boards/shields/clog/Kconfig.defconfig new file mode 100644 index 00000000..60ef47e4 --- /dev/null +++ b/app/boards/shields/clog/Kconfig.defconfig @@ -0,0 +1,19 @@ +# Copyright (c) 2022 The ZMK Contributors +# SPDX-License-Identifier: MIT + +if SHIELD_CLOG_LEFT + +config ZMK_KEYBOARD_NAME + default "Clog" + +config ZMK_SPLIT_BLE_ROLE_CENTRAL + default y + +endif + +if SHIELD_CLOG_LEFT || SHIELD_CLOG_RIGHT + +config ZMK_SPLIT + default y + +endif diff --git a/app/boards/shields/clog/Kconfig.shield b/app/boards/shields/clog/Kconfig.shield new file mode 100644 index 00000000..2301af94 --- /dev/null +++ b/app/boards/shields/clog/Kconfig.shield @@ -0,0 +1,8 @@ +# Copyright (c) 2022 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config SHIELD_CLOG_LEFT + def_bool $(shields_list_contains,clog_left) + +config SHIELD_CLOG_RIGHT + def_bool $(shields_list_contains,clog_right) diff --git a/app/boards/shields/clog/README.md b/app/boards/shields/clog/README.md new file mode 100644 index 00000000..6b63889a --- /dev/null +++ b/app/boards/shields/clog/README.md @@ -0,0 +1,8 @@ +# The Clog + +The Clog is a 34-key choc v1 split board by S'mores. This firmware works for both the [Clog][clog], +as well as the [Sephirette][sephirette], the MX version. You can purchase kits for both boards +at smoresboards.com. + +[clog]: https://github.com/smores56/clog +[sephirette]: https://github.com/smores56/sephirette diff --git a/app/boards/shields/clog/clog.conf b/app/boards/shields/clog/clog.conf new file mode 100644 index 00000000..e69de29b diff --git a/app/boards/shields/clog/clog.dtsi b/app/boards/shields/clog/clog.dtsi new file mode 100644 index 00000000..27943100 --- /dev/null +++ b/app/boards/shields/clog/clog.dtsi @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include + +/ { + chosen { + zmk,kscan = &kscan0; + zmk,matrix_transform = &default_transform; + }; + + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <34>; + rows = <1>; + map = < + RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,20) RC(0,19) RC(0,18) RC(0,17) + RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,26) RC(0,25) RC(0,24) RC(0,23) RC(0,22) RC(0,21) + RC(0,10) RC(0,11) RC(0,12) RC(0,13) RC(0,14) RC(0,31) RC(0,30) RC(0,29) RC(0,28) RC(0,27) + RC(0,15) RC(0,16) RC(0,33) RC(0,32) + >; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-direct"; + label = "KSCAN"; + + input-gpios + = <&pro_micro 18 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 19 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 20 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 21 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 16 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + ; + }; +}; diff --git a/app/boards/shields/clog/clog.keymap b/app/boards/shields/clog/clog.keymap new file mode 100644 index 00000000..885404f7 --- /dev/null +++ b/app/boards/shields/clog/clog.keymap @@ -0,0 +1,113 @@ +/* +* Copyright (c) 2022 The ZMK Contributors +* +* SPDX-License-Identifier: MIT +*/ + +#include +#include +#include + +#define MAIN 0 +#define SYM 1 +#define NAV 2 +#define BT 3 + +&mt { + flavor = "tap-preferred"; + tapping_term_ms = <140>; +}; + +/ { + combos { + compatible = "zmk,combos"; + + combo_esc { + timeout-ms = <100>; + key-positions = <21 22>; + bindings = <&kp ESC>; + }; + + combo_tab { + timeout-ms = <100>; + key-positions = <22 23>; + bindings = <&kp TAB>; + }; + + combo_minus { + timeout-ms = <100>; + key-positions = <26 27>; + bindings = <&kp MINUS>; + }; + + combo_underscore { + timeout-ms = <100>; + key-positions = <26 28>; + bindings = <&kp UNDERSCORE>; + }; + + combo_colon { + timeout-ms = <100>; + key-positions = <7 8>; + bindings = <&kp COLON>; + }; + + combo_semicolon { + timeout-ms = <100>; + key-positions = <6 8>; + bindings = <&kp SEMICOLON>; + }; + + combo_backslash { + timeout-ms = <100>; + key-positions = <27 28>; + bindings = <&kp BSLH>; + }; + + combo_grave { + timeout-ms = <100>; + key-positions = <8 9>; + bindings = <&kp GRAVE>; + }; + }; + + keymap { + compatible = "zmk,keymap"; + + MAIN_layer { + bindings = < + &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O + &kp Q &kp A &kp S &kp D < SYM F &kp G &kp H < SYM J &kp K &kp L &kp SQT &kp P + &mt LSHFT Z &mt LALT X &mt LCTRL C &mt LGUI V &kp B &kp N &mt RGUI M &mt RCTRL COMMA &mt RALT DOT &mt RSHFT FSLH + < BT ENTER < NAV SPACE &sk RSHFT &kp BSPC + >; + }; + + SYM_layer { + bindings = < + &kp N7 &kp N8 &kp N9 &kp STAR &kp DLLR &kp LBRC &kp RBRC &kp HASH + &kp AMPS &kp EXCL &kp N1 &kp N2 &kp N3 &kp EQUAL &kp LT &kp LPAR &kp RPAR &kp GT &kp PIPE &none + &kp CARET &kp N4 &kp N5 &kp N6 &kp PLUS &kp TILDE &kp LBKT &kp RBKT &kp AT &kp PRCNT + &kp DOT &kp N0 &trans &none + >; + }; + + NAV_layer { + bindings = < + &kp C_VOL_DN &kp C_VOL_UP &kp C_NEXT &kp C_PP &none &kp F7 &kp F8 &kp F9 + &kp C_PREV &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp LC(TAB) &kp PSCRN &kp F1 &kp F2 &kp F3 &kp F10 &kp F12 + &kp HOME &kp PG_DN &kp PG_UP &kp END &kp LS(LC(TAB)) &kp CAPS &kp F4 &kp F5 &kp F6 &kp F11 + &none &none &trans &kp DEL + >; + }; + + BT_layer { + bindings = < + &none &none &none &none &none &none &none &none + &none &none &none &none &none &none &none &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &none + &none &none &none &none &none &none &bt BT_CLR &none &none &none + &none &none &none &none + >; + }; + }; +}; diff --git a/app/boards/shields/clog/clog.zmk.yml b/app/boards/shields/clog/clog.zmk.yml new file mode 100644 index 00000000..f71df0df --- /dev/null +++ b/app/boards/shields/clog/clog.zmk.yml @@ -0,0 +1,11 @@ +file_format: "1" +id: clog +name: Clog +type: shield +url: https://github.com/smores56/clog +requires: [pro_micro] +features: + - keys +siblings: + - clog_left + - clog_right diff --git a/app/boards/shields/clog/clog_left.overlay b/app/boards/shields/clog/clog_left.overlay new file mode 100644 index 00000000..58246025 --- /dev/null +++ b/app/boards/shields/clog/clog_left.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include "clog.dtsi" diff --git a/app/boards/shields/clog/clog_right.overlay b/app/boards/shields/clog/clog_right.overlay new file mode 100644 index 00000000..0dc5d64f --- /dev/null +++ b/app/boards/shields/clog/clog_right.overlay @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include "clog.dtsi" + +&default_transform { + col-offset = <17>; +};