From a28712ef744b5b22ac17125a7a5f35a81f49b476 Mon Sep 17 00:00:00 2001 From: unexplrd Date: Thu, 6 Feb 2025 17:33:09 +0200 Subject: [PATCH] initial --- .gitignore | 7 + LICENSE | 21 +++ README.md | 6 + build.yaml | 8 + .../shields/hillside46/Kconfig.defconfig | 19 +++ .../boards/shields/hillside46/Kconfig.shield | 8 + config/boards/shields/hillside46/README.md | 21 +++ .../hillside46/boards/nice_nano.overlay | 37 +++++ .../hillside46/boards/nice_nano_v2.overlay | 46 ++++++ .../hillside46/boards/nrfmicro_13.overlay | 46 ++++++ .../boards/shields/hillside46/hillside46.dtsi | 68 +++++++++ .../shields/hillside46/hillside46.keymap | 139 ++++++++++++++++++ .../shields/hillside46/hillside46.zmk.yml | 13 ++ .../hillside46/hillside46_left.overlay | 22 +++ .../hillside46/hillside46_right.overlay | 26 ++++ config/hillside46.conf | 14 ++ config/hillside46.keymap | 135 +++++++++++++++++ config/west.yml | 11 ++ flake.lock | 48 ++++++ flake.nix | 49 ++++++ 20 files changed, 744 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 build.yaml create mode 100644 config/boards/shields/hillside46/Kconfig.defconfig create mode 100644 config/boards/shields/hillside46/Kconfig.shield create mode 100644 config/boards/shields/hillside46/README.md create mode 100644 config/boards/shields/hillside46/boards/nice_nano.overlay create mode 100644 config/boards/shields/hillside46/boards/nice_nano_v2.overlay create mode 100644 config/boards/shields/hillside46/boards/nrfmicro_13.overlay create mode 100644 config/boards/shields/hillside46/hillside46.dtsi create mode 100644 config/boards/shields/hillside46/hillside46.keymap create mode 100644 config/boards/shields/hillside46/hillside46.zmk.yml create mode 100644 config/boards/shields/hillside46/hillside46_left.overlay create mode 100644 config/boards/shields/hillside46/hillside46_right.overlay create mode 100644 config/hillside46.conf create mode 100644 config/hillside46.keymap create mode 100644 config/west.yml create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f9b06ad --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +/.west +/modules +/zephyr +/zmk +/build +result +result-* diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..17208b6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 The ZMK Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..51cb331 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +

Hillside ZMK firmware

+

hillside +Build

+

This is my personal config for Hillside46 split keyboard. Layout is based on Miryoku with outer columns added from Watchman Layouts.

+

Build and install

+

This config uses zmk-nix to build ZMK firmware, so it's as simple as running nix -vL --show-trace build. Build files for GitHub Actions are also included.

