diff options
32 files changed, 279 insertions, 276 deletions
@@ -16,51 +16,32 @@ build() { if [ "$3" ]; then MODULE_CMD="-DZMK_EXTRA_MODULES=$HOME/git/zmk_build/$3" fi - west build -p always -b $2 -- -DSHIELD=$1 \ + west build -p -b $2 -- -DSHIELD=$1 \ -DZMK_CONFIG=$HOME/git/zmk_build/config $MODULE_CMD - - read -p "${BOLD}flash? (y/n) ${NORMAL}" yn - case $yn in - [Yy]*) - printf "${YELLOW}enter bootloader${NORMAL}...\n" - sleep 5 - udisksctl mount -b /dev/sdb - west flash - ;; - [Nn]*) cp build/zephyr/zmk.uf2 ~/$1.uf2 ;; - * ) printf "${RED}invalid entry${NORMAL}\n" ;; - esac + cp build/zephyr/zmk.uf2 ~/$1.uf2 ) printf "${GREEN}complete${NORMAL}\n" } printf "${BOLD}firmware to build${NORMAL}...\n" -printf "(1) corne\t(2) corne-ish zen\t(3) revxlp\t(4) sweep\t(5) settings reset:\t" +printf "(1) flake\t(2) revxlp\t(3) settings reset:\t" read opt; case $opt in 1) - build corne_left nice_nano - build corne_right nice_nano_v2 + build flake_dongle nice_nano_v2 "flake_dongle" + build flake_left nice_nano_v2 "flake" + build flake_right nice_nano_v2 "flake" ;; 2) - build corneish_zen_v1_left - build corneish_zen_v1_right - ;; - 3) build revxlp seeeduino_xiao_ble "revxlp" ;; - 4) - build splitkb_aurora_sweep_left nice_nano_v2 - build splitkb_aurora_sweep_right nice_nano_v2 - ;; - 5) + 3) printf "${BOLD}select microcontroller${NORMAL}...\n" - printf "(1) nice nano\t(2) nice nano v2\t(3) xiao ble:\t" + printf "(1) nice nano v2\t(2) xiao ble:\t" read val; case $val in - 1) MCU="nice_nano" ;; - 2) MCU="nice_nano_v2" ;; - 3) MCU="seeeduino_xiao_ble" ;; + 1) MCU="nice_nano_v2" ;; + 2) MCU="seeeduino_xiao_ble" ;; *) printf "${RED}invalid entry${NORMAL}\n" ;; esac build settings_reset $MCU @@ -1,16 +1 @@ --- -include: - - board: nice_nano - shield: corne_left - - board: nice_nano_v2 - shield: corne_right - - board: nice_nano_v2 - shield: splitkb_aurora_sweep_left - - board: corneish_zen_v1_left - - board: corneish_zen_v1_right - - board: nice_nano_v2 - shield: splitkb_aurora_sweep_right - - board: nice_nano - shield: settings_reset - - board: nice_nano_v2 - shield: settings_reset diff --git a/config/corne.conf b/config/corne.conf deleted file mode 100644 index d85021a..0000000 --- a/config/corne.conf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_ZMK_SLEEP=y -CONFIG_ZMK_USB_LOGGING=n diff --git a/config/corne.keymap b/config/corne.keymap deleted file mode 100644 index 0dad854..0000000 --- a/config/corne.keymap +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2024 [email protected] -// SPDX-License-Identifier: MIT - -#include <behaviors.dtsi> -#include <dt-bindings/zmk/keys.h> -#include <dt-bindings/zmk/bt.h> -#include "util.h" - -/ { - keymap { - compatible = "zmk,keymap"; - 0 { - bindings = < - &none &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &none - &none HRML(A, S, D, F) &kp G &kp H HRMR(J, K, L, SEMI) &none - &none &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &trans - &updir < 1 ESC &kp SPACE &kp BSPC < 2 RS(RC(V)) &pnp - >; - }; - 1 { - bindings = < - &trans &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &trans - &trans HRML(EXCL, AT, HASH, DLLR) &kp PRCNT &kp CARET HRMR(AMPS, ASTRK, LPAR, RPAR) &trans - &trans &kp C_VOL_DN &kp TAB &kp CAPS &kp TILDE &kp GRAVE &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp C_VOL_UP &trans - &none &trans &none &none &none &none - >; - }; - 2 { - bindings = < - &trans &bootloader &bt BT_NXT &none &none &none &none &none &none &none &none &trans - &trans &bt BT_CLR &bt BT_PRV &none &none &none &none &none &none &none &none &trans - &trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &trans - &none &none &none &none &trans &none - >; - }; - }; - - combos { - compatible = "zmk,combos"; - // name output pos. - COMBO(we_eqal, &kp EQUAL, 2 3) - COMBO(er_cbkt, &td_cbrkt, 3 4) - COMBO(rt_bsls, &kp BSLH, 4 5) - COMBO(yu_quot, &kp QUOT, 6 7) - COMBO(ui_brkt, &td_brkt, 7 8) - COMBO(io_mins, &td_min_dash, 8 9) - COMBO(sd_plus, &kp PLUS, 14 15) - COMBO(df_coln, &kp COLON, 15 16) - COMBO(fg_pipe, &kp PIPE, 16 17) - COMBO(hj_dquo, &kp DQT, 17 18) - COMBO(jk_entr, &kp ENTER, 18 19) - COMBO(kl_unds, &kp UNDER, 19 20) - COMBO(fj_capw, &caps_word, 16 19) - }; -}; diff --git a/config/corneish_zen_v1.conf b/config/corneish_zen_v1.conf deleted file mode 100644 index d85021a..0000000 --- a/config/corneish_zen_v1.conf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_ZMK_SLEEP=y -CONFIG_ZMK_USB_LOGGING=n diff --git a/config/corneish_zen_v1.keymap b/config/corneish_zen_v1.keymap deleted file mode 100644 index 0dad854..0000000 --- a/config/corneish_zen_v1.keymap +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2024 [email protected] -// SPDX-License-Identifier: MIT - -#include <behaviors.dtsi> -#include <dt-bindings/zmk/keys.h> -#include <dt-bindings/zmk/bt.h> -#include "util.h" - -/ { - keymap { - compatible = "zmk,keymap"; - 0 { - bindings = < - &none &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &none - &none HRML(A, S, D, F) &kp G &kp H HRMR(J, K, L, SEMI) &none - &none &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &trans - &updir < 1 ESC &kp SPACE &kp BSPC < 2 RS(RC(V)) &pnp - >; - }; - 1 { - bindings = < - &trans &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &trans - &trans HRML(EXCL, AT, HASH, DLLR) &kp PRCNT &kp CARET HRMR(AMPS, ASTRK, LPAR, RPAR) &trans - &trans &kp C_VOL_DN &kp TAB &kp CAPS &kp TILDE &kp GRAVE &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp C_VOL_UP &trans - &none &trans &none &none &none &none - >; - }; - 2 { - bindings = < - &trans &bootloader &bt BT_NXT &none &none &none &none &none &none &none &none &trans - &trans &bt BT_CLR &bt BT_PRV &none &none &none &none &none &none &none &none &trans - &trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &trans - &none &none &none &none &trans &none - >; - }; - }; - - combos { - compatible = "zmk,combos"; - // name output pos. - COMBO(we_eqal, &kp EQUAL, 2 3) - COMBO(er_cbkt, &td_cbrkt, 3 4) - COMBO(rt_bsls, &kp BSLH, 4 5) - COMBO(yu_quot, &kp QUOT, 6 7) - COMBO(ui_brkt, &td_brkt, 7 8) - COMBO(io_mins, &td_min_dash, 8 9) - COMBO(sd_plus, &kp PLUS, 14 15) - COMBO(df_coln, &kp COLON, 15 16) - COMBO(fg_pipe, &kp PIPE, 16 17) - COMBO(hj_dquo, &kp DQT, 17 18) - COMBO(jk_entr, &kp ENTER, 18 19) - COMBO(kl_unds, &kp UNDER, 19 20) - COMBO(fj_capw, &caps_word, 16 19) - }; -}; diff --git a/config/splitkb_aurora_sweep.keymap b/config/flake.keymap index 95c1357..594e1c5 100644 --- a/config/splitkb_aurora_sweep.keymap +++ b/config/flake.keymap @@ -1,6 +1,5 @@ -// Copyright 2024 [email protected] +// Copyright 2025 [email protected] // SPDX-License-Identifier: MIT - #include <behaviors.dtsi> #include <dt-bindings/zmk/keys.h> #include <dt-bindings/zmk/bt.h> @@ -11,10 +10,10 @@ compatible = "zmk,keymap"; 0 { bindings = < - &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P - HRML(A, S, D, F) &kp G &kp H HRMR(J, K, L, SEMI) - &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH - < 1 ESC &kp SPACE &kp BSPC < 2 RS(RC(V)) + &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P + HRML(A, S, D, F) &kp G &kp H HRMR(J, K, L, SEMI) + &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH + &none &none &updir < 1 ESC &kp SPACE &kp BSPC < 2 RS(RC(V)) &pnp &none &none >; }; 1 { @@ -22,7 +21,8 @@ &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 HRML(EXCL, AT, HASH, DLLR) &kp PRCNT &kp CARET HRMR(AMPS, ASTRK, LPAR, RPAR) &kp C_VOL_DN &kp TAB &kp CAPS &kp TILDE &kp GRAVE &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp C_VOL_UP - &trans &trans &trans &pnp + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + >; }; 2 { @@ -30,7 +30,7 @@ &bootloader &bt BT_NXT &none &none &none &none &none &none &none &none &bt BT_CLR &bt BT_PRV &none &none &none &none &none &none &none &none &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 - &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans >; }; }; @@ -50,7 +50,7 @@ COMBO(hj_dquo, &kp DQT, 15 16) COMBO(jk_entr, &kp ENTER, 16 17) COMBO(kl_unds, &kp UNDER, 17 18) - COMBO(fj_capw, &caps_word, 15 18) + COMBO(fj_capw, &caps_word, 13 16) }; }; diff --git a/config/revxlp.conf b/config/revxlp.conf deleted file mode 100644 index d85021a..0000000 --- a/config/revxlp.conf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_ZMK_SLEEP=y -CONFIG_ZMK_USB_LOGGING=n diff --git a/config/revxlp.keymap b/config/revxlp.keymap index 0dad854..7b27e3d 100644 --- a/config/revxlp.keymap +++ b/config/revxlp.keymap @@ -1,6 +1,5 @@ -// Copyright 2024 [email protected] +// Copyright 2025 [email protected] // SPDX-License-Identifier: MIT - #include <behaviors.dtsi> #include <dt-bindings/zmk/keys.h> #include <dt-bindings/zmk/bt.h> @@ -47,9 +46,9 @@ COMBO(sd_plus, &kp PLUS, 14 15) COMBO(df_coln, &kp COLON, 15 16) COMBO(fg_pipe, &kp PIPE, 16 17) - COMBO(hj_dquo, &kp DQT, 17 18) - COMBO(jk_entr, &kp ENTER, 18 19) - COMBO(kl_unds, &kp UNDER, 19 20) + COMBO(hj_dquo, &kp DQT, 18 19) + COMBO(jk_entr, &kp ENTER, 19 20) + COMBO(kl_unds, &kp UNDER, 20 21) COMBO(fj_capw, &caps_word, 16 19) }; }; diff --git a/config/splitkb_aurora_sweep.conf b/config/splitkb_aurora_sweep.conf deleted file mode 100644 index d85021a..0000000 --- a/config/splitkb_aurora_sweep.conf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_ZMK_SLEEP=y -CONFIG_ZMK_USB_LOGGING=n diff --git a/config/util.h b/config/util.h index a658ea1..f515d75 100644 --- a/config/util.h +++ b/config/util.h @@ -1,4 +1,4 @@ -// Copyright 2024 [email protected] +// Copyright 2025 [email protected] // SPDX-License-Identifier: MIT // clang-format off @@ -9,13 +9,12 @@ combo_##name { \ key-positions = <keypos>; \ }; -#define TAP_DANCE(name, keypress1, keypress2) \ -td_##name: name { \ - compatible = "zmk,behavior-tap-dance"; \ - label = ###name; \ - #binding-cells = <0>; \ - tapping-term-ms = <200>; \ - bindings = <keypress1>, <keypress2>; \ +#define TAP_DANCE(name, kp1, kp2, kp3) \ +td_##name: name { \ + compatible = "zmk,behavior-tap-dance"; \ + #binding-cells = <0>; \ + tapping-term-ms = <200>; \ + bindings = <kp1>, <kp2>, <kp3>; \ }; #define HRML(k1,k2,k3,k4) &hm LALT k1 &hm LGUI k2 &hm LCTRL k3 &hm LSHFT k4 @@ -29,7 +28,6 @@ td_##name: name { \ behaviors { hm: homerow_mods { compatible = "zmk,behavior-hold-tap"; - label = "HOMEROW_MODS"; #binding-cells = <2>; tapping-term-ms = <130>; quick-tap-ms = <160>; @@ -39,30 +37,33 @@ td_##name: name { \ pnp: play_next_prev { compatible = "zmk,behavior-tap-dance"; - label = "PLAY_NEXT_PREV"; #binding-cells = <0>; tapping-term-ms = <210>; bindings = <&kp C_PLAY>, <&kp C_NEXT>, <&kp C_PREV>; }; - TAP_DANCE(cbrkt, &kp LBRC, &kp RBRC) - TAP_DANCE(brkt, &kp LBKT, &kp RBKT) - TAP_DANCE(min_dash, &kp MINUS, &emdash) + TAP_DANCE(cbrkt, &kp LBRC, &kp RBRC, &none) + TAP_DANCE(brkt, &kp LBKT, &kp RBKT, &none) + TAP_DANCE(min_dash, &kp MINUS, &dbl_min, &emdash) }; macros { updir: updir { - label = "UP_DIR"; compatible = "zmk,behavior-macro"; #binding-cells = <0>; bindings = <¯o_tap &kp DOT &kp DOT &kp FSLH>; }; + dbl_min: dbl_min { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <¯o_tap &kp MINUS &kp MINUS>; + }; emdash: emdash { - label = "EM_DASH"; compatible = "zmk,behavior-macro"; #binding-cells = <0>; bindings = <¯o_press &kp LSHFT &kp LCTRL>, <¯o_tap &kp U &kp N2 &kp N0 &kp N1 &kp N4>, - <¯o_release &kp LSHFT &kp LCTRL>; + <¯o_release &kp LSHFT &kp LCTRL>, + <¯o_tap &kp SPACE &kp SPACE>; }; }; }; diff --git a/flake/boards/shields/flake/Kconfig.defconfig b/flake/boards/shields/flake/Kconfig.defconfig new file mode 100644 index 0000000..eb45294 --- /dev/null +++ b/flake/boards/shields/flake/Kconfig.defconfig @@ -0,0 +1,8 @@ +if SHIELD_FLAKE_LEFT || SHIELD_FLAKE_RIGHT + config ZMK_SLEEP + default y + config ZMK_SPLIT + default y + config ZMK_SPLIT_ROLE_CENTRAL + default n +endif diff --git a/flake/boards/shields/flake/Kconfig.shield b/flake/boards/shields/flake/Kconfig.shield new file mode 100644 index 0000000..d25f3e8 --- /dev/null +++ b/flake/boards/shields/flake/Kconfig.shield @@ -0,0 +1,5 @@ +config SHIELD_FLAKE_LEFT + def_bool $(shields_list_contains,flake_left) + +config SHIELD_FLAKE_RIGHT + def_bool $(shields_list_contains,flake_right) diff --git a/flake/boards/shields/flake/flake.dtsi b/flake/boards/shields/flake/flake.dtsi new file mode 100644 index 0000000..651e976 --- /dev/null +++ b/flake/boards/shields/flake/flake.dtsi @@ -0,0 +1,33 @@ +#include <dt-bindings/zmk/matrix_transform.h> + +/ { + kscan0: kscan0 { + compatible = "zmk,kscan-gpio-matrix"; + diode-direction = "col2row"; + wakeup-source; + }; + + chosen { + zmk,kscan = &kscan0; + zmk,physical-layout = &physical_layout0; + }; + + physical_layout0: physical_layout_0 { + compatible = "zmk,physical-layout"; + display-name = "Default Layout"; + kscan = <&kscan0>; + transform = <&default_transform>; + }; + + default_transform: keymap_transform0 { + 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,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) RC(3,9) + >; + }; +}; diff --git a/flake/boards/shields/flake/flake.zmk.yml b/flake/boards/shields/flake/flake.zmk.yml new file mode 100644 index 0000000..53f1c63 --- /dev/null +++ b/flake/boards/shields/flake/flake.zmk.yml @@ -0,0 +1,11 @@ +file_format: "1" +id: flake +name: flake +type: shield +url: https://github.com/anywhy-io/flake +requires: [pro_micro] +features: + - keys +siblings: + - flake_left + - flake_right diff --git a/flake/boards/shields/flake/flake_left.overlay b/flake/boards/shields/flake/flake_left.overlay new file mode 100644 index 0000000..dad7240 --- /dev/null +++ b/flake/boards/shields/flake/flake_left.overlay @@ -0,0 +1,18 @@ +#include "flake.dtsi" + +&kscan0 { + col-gpios + = <&pro_micro 3 GPIO_ACTIVE_HIGH> + , <&pro_micro 4 GPIO_ACTIVE_HIGH> + , <&pro_micro 5 GPIO_ACTIVE_HIGH> + , <&pro_micro 6 GPIO_ACTIVE_HIGH> + , <&pro_micro 7 GPIO_ACTIVE_HIGH> + ; + + row-gpios + = <&pro_micro 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; +}; diff --git a/flake/boards/shields/flake/flake_right.overlay b/flake/boards/shields/flake/flake_right.overlay new file mode 100644 index 0000000..b5fd4f4 --- /dev/null +++ b/flake/boards/shields/flake/flake_right.overlay @@ -0,0 +1,22 @@ +#include "flake.dtsi" + +&default_transform { + col-offset = <5>; +}; + +&kscan0 { + 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> + ; + + row-gpios + = <&pro_micro 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; +}; diff --git a/flake/config/west.yml b/flake/config/west.yml new file mode 100644 index 0000000..379d291 --- /dev/null +++ b/flake/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/zephyr/module.yml b/flake/zephyr/module.yml new file mode 100644 index 0000000..f49c952 --- /dev/null +++ b/flake/zephyr/module.yml @@ -0,0 +1,4 @@ +name: flake +build: + settings: + board_root: . diff --git a/flake_dongle/boards/shields/flake_dongle/Kconfig.defconfig b/flake_dongle/boards/shields/flake_dongle/Kconfig.defconfig new file mode 100644 index 0000000..13a0644 --- /dev/null +++ b/flake_dongle/boards/shields/flake_dongle/Kconfig.defconfig @@ -0,0 +1,10 @@ +if SHIELD_FLAKE_DONGLE + config ZMK_KEYBOARD_NAME + default "Flake Dongle" + config ZMK_SPLIT_ROLE_CENTRAL + default y + config ZMK_SPLIT + default y + config ZMK_SPLIT_BLE_CENTRAL_PERIPHERALS + default 2 +endif diff --git a/flake_dongle/boards/shields/flake_dongle/Kconfig.shield b/flake_dongle/boards/shields/flake_dongle/Kconfig.shield new file mode 100644 index 0000000..f6a5a2d --- /dev/null +++ b/flake_dongle/boards/shields/flake_dongle/Kconfig.shield @@ -0,0 +1,2 @@ +config SHIELD_FLAKE_DONGLE + def_bool $(shields_list_contains,flake_dongle) diff --git a/flake_dongle/boards/shields/flake_dongle/flake_dongle.overlay b/flake_dongle/boards/shields/flake_dongle/flake_dongle.overlay new file mode 100644 index 0000000..34441c6 --- /dev/null +++ b/flake_dongle/boards/shields/flake_dongle/flake_dongle.overlay @@ -0,0 +1,33 @@ +#include <dt-bindings/zmk/matrix_transform.h> + +/ { + chosen { + zmk,kscan = &mock_kscan; + zmk,physical-layout = &physical_layout0; + }; + + mock_kscan: mock_kscan_0 { + compatible= "zmk,kscan-mock"; + columns = <0>; + rows = <0>; + events = <0>; + }; + + default_transform: keymap_transform0 { + 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,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) RC(3,9) + >; + }; + + physical_layout0: physical_layout_0 { + compatible = "zmk,physical-layout"; + display-name = "Default Layout"; + transform = <&default_transform>; + }; +}; diff --git a/flake_dongle/config/west.yml b/flake_dongle/config/west.yml new file mode 100644 index 0000000..379d291 --- /dev/null +++ b/flake_dongle/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_dongle/zephyr/module.yml b/flake_dongle/zephyr/module.yml new file mode 100644 index 0000000..f49c952 --- /dev/null +++ b/flake_dongle/zephyr/module.yml @@ -0,0 +1,4 @@ +name: flake +build: + settings: + board_root: . @@ -4,6 +4,6 @@ my [zmk](https://zmk.dev) configuration & keyboard code  ### misc -* [`util.h`](util.h) contains some simple c macros for combos, 2-key tap dance, & home-row mods. +* [`util.h`](config/util.h) contains some simple c macros for combos, 3-key tap dance, & home-row mods. * [`build.sh`](build.sh) is an interactive script to build and flash firmware using a local build environment. * **layout** is near identical to my layout [here (keymapdb)](https://keymapdb.com/keymaps/waffle87), sans a couple things like unicode. diff --git a/revxlp/boards/shields/revxlp/Kconfig.defconfig b/revxlp/boards/shields/revxlp/Kconfig.defconfig index da27481..84fb149 100644 --- a/revxlp/boards/shields/revxlp/Kconfig.defconfig +++ b/revxlp/boards/shields/revxlp/Kconfig.defconfig @@ -1,7 +1,6 @@ -# Copyright (c) 2024 The ZMK Contributors -# SPDX-License-Identifier: MIT - if SHIELD_REVXLP -config ZMK_KEYBOARD_NAME + config ZMK_KEYBOARD_NAME default "revxlp" + config ZMK_SLEEP + default y endif diff --git a/revxlp/boards/shields/revxlp/Kconfig.shield b/revxlp/boards/shields/revxlp/Kconfig.shield index 98e33ea..4c19057 100644 --- a/revxlp/boards/shields/revxlp/Kconfig.shield +++ b/revxlp/boards/shields/revxlp/Kconfig.shield @@ -1,6 +1,3 @@ -# Copyright (c) 2024 The ZMK Contributors -# SPDX-License-Identifier: MIT - config SHIELD_REVXLP - def_bool $(shields_list_contains,revxlp) - select SPI + def_bool $(shields_list_contains,revxlp) + select SPI diff --git a/revxlp/boards/shields/revxlp/boards/seeeduino_xiao.conf b/revxlp/boards/shields/revxlp/boards/seeeduino_xiao.conf deleted file mode 100644 index 81b8cd7..0000000 --- a/revxlp/boards/shields/revxlp/boards/seeeduino_xiao.conf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_SPI=y -CONFIG_ZMK_KSCAN_MATRIX_POLLING=y diff --git a/revxlp/boards/shields/revxlp/boards/seeeduino_xiao_ble.overlay b/revxlp/boards/shields/revxlp/boards/seeeduino_xiao_ble.overlay index 5b37ffb..8f9b05a 100644 --- a/revxlp/boards/shields/revxlp/boards/seeeduino_xiao_ble.overlay +++ b/revxlp/boards/shields/revxlp/boards/seeeduino_xiao_ble.overlay @@ -1,13 +1,13 @@ &spi2_default { - group1 { - psels = <NRF_PSEL(SPIM_SCK, 1, 13)>, - <NRF_PSEL(SPIM_MOSI, 1, 15)>; - }; + group1 { + psels = <NRF_PSEL(SPIM_SCK, 1, 13)>, + <NRF_PSEL(SPIM_MOSI, 1, 15)>; + }; }; &spi2_sleep { - group1 { - psels = <NRF_PSEL(SPIM_SCK, 1, 13)>, - <NRF_PSEL(SPIM_MOSI, 1, 15)>; - }; + group1 { + psels = <NRF_PSEL(SPIM_SCK, 1, 13)>, + <NRF_PSEL(SPIM_MOSI, 1, 15)>; + }; }; diff --git a/revxlp/boards/shields/revxlp/revxlp.overlay b/revxlp/boards/shields/revxlp/revxlp.overlay index 88bdc8a..570e883 100644 --- a/revxlp/boards/shields/revxlp/revxlp.overlay +++ b/revxlp/boards/shields/revxlp/revxlp.overlay @@ -1,69 +1,62 @@ -/* - * Copyright (c) 2024 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - #include <dt-bindings/zmk/matrix_transform.h> &xiao_serial { status = "disabled"; }; &xiao_spi { - status = "okay"; - cs-gpios = <&xiao_d 9 GPIO_ACTIVE_LOW>; - shifter: 595@0 { - compatible = "zmk,gpio-595"; - status = "okay"; - gpio-controller; - spi-max-frequency = <200000>; - reg = <0>; - label = "4HC595"; - #gpio-cells = <2>; - ngpios = <8>; - }; + status = "okay"; + cs-gpios = <&xiao_d 9 GPIO_ACTIVE_LOW>; + shifter: 595@0 { + compatible = "zmk,gpio-595"; + status = "okay"; + gpio-controller; + spi-max-frequency = <200000>; + reg = <0>; + label = "4HC595"; + #gpio-cells = <2>; + ngpios = <8>; + }; }; / { - chosen { - zmk,kscan = &kscan0; - zmk,matrix_transform = &default_transform; - }; + chosen { + zmk,kscan = &kscan0; + zmk,matrix_transform = &default_transform; + }; + + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <6>; + rows = <7>; + map = < + RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(1,5) RC(1,4) RC(1,3) RC(1,2) RC(1,1) RC(1,0) + RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(3,5) RC(3,4) RC(3,3) RC(3,2) RC(3,1) RC(3,0) + RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,5) RC(5,5) RC(5,4) RC(5,3) RC(5,2) RC(5,1) RC(5,0) + RC(6,0) RC(6,1) RC(6,2) RC(6,3) RC(6,4) RC(6,5) + >; + }; + + kscan0: kscan_0 { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + diode-direction = "col2row"; - default_transform: keymap_transform_0 { - compatible = "zmk,matrix-transform"; - columns = <6>; - rows = <7>; - - map = < -RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(1,5) RC(1,4) RC(1,3) RC(1,2) RC(1,1) RC(1,0) -RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(3,5) RC(3,4) RC(3,3) RC(3,2) RC(3,1) RC(3,0) -RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,5) RC(5,5) RC(5,4) RC(5,3) RC(5,2) RC(5,1) RC(5,0) - RC(6,0) RC(6,1) RC(6,2) RC(6,3) RC(6,4) RC(6,5) - >; - }; + col-gpios + = <&shifter 7 GPIO_ACTIVE_HIGH> + , <&shifter 6 GPIO_ACTIVE_HIGH> + , <&shifter 5 GPIO_ACTIVE_HIGH> + , <&shifter 4 GPIO_ACTIVE_HIGH> + , <&shifter 3 GPIO_ACTIVE_HIGH> + , <&shifter 2 GPIO_ACTIVE_HIGH> + ; - kscan0: kscan_0 { - compatible = "zmk,kscan-gpio-matrix"; - label = "KSCAN"; - diode-direction = "col2row"; - - col-gpios - = <&shifter 7 GPIO_ACTIVE_HIGH> - , <&shifter 6 GPIO_ACTIVE_HIGH> - , <&shifter 5 GPIO_ACTIVE_HIGH> - , <&shifter 4 GPIO_ACTIVE_HIGH> - , <&shifter 3 GPIO_ACTIVE_HIGH> - , <&shifter 2 GPIO_ACTIVE_HIGH> - ; - - row-gpios - = <&xiao_d 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&xiao_d 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&xiao_d 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&xiao_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&xiao_d 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&xiao_d 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&xiao_d 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - ; - }; + row-gpios + = <&xiao_d 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&xiao_d 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&xiao_d 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&xiao_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&xiao_d 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&xiao_d 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&xiao_d 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + }; }; diff --git a/revxlp/build.yaml b/revxlp/build.yaml deleted file mode 100644 index a84d80b..0000000 --- a/revxlp/build.yaml +++ /dev/null @@ -1,2 +0,0 @@ -board: [seeeduino_xiao_ble] -shield: [revxlp] diff --git a/revxlp/config/west.yml b/revxlp/config/west.yml index 3b1b927..379d291 100644 --- a/revxlp/config/west.yml +++ b/revxlp/config/west.yml @@ -2,12 +2,10 @@ manifest: remotes: - name: zmkfirmware url-base: https://github.com/zmkfirmware - - name: petejohanson - url-base: https://github.com/petejohanson projects: - name: zmk - remote: petejohanson - revision: build/zephyr-module-keymap-loading-refactor + remote: zmkfirmware + revision: main import: app/west.yml self: path: config |