From 4ce517e8ff77c3fc44b74e92ce9fd94c5e170f55 Mon Sep 17 00:00:00 2001 From: Clayton Wilson Date: Sat, 5 Oct 2024 21:01:02 -0500 Subject: [PATCH] Add spacecat38 definitions --- boards/shields/spacecat36/Kconfig.defconfig | 19 ++++ boards/shields/spacecat36/Kconfig.shield | 8 ++ boards/shields/spacecat36/spacecat36.conf | 0 boards/shields/spacecat36/spacecat36.dtsi | 56 ++++++++++ boards/shields/spacecat36/spacecat36.keymap | 103 ++++++++++++++++++ boards/shields/spacecat36/spacecat36.zmk.yml | 12 ++ .../shields/spacecat36/spacecat36_left.conf | 0 .../spacecat36/spacecat36_left.overlay | 1 + .../shields/spacecat36/spacecat36_right.conf | 0 .../spacecat36/spacecat36_right.overlay | 1 + 10 files changed, 200 insertions(+) create mode 100644 boards/shields/spacecat36/Kconfig.defconfig create mode 100644 boards/shields/spacecat36/Kconfig.shield create mode 100644 boards/shields/spacecat36/spacecat36.conf create mode 100644 boards/shields/spacecat36/spacecat36.dtsi create mode 100644 boards/shields/spacecat36/spacecat36.keymap create mode 100644 boards/shields/spacecat36/spacecat36.zmk.yml create mode 100644 boards/shields/spacecat36/spacecat36_left.conf create mode 100644 boards/shields/spacecat36/spacecat36_left.overlay create mode 100644 boards/shields/spacecat36/spacecat36_right.conf create mode 100644 boards/shields/spacecat36/spacecat36_right.overlay diff --git a/boards/shields/spacecat36/Kconfig.defconfig b/boards/shields/spacecat36/Kconfig.defconfig new file mode 100644 index 0000000..c5d03f4 --- /dev/null +++ b/boards/shields/spacecat36/Kconfig.defconfig @@ -0,0 +1,19 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +if SHIELD_CRADIO_LEFT + +config ZMK_KEYBOARD_NAME + default "Cradio" + +config ZMK_SPLIT_ROLE_CENTRAL + default y + +endif + +if SHIELD_CRADIO_LEFT || SHIELD_CRADIO_RIGHT + +config ZMK_SPLIT + default y + +endif diff --git a/boards/shields/spacecat36/Kconfig.shield b/boards/shields/spacecat36/Kconfig.shield new file mode 100644 index 0000000..affb1c5 --- /dev/null +++ b/boards/shields/spacecat36/Kconfig.shield @@ -0,0 +1,8 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config SHIELD_CRADIO_LEFT + def_bool $(shields_list_contains,cradio_left) + +config SHIELD_CRADIO_RIGHT + def_bool $(shields_list_contains,cradio_right) diff --git a/boards/shields/spacecat36/spacecat36.conf b/boards/shields/spacecat36/spacecat36.conf new file mode 100644 index 0000000..e69de29 diff --git a/boards/shields/spacecat36/spacecat36.dtsi b/boards/shields/spacecat36/spacecat36.dtsi new file mode 100644 index 0000000..c2947e5 --- /dev/null +++ b/boards/shields/spacecat36/spacecat36.dtsi @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include +#include + +&cuddlykeyboards_ferris_layout { + transform = <&default_transform>; +}; + +/ { + chosen { + zmk,kscan = &kscan0; + }; + + 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,4) RC(0,21) RC(0,20) RC(0,19) RC(0,18) RC(0,17) + 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,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"; + wakeup-source; + + input-gpios + = <&pro_micro 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&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 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 14 (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 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 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + ; + }; + +}; diff --git a/boards/shields/spacecat36/spacecat36.keymap b/boards/shields/spacecat36/spacecat36.keymap new file mode 100644 index 0000000..a1634f0 --- /dev/null +++ b/boards/shields/spacecat36/spacecat36.keymap @@ -0,0 +1,103 @@ +// Copyright (c) 2022 The ZMK Contributors +// SPDX-License-Identifier: MIT + +#include +#include +#include + +// Home row mods macro +#define HRML(k1,k2,k3,k4) &ht LSHFT k1 &ht LALT k2 &ht LCTRL k3 &ht LGUI k4 +#define HRMR(k1,k2,k3,k4) &ht RGUI k1 &ht RCTRL k2 &ht RALT k3 &ht RSHFT k4 + +/ { + behaviors { + ht: hold_tap { + compatible = "zmk,behavior-hold-tap"; + #binding-cells = <2>; + flavor = "tap-preferred"; + tapping-term-ms = <220>; + quick-tap-ms = <150>; + require-prior-idle-ms = <100>; + bindings = <&kp>, <&kp>; + }; + }; + + conditional_layers { + compatible = "zmk,conditional-layers"; + tri_layer { + if-layers = <1 2>; + then-layer = <3>; + }; + }; + + keymap { + compatible = "zmk,keymap"; + default_layer { + bindings = < + //╭──────────┬──────────┬──────────┬──────────┬──────────╮ ╭──────────┬──────────┬──────────┬──────────┬──────────╮ + //│ Q │ W │ E │ R │ T │ │ Y │ U │ I │ O │ P │ + &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P + //├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤ + //│ A │ S │ D │ F │ G │ │ H │ J │ K │ L │ ' " │ + HRML(A, S, D, F) &kp G &kp H HRMR(J, K, L, SQT) + //├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤ + //│ Z │ X │ C │ V │ B │ │ N │ M │ , < │ . > │ / ? │ + &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH + //╰──────────┴──────────┴──────────┼──────────┼──────────┼──────────╮ ╭──────────┼──────────┼──────────┴──────────┴──────────┴──────────╯ + < 2 TAB &kp ENTER &kp ENTER &kp SPACE &kp SPACE < 1 BSPC + // ╰──────────┴──────────┴──────────╯ ╰──────────┴──────────┴──────────╯ + >; + }; + + right_layer { + bindings = < + //╭──────────┬──────────┬──────────┬──────────┬──────────╮ ╭──────────┬──────────┬──────────┬──────────┬──────────╮ + //│ INSERT │ 1 │ 2 │ 3 │ │ │ HOME │ PAGE DN │ PAGE UP │ END │ : │ + &kp INS &kp N1 &kp N2 &kp N3 &trans &kp HOME &kp PG_DN &kp PG_UP &kp END &kp COLON + //├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤ + //│ DELETE │ 4 │ 5 │ 6 │ │ │ LEFT │ DOWN │ UP │ RIGHT │ ; │ + &kp DEL &kp N4 &kp N5 &kp N6 &trans &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp SEMI + //├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤ + //│ CAPS │ 7 │ 8 │ 9 │ 0 │ │ │ │ │ │ │ + &caps_word &kp N7 &kp N8 &kp N9 &kp N0 &trans &trans &trans &trans &trans + //╰──────────┴──────────┴──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┴──────────┴──────────╯ + &trans &kp ESC &trans &trans + // ╰──────────┴──────────╯ ╰──────────┴──────────╯ + >; + }; + + left_layer { + bindings = < + //╭──────────┬──────────┬──────────┬──────────┬──────────╮ ╭──────────┬──────────┬──────────┬──────────┬──────────╮ + //│ │ [ │ { │ } │ │ │ ^ │ ( │ ) │ ] │ ~ │ + &trans &kp LBKT &kp LBRC &kp RBRC &trans &kp CARET &kp LPAR &kp RPAR &kp RBKT &kp TILDE + //├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤ + //│ ! │ @ │ # │ $ │ % │ │ * │ - │ = │ \ │ ` │ + &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp ASTRK &kp MINUS &kp EQUAL &kp BSLH &kp GRAVE + //├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤ + //│ │ │ │ │ │ │ & │ _ │ + │ │ │ │ + &trans &trans &trans &trans &trans &kp AMPS &kp UNDER &kp PLUS &kp PIPE &trans + //╰──────────┴──────────┴──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┴──────────┴──────────╯ + &trans &trans &trans &trans + // ╰──────────┴──────────╯ ╰──────────┴──────────╯ + >; + }; + + tri_layer { + bindings = < + //╭──────────┬──────────┬──────────┬──────────┬──────────╮ ╭──────────┬──────────┬──────────┬──────────┬──────────╮ + //│ RESET │ │ │ │PROFILE 0 │ │ │ │ │ │ RESET │ + &sys_reset &trans &trans &trans &bt BT_SEL 0 &trans &trans &trans &trans &sys_reset + //├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤ + //│BOOTLOADER│ │ │ │PROFILE 1 │ │ │ │ │ │BOOTLOADER│ + &bootloader &trans &trans &trans &bt BT_SEL 1 &trans &trans &trans &trans &bootloader + //├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤ + //│ │ │ │ CLEAR BT │PROFILE 2 │ │ │ │ │ │ │ + &trans &trans &trans &bt BT_CLR &bt BT_SEL 2 &trans &trans &trans &trans &trans + //╰──────────┴──────────┴──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┴──────────┴──────────╯ + &trans &trans &trans &trans + // ╰──────────┴──────────╯ ╰──────────┴──────────╯ + >; + }; + }; +}; diff --git a/boards/shields/spacecat36/spacecat36.zmk.yml b/boards/shields/spacecat36/spacecat36.zmk.yml new file mode 100644 index 0000000..19d46a4 --- /dev/null +++ b/boards/shields/spacecat36/spacecat36.zmk.yml @@ -0,0 +1,12 @@ +file_format: "1" +id: spacecat36 +name: spacecat36 +type: shield +url: https://github.com/ClaytonWWilson/SpaceCat38 +requires: [pro_micro] +exposes: [i2c_oled] +features: + - keys +siblings: + - spacecat36_left + - spacecat36_right diff --git a/boards/shields/spacecat36/spacecat36_left.conf b/boards/shields/spacecat36/spacecat36_left.conf new file mode 100644 index 0000000..e69de29 diff --git a/boards/shields/spacecat36/spacecat36_left.overlay b/boards/shields/spacecat36/spacecat36_left.overlay new file mode 100644 index 0000000..f7b81eb --- /dev/null +++ b/boards/shields/spacecat36/spacecat36_left.overlay @@ -0,0 +1 @@ +#include "spacecat36.dtsi" \ No newline at end of file diff --git a/boards/shields/spacecat36/spacecat36_right.conf b/boards/shields/spacecat36/spacecat36_right.conf new file mode 100644 index 0000000..e69de29 diff --git a/boards/shields/spacecat36/spacecat36_right.overlay b/boards/shields/spacecat36/spacecat36_right.overlay new file mode 100644 index 0000000..f7b81eb --- /dev/null +++ b/boards/shields/spacecat36/spacecat36_right.overlay @@ -0,0 +1 @@ +#include "spacecat36.dtsi" \ No newline at end of file