diff --git a/build.yaml b/build.yaml new file mode 100644 index 0000000..a54b607 --- /dev/null +++ b/build.yaml @@ -0,0 +1,8 @@ +--- +include: + + - board: nice_nano_v2 + shield: hillside46_left + cmake-args: -DCONFIG_ZMK_POINTING=y + - board: nice_nano_v2 + shield: hillside46_right diff --git a/config/boards/shields/hillside46/Kconfig.defconfig b/config/boards/shields/hillside46/Kconfig.defconfig new file mode 100644 index 0000000..5c0468f --- /dev/null +++ b/config/boards/shields/hillside46/Kconfig.defconfig @@ -0,0 +1,19 @@ +# Copyright (c) 2021-2022 The ZMK Contributors +# SPDX-License-Identifier: MIT + +if SHIELD_HILLSIDE46_LEFT + +config ZMK_KEYBOARD_NAME + default "Hillside46" + +config ZMK_SPLIT_BLE_ROLE_CENTRAL + default y + +endif + +if SHIELD_HILLSIDE46_LEFT || SHIELD_HILLSIDE46_RIGHT + +config ZMK_SPLIT + default y + +endif \ No newline at end of file diff --git a/config/boards/shields/hillside46/Kconfig.shield b/config/boards/shields/hillside46/Kconfig.shield new file mode 100644 index 0000000..b9e2f04 --- /dev/null +++ b/config/boards/shields/hillside46/Kconfig.shield @@ -0,0 +1,8 @@ +# Copyright (c) 2021-2022 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config SHIELD_HILLSIDE46_LEFT + def_bool $(shields_list_contains,hillside46_left) + +config SHIELD_HILLSIDE46_RIGHT + def_bool $(shields_list_contains,hillside46_right) \ No newline at end of file diff --git a/config/boards/shields/hillside46/README.md b/config/boards/shields/hillside46/README.md new file mode 100644 index 0000000..385e5bb --- /dev/null +++ b/config/boards/shields/hillside46/README.md @@ -0,0 +1,21 @@ +Hillside 46 is a split ergonomic keyboard with 3x6+5 choc-spaced keys. +It has the aggressive stagger of the Ferris but a longer thumb arc and a break-off outer pinkie column. +More information is at [github/mmccoyd](https://github.com/mmccoyd/hillside/). + +The default keymap is described in + [QMK](https://github.com/qmk/qmk_firmware/tree/master/keyboards/handwired/hillside/46). + +For ZMK, the adjust layer has a few differences from the QMK version: + +- Extra keys for bluetooth, reset and output. +- No swap Alt GUI keys. +- No RGB controls as RGB eats power. +- Bluetooth clear is deliberately in an inconvenient spot to avoid unpairing. + +If used, the following must be manually enabled in hillside46.conf: + +- Encoders +- Underglow + +If desired, you could hardwire a display to the I2C header, + which is arranged for a haptic feedback board. \ No newline at end of file diff --git a/config/boards/shields/hillside46/boards/nice_nano.overlay b/config/boards/shields/hillside46/boards/nice_nano.overlay new file mode 100644 index 0000000..debed23 --- /dev/null +++ b/config/boards/shields/hillside46/boards/nice_nano.overlay @@ -0,0 +1,37 @@ +/* Copyright (c) 2021-2022 The ZMK Contributors + * SPDX-License-Identifier: MIT + */ + +#include + +&spi1 { + compatible = "nordic,nrf-spim"; + status = "okay"; + mosi-pin = <6>; + // Unused pins, needed for SPI def, but not used by ws2812 driver. + sck-pin = <5>; + miso-pin = <7>; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + label = "WS2812"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <4>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + color-mapping = ; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; \ No newline at end of file diff --git a/config/boards/shields/hillside46/boards/nice_nano_v2.overlay b/config/boards/shields/hillside46/boards/nice_nano_v2.overlay new file mode 100644 index 0000000..424a617 --- /dev/null +++ b/config/boards/shields/hillside46/boards/nice_nano_v2.overlay @@ -0,0 +1,46 @@ +#include + +&pinctrl { + spi3_default: spi3_default { + group1 { + psels = ; + }; + }; + + spi3_sleep: spi3_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi3 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi3_default>; + pinctrl-1 = <&spi3_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <10>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = ; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/config/boards/shields/hillside46/boards/nrfmicro_13.overlay b/config/boards/shields/hillside46/boards/nrfmicro_13.overlay new file mode 100644 index 0000000..dba8377 --- /dev/null +++ b/config/boards/shields/hillside46/boards/nrfmicro_13.overlay @@ -0,0 +1,46 @@ +#include + +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi1 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <10>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = ; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/config/boards/shields/hillside46/hillside46.dtsi b/config/boards/shields/hillside46/hillside46.dtsi new file mode 100644 index 0000000..453df20 --- /dev/null +++ b/config/boards/shields/hillside46/hillside46.dtsi @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2021-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 = <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 / SW19 / \ SW19 \ SW18 | SW17 | SW16 | SW15 | SW14 | SW13 | +// | SW20 / SW21 / SW22 / SW23 / \ SW23 \ SW23 \ SW21 \ SW20 | + 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(3,5) RC(3,6) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11) + RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,7) RC(3,8) RC(3,9) RC(3,10) + >; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + + diode-direction = "col2row"; + row-gpios + = <&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)> + , <&pro_micro 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + + }; + + left_encoder: encoder_left { + compatible = "alps,ec11"; + label = "LEFT_ENCODER"; + a-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + resolution = <4>; + status = "disabled"; + }; + + right_encoder: encoder_right { + compatible = "alps,ec11"; + label = "RIGHT_ENCODER"; + a-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + resolution = <4>; + status = "disabled"; + }; + + sensors { + compatible = "zmk,keymap-sensors"; + sensors = <&left_encoder &right_encoder>; + }; + +}; \ No newline at end of file diff --git a/config/boards/shields/hillside46/hillside46.keymap b/config/boards/shields/hillside46/hillside46.keymap new file mode 100644 index 0000000..2ecd00e --- /dev/null +++ b/config/boards/shields/hillside46/hillside46.keymap @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2021-2022 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include +#include +#include + +#define QWERTY_L 0 +#define DVORAK_L 1 +#define COLEMK_L 2 +#define NAV_L 3 +#define SYM_L 4 +#define ADJ_L 5 + +#define Undo LC(Z) +#define Cut LC(X) +#define Copy LC(C) +#define Paste LC(V) +#define Redo LC(Y) + + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { +/* QWERTY + * ------------------------------------------------------------------------------------------------------------------------------------- + * | ` | Q | W | E | R | T |-----------------------------------| Y | U | I | O | P | BKSPC | + * | TAB | A | S | D | F | G |-----------------------------------| H | J | K | L | ; | ENTER | + * | CTRL | Z | X | C | V | B | ESC |-------------------| CAPS | N | M | , | . | / | ' | + * | GUI | ALT |SK SHFT| Nav |---| Sym | SPACE | ALT | GUI | + */ + bindings = < +&kp GRAVE &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSPC +&kp TAB &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp ENTER +&kp LCTRL &kp Z &kp X &kp C &kp V &kp B &kp ESC &caps_word &kp N &kp M &kp COMMA &kp DOT &kp SLASH &kp SQT + &kp LGUI &kp LALT &sk LSHIFT &mo NAV_L &mo SYM_L &kp SPACE &kp LALT &kp RGUI + >; + + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>; + }; + + dvorak_layer { +/* DVORAK + * ------------------------------------------------------------------------------------------------------------------------------------- + * | ` | ' | , | . | P | Y |-----------------------------------| F | G | C | R | L | BKSPC | + * | TAB | A | O | E | U | I |-----------------------------------| D | H | T | N | S | ENTER | + * | CTRL | ; | Q | J | K | X | ESC |-------------------| CAPS | B | M | W | V | Z | / | + * | GUI | ALT |SK SHFT| Nav |---| Sym | SPACE | ALT | GUI | + */ + bindings = < +&kp GRAVE &kp SQT &kp COMMA &kp DOT &kp P &kp Y &kp F &kp G &kp C &kp R &kp L &kp BSPC +&kp TAB &kp A &kp O &kp E &kp U &kp I &kp D &kp H &kp T &kp N &kp S &kp ENTER +&kp LCTRL &kp SEMI &kp Q &kp J &kp K &kp X &kp ESC &caps_word &kp B &kp M &kp W &kp V &kp Z &kp SLASH + &kp LGUI &kp LALT &sk LSHIFT &mo NAV_L &mo SYM_L &kp SPACE &kp LALT &kp RGUI + >; + + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>; + }; + + colemak_layer { +/* COLEMAK-DH + * ------------------------------------------------------------------------------------------------------------------------------------- + * | ` | Q | W | F | P | B |-----------------------------------| J | L | U | Y | ; | BKSPC | + * | TAB | A | R | S | T | G |-----------------------------------| M | N | E | I | O | ENTER | + * | CTRL | Z | X | C | D | V | ESC |-------------------| CAPS | K | H | , | . | / | ' | + * | GUI | ALT |SK SHFT| Nav |---| Sym | SPACE | ALT | GUI | + */ + bindings = < +&kp GRAVE &kp Q &kp W &kp F &kp P &kp B &kp J &kp L &kp U &kp Y &kp SEMI &kp BSPC +&kp TAB &kp A &kp R &kp S &kp T &kp G &kp M &kp N &kp E &kp I &kp O &kp ENTER +&kp LCTRL &kp Z &kp X &kp C &kp D &kp V &kp ESC &caps_word &kp K &kp H &kp COMMA &kp DOT &kp SLASH &kp SQT + &kp LGUI &kp LALT &sk LSHIFT &mo NAV_L &mo SYM_L &kp SPACE &kp LALT &kp RGUI + >; + + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>; + }; + + nav_layer { +/* NAV + * ------------------------------------------------------------------------------------------------------------------------------------- + * | Copy | 1 | 2 | 3 | 4 | 5 |-----------------------------------| 6 | 7 | 8 | 9 | 0 | BSPC | + * | Cut | GUI | Alt | Ctrl | Shift | Paste |-----------------------------------| PG UP | Left | Up | Down | Right | PG DN | + * | Ctrl | F1 | F2 | F3 | F4 | F5 | UnDo |-------------------| ReDo | F6 | F7 | F8 | F9 | F10 | Ctrl | + * | | | | |---| ADJ_L | | | | + */ + bindings = < +&kp Copy &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &trans +&kp Cut &kp LGUI &kp LALT &kp LCTRL &kp LSHFT &kp Paste &kp PG_UP &kp LEFT &kp UP &kp DOWN &kp RIGHT &kp PG_DN +&trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp Undo &kp Redo &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp RCTRL + &trans &trans &trans &trans &mo ADJ_L &trans &trans &trans + >; + + sensor-bindings = <&inc_dec_kp PG_UP PG_DN &inc_dec_kp C_VOL_UP C_VOL_DN>; + }; + + sym_layer { +/* SYM + * ------------------------------------------------------------------------------------------------------------------------------------- + * | INS | ! | @ | # | $ | % |-----------------------------------| ^ | & | * | ( | ) | BSPC | + * | | \ | - | = | [ | ] |-----------------------------------| HOME | Shift | Ctrl | Alt | Gui | END | + * | Ctrl | | | _ | + | { | } |SkAltGr|-------------------| MENU | Mute | Vol- | Vol+ | Play | | Ctrl | + * | | | | ADJ_L |---| | | | | + */ + bindings = < +&kp INS &kp EXCL &kp AT &kp HASH &kp DOLLAR &kp PERCENT &kp CARET &kp AMPS &kp ASTRK &kp LPAR &kp RPAR &kp DEL +&none &kp BSLH &kp MINUS &kp EQUAL &kp LBKT &kp RBKT &kp HOME &kp RSHFT &kp RCTRL &kp LALT &kp RGUI &kp END +&trans &kp PIPE &kp UNDER &kp PLUS &kp LBRC &kp RBRC &sk RALT &kp K_APP &kp C_MUTE &kp C_VOL_DN &kp C_VOL_UP &kp C_PP &none &kp RCTRL + &trans &trans &trans &mo ADJ_L &trans &trans &trans &trans + >; + + sensor-bindings = <&inc_dec_kp PG_UP PG_DN &inc_dec_kp C_VOL_UP C_VOL_DN>; + }; + + adj_layer { +/* ADJUST + * ------------------------------------------------------------------------------------------------------------------------------------- + * | | QWERTY| DVORAK| COLEMK| | |-----------------------------------| | F11 | F12 |Prt Scr|EP_OFF | EP_ON | + * | RESET | BT 0 | BT 1 | BT 2 | BT 3 | BT 4 |-----------------------------------| | | | | | RESET | + * | | LGUI | LALT | LCTRL | LSHIFT| |BT CLR |-------------------| | | |OUT_USB|OUT_BLE| | BOOTL | + * | | | | |---| | | | | + */ + bindings = < +&none &to QWERTY_L &to DVORAK_L &to COLEMK_L &none &none &none &kp F11 &kp F12 &kp PRINTSCREEN &ext_power EP_OFF &ext_power EP_ON +&reset &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &none &none &none &none &none &reset +&none &kp LGUI &kp LALT &kp LCTRL &kp LSHIFT &none &bt BT_CLR &none &none &none &out OUT_USB &out OUT_BLE &none &bootloader + &trans &trans &trans &trans &trans &trans &trans &trans + >; + + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>; + }; + }; +}; \ No newline at end of file diff --git a/config/boards/shields/hillside46/hillside46.zmk.yml b/config/boards/shields/hillside46/hillside46.zmk.yml new file mode 100644 index 0000000..d79cc31 --- /dev/null +++ b/config/boards/shields/hillside46/hillside46.zmk.yml @@ -0,0 +1,13 @@ +file_format: "1" +id: hillside46 +name: Hillside46 +type: shield +url: https://github.com/mmccoyd/hillside/ +requires: [pro_micro] +features: + - keys +# - encoder +# - underglow +siblings: + - hillside46_left + - hillside46_right diff --git a/config/boards/shields/hillside46/hillside46_left.overlay b/config/boards/shields/hillside46/hillside46_left.overlay new file mode 100644 index 0000000..12c97a1 --- /dev/null +++ b/config/boards/shields/hillside46/hillside46_left.overlay @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2022 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include "hillside46.dtsi" + +&kscan0 { + col-gpios + = <&pro_micro 19 GPIO_ACTIVE_HIGH> // col0 in the schematic + , <&pro_micro 18 GPIO_ACTIVE_HIGH> // col1 in the schematic + , <&pro_micro 15 GPIO_ACTIVE_HIGH> // col2 in the schematic + , <&pro_micro 14 GPIO_ACTIVE_HIGH> // col3 in the schematic + , <&pro_micro 16 GPIO_ACTIVE_HIGH> // col4 in the schematic + , <&pro_micro 10 GPIO_ACTIVE_HIGH> // col5 in the schematic + ; +}; + +&left_encoder { + status = "okay"; +}; diff --git a/config/boards/shields/hillside46/hillside46_right.overlay b/config/boards/shields/hillside46/hillside46_right.overlay new file mode 100644 index 0000000..f08da88 --- /dev/null +++ b/config/boards/shields/hillside46/hillside46_right.overlay @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2021-2022 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include "hillside46.dtsi" + +&default_transform { + col-offset = <6>; +}; + +&kscan0 { + col-gpios + = <&pro_micro 10 GPIO_ACTIVE_HIGH> // col5 in the schematic + , <&pro_micro 16 GPIO_ACTIVE_HIGH> // col4 in the schematic + , <&pro_micro 14 GPIO_ACTIVE_HIGH> // col3 in the schematic + , <&pro_micro 15 GPIO_ACTIVE_HIGH> // col2 in the schematic + , <&pro_micro 18 GPIO_ACTIVE_HIGH> // col1 in the schematic + , <&pro_micro 19 GPIO_ACTIVE_HIGH> // col0 in the schematic + ; +}; + +&right_encoder { + status = "okay"; +}; diff --git a/config/hillside46.conf b/config/hillside46.conf new file mode 100644 index 0000000..162b85a --- /dev/null +++ b/config/hillside46.conf @@ -0,0 +1,14 @@ +# Copyright (c) 2021-2022 The ZMK Contributors +# SPDX-License-Identifier: MIT + +# Encoders (Uncomment these two line to add support to your firmware) +# CONFIG_EC11=y +# CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y + +# RGB Underglow (Uncomment these two lines to add support to your firmware) +# RGB quickly drains battery power +CONFIG_ZMK_RGB_UNDERGLOW=y +CONFIG_WS2812_STRIP=y + +# Boost the Bluetooth signal only if having connection issues +CONFIG_BT_CTLR_TX_PWR_PLUS_8=y diff --git a/config/hillside46.keymap b/config/hillside46.keymap new file mode 100644 index 0000000..647c9d4 --- /dev/null +++ b/config/hillside46.keymap @@ -0,0 +1,135 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +&mt { + quick-tap-ms = <150>; + tapping-term-ms = <150>; + flavor = "tap-preferred"; +}; + +< { + quick-tap-ms = <150>; + tapping-term-ms = <150>; + flavor = "tap-preferred"; +}; + +&mmv { + time-to-max-speed-ms = <150>; + acceleration-exponent = <10>; +}; + +&msc { + time-to-max-speed-ms = <150>; + acceleration-exponent = <7>; +}; + +/ { + macros { + lang_switch: lang_switch { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kt LGUI &kp ESC &kt LGUI &tog 1>; + label = "LANG_SWITCH"; + }; + }; + + behaviors { + caps_w_l: caps_word_lock { + compatible = "zmk,behavior-mod-morph"; + #binding-cells = <0>; + bindings = <&caps_word>, <&kp CAPSLOCK>; + mods = <(MOD_LSFT|MOD_RSFT)>; + }; + }; + + keymap { + compatible = "zmk,keymap"; + + colemak-dh { + bindings = < +&kp RBKT &kp Q &kp W &kp F &kp P &kp B &kp J &kp L &kp U &kp Y &kp SINGLE_QUOTE &kp LBKT +&kp GRAVE &mt LALT A &mt LGUI R &mt LCTRL S &mt LSHIFT T &kp G &kp M &mt LSHIFT N &mt LCTRL E &mt LGUI I &mt LALT O &kp SEMICOLON +&kp BSLH &kp Z &mt RALT X &kp C &kp D &kp V &lang_switch &lang_switch &kp K &kp H &kp COMMA &mt RALT DOT &kp FSLH &kp MINUS + < 4 ESC < 3 SPACE < 5 TAB &sk LG(LS(LA(LCTRL))) &none < 8 ENTER < 6 BACKSPACE &kp DEL + >; + }; + + qwerty_ukr { + bindings = < +&kp RBKT &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT +&kp GRAVE &mt LALT A &mt LGUI S &mt LCTRL D &mt LSHIFT F &kp G &kp H &mt LSHIFT J &mt LCTRL K &mt LGUI L &mt LALT SEMICOLON &kp APOS +&kp BSLH &kp Z &mt RALT X &kp C &kp V &kp B &lang_switch &lang_switch &kp N &kp M &kp COMMA &mt RALT DOT &kp FSLH &kp MINUS + &trans &trans &trans &trans &trans &trans &trans &trans + >; + }; + + geimu { + bindings = < +&kp GRAVE &kp Q &kp W &kp F &kp P &kp B &kp J &kp L &kp U &kp Y &kp SINGLE_QUOTE &kp LBKT +&kp LSHIFT &kp A &kp R &kp S &kp T &kp G &kp M &mt LSHIFT N &mt LCTRL E &mt LGUI I &mt LALT O &kp SEMICOLON +&kp LCTRL &kp Z &kp X &kp C &kp D &kp V &tog 2 &lang_switch &kp K &kp H &kp COMMA &mt RALT DOT &kp FSLH &kp MINUS + &kp ESC &kp SPACE &kp TAB &kp BACKSLASH &none < 8 ENTER < 6 BACKSPACE &kp DEL + >; + }; + + nav { + bindings = < +&none &none &none &none &none &none &none &kp HOME &kp PG_DN &kp PG_UP &kp END &none +&none &kp LALT &kp LGUI &kp LCTRL &kp LSHFT &none &caps_w_l &kp LEFT &kp DOWN &kp UP &kp RIGHT &none +&none &none &kp RALT &none &none &none &none &none &none &none &none &none &none &none + &none &trans &none &none &none &kp RET &kp BSPC &kp DEL + >; + }; + + media { + bindings = < +&none &none &none &none &none &none &rgb_ug RGB_TOG &rgb_ug RGB_EFF &rgb_ug RGB_HUI &rgb_ug RGB_SAI &rgb_ug RGB_EFF &bt BT_CLR +&none &kp LALT &kp LGUI &kp LCTRL &kp LSHFT &none &rgb_ug RGB_BRI &kp C_PREV &kp C_VOL_DN &kp C_VOL_UP &kp C_NEXT &none +&none &none &kp RALT &none &none &none &none &none &rgb_ug RGB_SPI &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &none + &trans &none &none &none &none &kp C_STOP &kp C_PP &kp C_MUTE + >; + }; + + mouse { + bindings = < +&none &none &none &none &none &none &none &mkp MB4 &none &none &mkp MB5 &none +&none &none &none &none &none &none &none &mmv MOVE_LEFT &mmv MOVE_DOWN &mmv MOVE_UP &mmv MOVE_RIGHT &none +&none &none &none &none &none &none &none &none &none &msc SCRL_LEFT &msc SCRL_DOWN &msc SCRL_UP &msc SCRL_RIGHT &none + &none &none &trans &none &none &mkp MB2 &mkp MB1 &mkp MB3 + >; + }; + + num { + bindings = < +&none &kp LBKT &kp N7 &kp N8 &kp N9 &kp RBKT &none &none &none &none &none &none +&none &kp SEMI &kp N4 &kp N5 &kp N6 &kp EQUAL &none &kp LSHFT &kp LCTRL &kp LGUI &kp LALT &none +&none &kp GRAVE &kp N1 &kp N2 &kp N3 &kp BSLH &none &none &none &none &none &kp RALT &none &none + &kp KP_DOT &kp N0 &kp MINUS &none &none &none &trans &none + >; + }; + + sym { + bindings = < +&none &none &none &none &none &none &none &none &none &none &none &none +&none &none &none &none &none &none &none &none &none &none &none &none +&none &none &kp EXCL &kp AT &none &none &none &none &none &none &none &none &none &none + &none &none &none &none &none &none &none &trans + >; + }; + + fun { + bindings = < +&none &kp F12 &kp F7 &kp F8 &kp F9 &kp PSCRN &none &none &none &none &none &none +&none &kp F11 &kp F4 &kp F5 &kp F6 &kp SCROLLLOCK &none &kp LSHFT &kp LCTRL &kp LGUI &kp LALT &none +&none &kp F10 &kp F1 &kp F2 &kp F3 &kp C_PAUSE &tog 2 &none &none &none &none &kp RALT &none &none + &kp ESC &kp SPACE &kp TAB &none &none &trans &none &none + >; + }; + }; +}; diff --git a/config/west.yml b/config/west.yml new file mode 100644 index 0000000..379d291 --- /dev/null +++ b/config/west.yml @@ -0,0 +1,11 @@ +manifest: + remotes: + - name: zmkfirmware + url-base: https://github.com/zmkfirmware + projects: + - name: zmk + remote: zmkfirmware + revision: main + import: app/west.yml + self: + path: config diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..86cc909 --- /dev/null +++ b/flake.lock @@ -0,0 +1,48 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1738009863, + "narHash": "sha256-KxmFlQ2j9PpDhKRXWu85bv3R2wmfkUqdpJhEwz9JN/E=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f898cbfddfab52593da301a397a17d0af801bbc3", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "zmk-nix": "zmk-nix" + } + }, + "zmk-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1737851654, + "narHash": "sha256-gjwXV87R/AQJi6MIFNcmB4RrWWzGCE/jXRkf1i0iZyM=", + "owner": "lilyinstarlight", + "repo": "zmk-nix", + "rev": "57a72f1e222e7f09ef29bbb06c5e629695c2285b", + "type": "github" + }, + "original": { + "owner": "lilyinstarlight", + "repo": "zmk-nix", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..6d3ae13 --- /dev/null +++ b/flake.nix @@ -0,0 +1,49 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + + zmk-nix = { + url = "github:lilyinstarlight/zmk-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { + self, + nixpkgs, + zmk-nix, + }: let + forAllSystems = nixpkgs.lib.genAttrs (nixpkgs.lib.attrNames zmk-nix.packages); + in { + packages = forAllSystems (system: rec { + default = firmware; + + firmware = zmk-nix.legacyPackages.${system}.buildSplitKeyboard { + name = "firmware"; + + src = nixpkgs.lib.sourceFilesBySuffices self [".board" ".cmake" ".conf" ".defconfig" ".dts" ".dtsi" ".json" ".keymap" ".overlay" ".shield" ".yml" "_defconfig"]; + + board = "nice_nano_v2"; + shield = "hillside46_%PART%"; + extraCmakeFlags = [ + "-DCONFIG_ZMK_POINTING=y" + ]; + + zephyrDepsHash = "sha256-yRzN+df/kzHEOWTiQLRLsPNRBDM4fV5qmLa6SevYKxc="; + + meta = { + description = "ZMK firmware"; + license = nixpkgs.lib.licenses.mit; + platforms = nixpkgs.lib.platforms.all; + }; + }; + + flash = zmk-nix.packages.${system}.flash.override {inherit firmware;}; + update = zmk-nix.packages.${system}.update; + }); + + devShells = forAllSystems (system: { + default = zmk-nix.devShells.${system}.default; + }); + }; +}