diff options
-rwxr-xr-x | build.sh | 6 | ||||
-rw-r--r-- | config/flake.conf | 2 | ||||
-rw-r--r-- | config/flake.keymap | 56 | ||||
-rw-r--r-- | flake/boards/shields/flake/Kconfig.defconfig | 11 | ||||
-rw-r--r-- | flake/boards/shields/flake/Kconfig.shield | 5 | ||||
-rw-r--r-- | flake/boards/shields/flake/flake.dtsi | 26 | ||||
-rw-r--r-- | flake/boards/shields/flake/flake.zmk.yml | 11 | ||||
-rw-r--r-- | flake/boards/shields/flake/flake_left.overlay | 20 | ||||
-rw-r--r-- | flake/boards/shields/flake/flake_right.overlay | 20 | ||||
-rw-r--r-- | flake/config/west.yml | 11 | ||||
-rw-r--r-- | flake/zephyr/module.yml | 4 |
11 files changed, 171 insertions, 1 deletions
@@ -35,7 +35,7 @@ build() { } 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) corne\t(2) corne-ish zen\t(3) revxlp\t(4) sweep\t(5) flake\t(6) settings reset:\t" read opt; case $opt in 1) @@ -54,6 +54,10 @@ case $opt in build splitkb_aurora_sweep_right nice_nano_v2 ;; 5) + build flake_left nice_nano_v2 "flake" + build flake_right nice_nano_v2 "flake" + ;; + 6) printf "${BOLD}select microcontroller${NORMAL}...\n" printf "(1) nice nano\t(2) nice nano v2\t(3) xiao ble:\t" read val; diff --git a/config/flake.conf b/config/flake.conf new file mode 100644 index 0000000..d85021a --- /dev/null +++ b/config/flake.conf @@ -0,0 +1,2 @@ +CONFIG_ZMK_SLEEP=y +CONFIG_ZMK_USB_LOGGING=n diff --git a/config/flake.keymap b/config/flake.keymap new file mode 100644 index 0000000..1193e05 --- /dev/null +++ b/config/flake.keymap @@ -0,0 +1,56 @@ +// 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 = < + &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 &updir < 1 ESC &kp SPACE &none &none &kp BSPC < 2 RS(RC(V)) &pnp &none + >; + }; + 1 { + bindings = < + &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 &trans &trans &trans &trans &trans &trans &trans + + >; + }; + 2 { + bindings = < + &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 + >; + }; + }; + + combos { + compatible = "zmk,combos"; + // name output pos. + COMBO(we_eqal, &kp EQUAL, 1 2) + COMBO(er_cbkt, &td_cbrkt, 2 3) + COMBO(rt_bsls, &kp BSLH, 3 4) + COMBO(yu_quot, &kp QUOT, 5 6) + COMBO(ui_brkt, &td_brkt, 6 7) + COMBO(io_mins, &td_min_dash, 7 8) + COMBO(sd_plus, &kp PLUS, 11 12) + COMBO(df_coln, &kp COLON, 12 13) + COMBO(fg_pipe, &kp PIPE, 13 14) + 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) + + }; +}; diff --git a/flake/boards/shields/flake/Kconfig.defconfig b/flake/boards/shields/flake/Kconfig.defconfig new file mode 100644 index 0000000..4a655c3 --- /dev/null +++ b/flake/boards/shields/flake/Kconfig.defconfig @@ -0,0 +1,11 @@ +if SHIELD_FLAKE_LEFT +config ZMK_KEYBOARD_NAME + default "flake" +config ZMK_SPLIT_ROLE_CENTRAL + default y +endif + +if SHIELD_FLAKE_LEFT || SHIELD_FLAKE_RIGHT +config ZMK_SPLIT + default y +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..f426b0a --- /dev/null +++ b/flake/boards/shields/flake/flake.dtsi @@ -0,0 +1,26 @@ +#include <dt-bindings/zmk/matrix_transform.h> + +/ { + kscan0: kscan0 { + compatible = "zmk,kscan-gpio-matrix"; + diode-direction = "col2row"; + wakeup-source; + }; + + chosen { + zmk,kscan = &kscan0; + zmk,matrix_transform = &default_transform; + }; + + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <10>; + rows = <4>; + map = < + 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,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) RC(3,10) + RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,5) RC(4,6) RC(4,7) RC(4,8) RC(4,9) RC(4,10) + >; + }; +}; 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..49ea9de --- /dev/null +++ b/flake/boards/shields/flake/flake_left.overlay @@ -0,0 +1,20 @@ +#include "flake.dtsi" + +&kscan0 { + col-gpios + = <&pro_micro 2 GPIO_ACTIVE_HIGH> + , <&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 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&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..040d55b --- /dev/null +++ b/flake/boards/shields/flake/flake_right.overlay @@ -0,0 +1,20 @@ +#include "flake.dtsi" + +&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> + , <&pro_micro 21 GPIO_ACTIVE_HIGH> + ; + + row-gpios + = <&pro_micro 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&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: . |