diff --git a/build.yaml b/build.yaml index 228498f..3503c6f 100644 --- a/build.yaml +++ b/build.yaml @@ -17,3 +17,7 @@ include: shield: corne_left nice_view_adapter nice_view - board: nice_nano_v2 shield: corne_right nice_view_adapter nice_view + - board: nice_nano_v2 + shield: urchin_left nice_view_adapter nice_view + - board: nice_nano_v2 + shield: urchin_right nice_view_adapter nice_view diff --git a/config/boards/shields/urchin/Kconfig.defconfig b/config/boards/shields/urchin/Kconfig.defconfig new file mode 100644 index 0000000..c07f57a --- /dev/null +++ b/config/boards/shields/urchin/Kconfig.defconfig @@ -0,0 +1,17 @@ +# Copyright (c) 2022 Duccio Breschi +# SPDX-License-Identifier: MIT + +if SHIELD_URCHIN_LEFT + +config ZMK_KEYBOARD_NAME + default "urchin" + +config ZMK_SPLIT_ROLE_CENTRAL + default y + +endif + +if SHIELD_URCHIN_LEFT || SHIELD_URCHIN_RIGHT +config ZMK_SPLIT + default y +endif diff --git a/config/boards/shields/urchin/Kconfig.shield b/config/boards/shields/urchin/Kconfig.shield new file mode 100644 index 0000000..fe0a07c --- /dev/null +++ b/config/boards/shields/urchin/Kconfig.shield @@ -0,0 +1,8 @@ +# Copyright (c) 2022 Duccio Breschi +# SPDX-License-Identifier: MIT + +config SHIELD_URCHIN_LEFT + def_bool $(shields_list_contains,urchin_left) + +config SHIELD_URCHIN_RIGHT + def_bool $(shields_list_contains,urchin_right) diff --git a/config/boards/shields/urchin/urchin.dtsi b/config/boards/shields/urchin/urchin.dtsi new file mode 100644 index 0000000..163945e --- /dev/null +++ b/config/boards/shields/urchin/urchin.dtsi @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2022 Duccio Breschi + * + * SPDX-License-Identifier: MIT + */ + +#include + + +/ { + chosen { + zmk,kscan = &kscan0; + zmk,matrix_transform = &default_transform; + }; + + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <10>; + rows = <4>; + + 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(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(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(3,3) RC(3,4) RC(3,5) RC(3,6) + >; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN0"; + }; +}; diff --git a/config/boards/shields/urchin/urchin.keymap b/config/boards/shields/urchin/urchin.keymap new file mode 100644 index 0000000..58103ec --- /dev/null +++ b/config/boards/shields/urchin/urchin.keymap @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2020 Duccio Breschi + * + * SPDX-License-Identifier: MIT + */ + +#include "../../../urchin.keymap" diff --git a/config/boards/shields/urchin/urchin.zmk.yml b/config/boards/shields/urchin/urchin.zmk.yml new file mode 100644 index 0000000..a1cc092 --- /dev/null +++ b/config/boards/shields/urchin/urchin.zmk.yml @@ -0,0 +1,11 @@ +file_format: "1" +id: urchin +name: urchin +type: shield +url: https://github.com/duckyb/urchin +requires: [pro_micro] +features: + - keys +siblings: + - urchin_left + - urchin_right diff --git a/config/boards/shields/urchin/urchin_left.overlay b/config/boards/shields/urchin/urchin_left.overlay new file mode 100644 index 0000000..43906e9 --- /dev/null +++ b/config/boards/shields/urchin/urchin_left.overlay @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2022 Duccio Breschi + * + * SPDX-License-Identifier: MIT + */ + +#include "urchin.dtsi" + +&kscan0 { + diode-direction = "col2row"; + col-gpios + = <&pro_micro 18 (GPIO_ACTIVE_HIGH)> // COL0 + , <&pro_micro 15 (GPIO_ACTIVE_HIGH)> // COL1 + , <&pro_micro 14 (GPIO_ACTIVE_HIGH)> // COL2 + , <&pro_micro 16 (GPIO_ACTIVE_HIGH)> // COL3 + , <&pro_micro 10 (GPIO_ACTIVE_HIGH)> // COL4 + ; + row-gpios + = <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // ROW0 + , <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // ROW1 + , <&pro_micro 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // ROW2 + , <&pro_micro 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // ROW3 + ; +}; diff --git a/config/boards/shields/urchin/urchin_right.overlay b/config/boards/shields/urchin/urchin_right.overlay new file mode 100644 index 0000000..1105446 --- /dev/null +++ b/config/boards/shields/urchin/urchin_right.overlay @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2022 Duccio Breschi + * + * SPDX-License-Identifier: MIT + */ + +#include "urchin.dtsi" + +&default_transform { + col-offset = <5>; +}; + +&kscan0 { + diode-direction = "col2row"; + col-gpios + = <&pro_micro 5 (GPIO_ACTIVE_HIGH)> // COL0 + , <&pro_micro 6 (GPIO_ACTIVE_HIGH)> // COL1 + , <&pro_micro 7 (GPIO_ACTIVE_HIGH)> // COL2 + , <&pro_micro 8 (GPIO_ACTIVE_HIGH)> // COL3 + , <&pro_micro 9 (GPIO_ACTIVE_HIGH)> // COL4 + ; + row-gpios + = <&pro_micro 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // ROW0 + , <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // ROW1 + , <&pro_micro 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // ROW2 + , <&pro_micro 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // ROW3 + ; +}; diff --git a/config/urchin.conf b/config/urchin.conf new file mode 100644 index 0000000..3806092 --- /dev/null +++ b/config/urchin.conf @@ -0,0 +1,25 @@ +# increase bluetooth signal power +CONFIG_BT_CTLR_TX_PWR_PLUS_8=y + +# enable deep sleep support +CONFIG_ZMK_SLEEP=y + +# the keyboard disconnects from bluetooth. +# uses very little power, but it may take +# a few seconds to reconnect after waking. +# 1.800.000 ms = 30 minutes +CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=1800000 + +# "Eager Debouncing" +# Trying to lower the input lag. +# CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS=1 +# CONFIG_ZMK_KSCAN_DEBOUNCE_RELEASE_MS=5 + +# --- DISPLAY SETTINGS --- + +# disable the WPM widget +CONFIG_ZMK_WIDGET_WPM_STATUS=n + +# display battery as n% +CONFIG_ZMK_WIDGET_BATTERY_STATUS_SHOW_PERCENTAGE=y + diff --git a/config/urchin.keymap b/config/urchin.keymap new file mode 100644 index 0000000..6533f27 --- /dev/null +++ b/config/urchin.keymap @@ -0,0 +1,92 @@ +#include +#include +#include +#include +#include + +#include "constants.h" +#define HOST_OS LINUX // Needed for unicode international_chars + +#include "../zmk-nodefree-config/helper.h" +#include "../zmk-nodefree-config/international_chars/french.dtsi" +#include "../zmk-nodefree-config/symbols/math.dtsi" +#include "../zmk-nodefree-config/symbols/typography.dtsi" + +#include "../layouts/canadian-multilingual-standard.dtsi" +#include "../behaviors/combos.dtsi" +#include "../behaviors/hold-tap.dtsi" +#include "../behaviors/macros.dtsi" +#include "../behaviors/mod-morph.dtsi" +#include "../behaviors/mouse.dtsi" + +ZMK_LAYER_5COL(qwerty, +// ╭───────────┬───────────┬───────────┬────────────┬────────────╮ ╭───────────┬─────────────┬─────────────┬────────────┬────────────╮ + &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P +// ├───────────┼───────────┼───────────┼────────────┼────────────┤ ├───────────┼─────────────┼─────────────┼────────────┼────────────┤ + &hml GL A &hml AL S &hml CL D &hml SL F &kp G &kp H &hmr SL J &hmr CL K &hmr AL L &hmr GL SEMI +// ├───────────┼───────────┼───────────┼────────────┼────────────┤ ├───────────┼─────────────┼─────────────┼────────────┼────────────┤ + &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &to ACC +// ╰───────────┴───────────┴───────────┼────────────┼────────────┤ ├───────────┼─────────────┼─────────────┴────────────┴────────────╯ + < NAV RET &num_esc_clk &bspc_del < SYM SPACE +// ╰───────────┴─────────────╯ ╰───────────┴─────────────╯ +) + +ZMK_LAYER_5COL(accent, +// ╭───────────┬───────────┬───────────┬────────────┬────────────╮ ╭───────────┬─────────────┬─────────────┬────────────┬────────────╮ + XXX XXX &TREM E XXX XXX XXX &TREM I &TREM O &TREM U &KPD ACC_TR +// ├───────────┼───────────┼───────────┼────────────┼────────────┤ ├───────────┼─────────────┼─────────────┼────────────┼────────────┤ + &A_GR &CIRC E &E_CU &hrme SL 0 XXX XXX &hrmi SL 0 &O_CI &U_CI &KPD ACC_GR +// ├───────────┼───────────┼───────────┼────────────┼────────────┤ ├───────────┼─────────────┼─────────────┼────────────┼────────────┤ + &A_CI XXX &CEDIL XXX XXX XXX XXX XXX &U_GR &KPD ACC_CI +// ╰───────────┴───────────┴───────────┼────────────┼────────────┤ ├───────────┼─────────────┼─────────────┴────────────┴────────────╯ + ___ ___ ___ ___ +// ╰────────────┴────────────╯ ╰───────────┴─────────────╯ +) + +ZMK_LAYER_5COL(symbol, +// ╭───────────┬───────────┬───────────┬────────────┬────────────╮ ╭───────────┬─────────────┬─────────────┬────────────┬────────────╮ + &kp HASH &kp AT &kp LBRAC &kp RBRAC &kp PLUS XXX &kp TILDS &GRA &kp DLLR XXX +// ├───────────┼───────────┼───────────┼────────────┼────────────┤ ├───────────┼─────────────┼─────────────┼────────────┼────────────┤ + &kp SLSH &dash_tilde &kp LPAR &hml SL RPAR &kp EQUAL &CAR &kp QUEST &kp EXCL &kp AMPS &kp PIP +// ├───────────┼───────────┼───────────┼────────────┼────────────┤ ├───────────┼─────────────┼─────────────┼────────────┼────────────┤ + &kp STAR &kp PRCNT &kp LBKET &kp RBKET &kp UNDER XXX &kp LETHAN &kp GRTHAN « » +// ╰───────────┴───────────┴───────────┼────────────┼────────────┤ ├───────────┼─────────────┼─────────────┴────────────┴────────────╯ + ___ ___ ___ ___ +// ╰────────────┴────────────╯ ╰───────────┴─────────────╯ +) + +ZMK_LAYER_5COL(nav, +// ╭───────────┬───────────┬───────────┬────────────┬────────────╮ ╭───────────┬─────────────┬─────────────┬────────────┬────────────╮ + &out OUT_TOG ___ ___ ___ &bt BT_CLR ___ ___ ___ ___ ___ +// ├───────────┼───────────┼───────────┼────────────┼────────────┤ ├───────────┼─────────────┼─────────────┼────────────┼────────────┤ + &sk LGUI &kp C_PREV &kp C_PP &kp C_NEXT XXX &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp INS +// ├───────────┼───────────┼───────────┼────────────┼────────────┤ ├───────────┼─────────────┼─────────────┼────────────┼────────────┤ + &bt BT_PRV &bt BT_NXT &kp C_VOL_DN &kp C_VOL_UP XXX &kp HOME &kp PG_DN &kp PG_UP &kp END &kp SLCK +// ╰───────────┴───────────┴───────────┼────────────┼────────────┤ ├───────────┼─────────────┼─────────────┴────────────┴────────────╯ + ___ ___ ___ ___ +// ╰────────────┴────────────╯ ╰───────────┴─────────────╯ +) + +ZMK_LAYER_5COL(nums, +// ╭───────────┬───────────┬───────────┬────────────┬────────────╮ ╭───────────┬─────────────┬─────────────┬────────────┬────────────╮ + &kp F1 &kp F2 &kp F3 &kp F4 &math_pm &math_1_4 &kp N7 &kp N8 &kp N9 &multi_div +// ├───────────┼───────────┼───────────┼────────────┼────────────┤ ├───────────┼─────────────┼─────────────┼────────────┼────────────┤ + &kp F5 &kp F6 &kp F7 &hml SL F8 &kp DEG &math_1_2 &kp N4 &kp N5 &kp N6 &plus_minus +// ├───────────┼───────────┼───────────┼────────────┼────────────┤ ├───────────┼─────────────┼─────────────┼────────────┼────────────┤ + &kp F9 &kp F10 &kp F11 &kp F12 &math_micro &math_3_4 &kp N1 &kp N2 &kp N3 &comma_dot +// ╰───────────┴───────────┴───────────┼────────────┼────────────┤ ├───────────┼─────────────┼─────────────┴────────────┴────────────╯ + ___ ___ &kp N0 &kp DOT +// ╰────────────┴────────────╯ ╰───────────┴─────────────╯ +) + +ZMK_LAYER_5COL(mouse, +// ╭───────────┬───────────┬───────────┬────────────┬────────────╮ ╭───────────┬─────────────┬─────────────┬────────────┬────────────╮ + ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ +// ├───────────┼───────────┼───────────┼────────────┼────────────┤ ├───────────┼─────────────┼─────────────┼────────────┼────────────┤ + ___ &mwh_lf &mwh_up &mwh_dn &mwh_rg &mmv_lf &mmv_dn &mmv_up &mmv_rg ___ +// ├───────────┼───────────┼───────────┼────────────┼────────────┤ ├───────────┼─────────────┼─────────────┼────────────┼────────────┤ + ___ ___ ___ &mwh_tg ___ ___ ___ ___ ___ ___ +// ╰───────────┴───────────┴───────────┼────────────┼────────────┤ ├───────────┼─────────────┼─────────────┴────────────┴────────────╯ + &mkp_rg &mkp_lf ___ ___ +// ╰────────────┴────────────╯ ╰───────────┴─────────────╯ +)