From 275568cd037af8e1a0092a15709e9bc8dfc38410 Mon Sep 17 00:00:00 2001 From: hannah Date: Mon, 7 Aug 2023 13:45:14 -0400 Subject: [PATCH] Add dongle shield --- .../corneish_zen_dongle/Kconfig.defconfig | 24 +++++ .../corneish_zen_dongle/Kconfig.shield | 5 ++ .../corneish_zen_dongle.conf | 10 +++ .../corneish_zen_dongle.dtsi | 69 ++++++++++++++ .../corneish_zen_dongle.keymap | 90 +++++++++++++++++++ .../corneish_zen_dongle.overlay | 7 ++ .../corneish_zen_dongle.zmk.yml | 11 +++ 7 files changed, 216 insertions(+) create mode 100644 app/boards/shields/corneish_zen_dongle/Kconfig.defconfig create mode 100644 app/boards/shields/corneish_zen_dongle/Kconfig.shield create mode 100644 app/boards/shields/corneish_zen_dongle/corneish_zen_dongle.conf create mode 100644 app/boards/shields/corneish_zen_dongle/corneish_zen_dongle.dtsi create mode 100644 app/boards/shields/corneish_zen_dongle/corneish_zen_dongle.keymap create mode 100644 app/boards/shields/corneish_zen_dongle/corneish_zen_dongle.overlay create mode 100644 app/boards/shields/corneish_zen_dongle/corneish_zen_dongle.zmk.yml diff --git a/app/boards/shields/corneish_zen_dongle/Kconfig.defconfig b/app/boards/shields/corneish_zen_dongle/Kconfig.defconfig new file mode 100644 index 00000000..873bcebc --- /dev/null +++ b/app/boards/shields/corneish_zen_dongle/Kconfig.defconfig @@ -0,0 +1,24 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +if SHIELD_CORNEISH_ZEN_DONGLE + +config BOARD + default "corneish_zen" + +config ZMK_KEYBOARD_NAME + default "Corne-ish Zen" + +config ZMK_SPLIT_BLE_ROLE_CENTRAL + default y + +config ZMK_USB + default y + +config ZMK_SPLIT + default y + +config ZMK_BLE + default y + +endif diff --git a/app/boards/shields/corneish_zen_dongle/Kconfig.shield b/app/boards/shields/corneish_zen_dongle/Kconfig.shield new file mode 100644 index 00000000..36c3cdc4 --- /dev/null +++ b/app/boards/shields/corneish_zen_dongle/Kconfig.shield @@ -0,0 +1,5 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config SHIELD_CORNEISH_ZEN_DONGLE + def_bool $(shields_list_contains,corneish_zen_dongle) diff --git a/app/boards/shields/corneish_zen_dongle/corneish_zen_dongle.conf b/app/boards/shields/corneish_zen_dongle/corneish_zen_dongle.conf new file mode 100644 index 00000000..5530c841 --- /dev/null +++ b/app/boards/shields/corneish_zen_dongle/corneish_zen_dongle.conf @@ -0,0 +1,10 @@ +# Copyright (c) 2022 The ZMK Contributors +# SPDX-License-Identifier: MIT + +CONFIG_ZMK_SPLIT_BLE_CENTRAL_PERIPHERALS=2 +CONFIG_BT_CTLR_TX_PWR_PLUS_8=y + +CONFIG_ZMK_SLEEP=n +# CONFIG_PM_DEVICE=n +CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000 +CONFIG_ZMK_EXT_POWER=y diff --git a/app/boards/shields/corneish_zen_dongle/corneish_zen_dongle.dtsi b/app/boards/shields/corneish_zen_dongle/corneish_zen_dongle.dtsi new file mode 100644 index 00000000..2a25bb75 --- /dev/null +++ b/app/boards/shields/corneish_zen_dongle/corneish_zen_dongle.dtsi @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2020 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 = <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 | +// | SW19 | SW20 | SW21 | | SW21 | SW20 | SW19 | + 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,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) + >; + }; + + five_column_transform: keymap_transform_1 { + compatible = "zmk,matrix-transform"; + columns = <10>; + rows = <4>; +// | SW2 | SW3 | SW4 | SW5 | SW6 | | SW6 | SW5 | SW4 | SW3 | SW2 | +// | SW8 | SW9 | SW10 | SW11 | SW12 | | SW12 | SW11 | SW10 | SW9 | SW8 | +// | SW14 | SW15 | SW16 | SW17 | SW18 | | SW18 | SW17 | SW16 | SW15 | SW14 | +// | SW19 | SW20 | SW21 | | SW21 | SW20 | SW19 | + map = < +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(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(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(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) + >; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + + diode-direction = "col2row"; + row-gpios + = <&pro_micro 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + + col-gpios + = <&pro_micro 14 GPIO_ACTIVE_HIGH> + , <&pro_micro 15 GPIO_ACTIVE_HIGH> + , <&pro_micro 18 GPIO_ACTIVE_HIGH> + , <&pro_micro 19 GPIO_ACTIVE_HIGH> + , <&pro_micro 20 GPIO_ACTIVE_HIGH> + , <&pro_micro 21 GPIO_ACTIVE_HIGH> + ; + }; +}; diff --git a/app/boards/shields/corneish_zen_dongle/corneish_zen_dongle.keymap b/app/boards/shields/corneish_zen_dongle/corneish_zen_dongle.keymap new file mode 100644 index 00000000..b918b460 --- /dev/null +++ b/app/boards/shields/corneish_zen_dongle/corneish_zen_dongle.keymap @@ -0,0 +1,90 @@ +/* +* +* Copyright (c) 2021 Darryl deHaan +* SPDX-License-Identifier: MIT +* +*/ + +#include +#include +#include +#include + +/ { + chosen { + zmk,matrix_transform = &default_transform; + }; +}; + +/ { + conditional_layers { + compatible = "zmk,conditional-layers"; + tri_layer { + if-layers = <1 2>; + then-layer = <3>; + }; + }; + keymap { + compatible = "zmk,keymap"; + + default_layer { + label = "BASE"; +// -------------------------------------------------------------------------------- +// | TAB | Q | W | E | R | T | | Y | U | I | O | P | BKSP | +// | CTRL | A | S | D | F | G | | H | J | K | L | ; | ' | +// | SHFT | Z | X | C | V | B | | N | M | , | . | / | ESC | +// | GUI | LWR | SPC | | ENT | RSE | ALT | + bindings = < +&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSPC +&kp LCTRL &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT +&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp ESC + &kp LGUI &mo 1 &kp SPACE &kp RET &mo 2 &kp RALT + >; + }; + + lower_layer { + label = "LOWER"; +// ----------------------------------------------------------------------------------------- +// | TAB | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BKSP | +// | | | | | | | | LFT | DWN | UP | RGT | | | +// | SHFT | | | | | | | | | | | | | +// | GUI | | SPC | | ENT | | ALT | + bindings = < +&kp TAB &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp BSPC +&trans &trans &trans &trans &trans &trans &kp LEFT &kp DOWN &kp UP &kp RIGHT &trans &trans +&kp LSHFT &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &kp LGUI &trans &kp SPACE &kp RET &trans &kp RALT + >; + }; + + raise_layer { + label = "RAISE"; +// ----------------------------------------------------------------------------- +// | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | DEL | +// | | | | | | | | - | = | { | } | \ | ` | +// | | | | | | | | _ | + | [ | ] | | | ~ | +// | | ADJ | | | | | | + bindings = < +&trans &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp KP_MULTIPLY &kp LPAR &kp RPAR &kp DEL +&trans &trans &trans &trans &trans &trans &kp MINUS &kp EQUAL &kp LBKT &kp RBKT &kp BSLH &kp GRAVE +&trans &trans &trans &trans &trans &trans &kp UNDER &kp PLUS &kp LBRC &kp RBRC &kp PIPE &kp TILDE + &trans &trans &trans &trans &trans &trans + >; + }; + + adjust_layer { + label = "ADJUST"; +// ----------------------------------------------------------------------------- +// | F12 | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | +// | | | | | | | | PRV | PP | NXT | MUT | VDN | VUP | +// | CLR | BT1 | BT2 | BT3 | BT4 | TOG | | | | | | | | +// | GUI | | SPC | | ENT | | ALT | + bindings = < +&kp F12 &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 +&trans &trans &trans &trans &trans &trans &kp C_PREV &kp C_PP &kp C_NEXT &kp C_MUTE &kp C_VOL_DN &kp C_VOL_UP +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans + >; + }; + }; +}; diff --git a/app/boards/shields/corneish_zen_dongle/corneish_zen_dongle.overlay b/app/boards/shields/corneish_zen_dongle/corneish_zen_dongle.overlay new file mode 100644 index 00000000..566c34a1 --- /dev/null +++ b/app/boards/shields/corneish_zen_dongle/corneish_zen_dongle.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include "corneish_zen_dongle.dtsi" diff --git a/app/boards/shields/corneish_zen_dongle/corneish_zen_dongle.zmk.yml b/app/boards/shields/corneish_zen_dongle/corneish_zen_dongle.zmk.yml new file mode 100644 index 00000000..7598b15e --- /dev/null +++ b/app/boards/shields/corneish_zen_dongle/corneish_zen_dongle.zmk.yml @@ -0,0 +1,11 @@ +file_format: "1" +id: corneish_zen_dongle +name: Corne-ish Zen Dongle +type: shield +url: https://github.com/benvallack/zmk-config-enki42 +requires: [pro_micro] +exposes: [i2c_oled] +features: + - keys +siblings: + - corneish_zen_dongle