commit ebe8b440ea1c3b3afef9b814b11b63780e9f9632 Author: Sadek Baroudi Date: Fri Nov 4 23:48:28 2022 -0700 first attempt at zmk swweeep firmware diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..d74fb89 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,5 @@ +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@main diff --git a/build.yaml b/build.yaml new file mode 100644 index 0000000..6e5cdc3 --- /dev/null +++ b/build.yaml @@ -0,0 +1,21 @@ +# This file generates the GitHub Actions matrix +# For simple board + shield combinations, add them +# to the top level board and shield arrays, for more +# control, add individual board + shield combinations to +# the `include` property, e.g: +# +# board: [ "nice_nano_v2" ] +# shield: [ "corne_left", "corne_right" ] +# include: +# - board: bdn9_rev2 +# - board: nice_nano_v2 +# shield: reviung41 +# +--- +include: + - board: nice_nano_v2 + shield: swweeep_left nice_view_adapter nice_view + - board: nice_nano_v2 + shield: swweeep_right nice_view_adapter nice_view + - board: nice_nano_v2 + shield: settings_reset diff --git a/config/boards/shields/swweeep/Kconfig.defconfig b/config/boards/shields/swweeep/Kconfig.defconfig new file mode 100644 index 0000000..5a88a55 --- /dev/null +++ b/config/boards/shields/swweeep/Kconfig.defconfig @@ -0,0 +1,17 @@ +# Copyright (c) 2022 The ZMK Contributors +# SPDX-License-Identifier: MIT + +if SHIELD_SWWEEEP_LEFT + +config ZMK_KEYBOARD_NAME + default "swweeep" + +config ZMK_SPLIT_ROLE_CENTRAL + default y + +endif + +if SHIELD_SWWEEEP_LEFT || SHIELD_SWWEEEP_RIGHT +config ZMK_SPLIT + default y +endif diff --git a/config/boards/shields/swweeep/Kconfig.shield b/config/boards/shields/swweeep/Kconfig.shield new file mode 100644 index 0000000..526e4ff --- /dev/null +++ b/config/boards/shields/swweeep/Kconfig.shield @@ -0,0 +1,8 @@ +# Copyright (c) 2022 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config SHIELD_SWWEEEP_LEFT + def_bool $(shields_list_contains,swweeep_left) + +config SHIELD_SWWEEEP_RIGHT + def_bool $(shields_list_contains,swweeep_right) \ No newline at end of file diff --git a/config/boards/shields/swweeep/swweeep.conf b/config/boards/shields/swweeep/swweeep.conf new file mode 100644 index 0000000..e69de29 diff --git a/config/boards/shields/swweeep/swweeep.dtsi b/config/boards/shields/swweeep/swweeep.dtsi new file mode 100644 index 0000000..3f46358 --- /dev/null +++ b/config/boards/shields/swweeep/swweeep.dtsi @@ -0,0 +1,55 @@ +/* + * Copyright (c) 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 = <36>; + rows = <1>; + + map = < + RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,22) RC(0,21) RC(0,20) RC(0,19) RC(0,18) + RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,27) RC(0,26) RC(0,25) RC(0,24) RC(0,23) + RC(0,10) RC(0,11) RC(0,12) RC(0,13) RC(0,14) RC(0,32) RC(0,31) RC(0,30) RC(0,29) RC(0,28) + RC(0,15) RC(0,16) RC(0,17) RC(0,35) RC(0,34) RC(0,33) + >; + }; + + kscan0: kscan_0 { + compatible = "zmk,kscan-gpio-direct"; + label = "KSCAN"; + input-gpios + = <&pro_micro 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio1 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio1 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio1 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 16 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 18 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 21 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 20 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro 19 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + ; + + + }; +}; diff --git a/config/boards/shields/swweeep/swweeep.keymap b/config/boards/shields/swweeep/swweeep.keymap new file mode 100644 index 0000000..78132fa --- /dev/null +++ b/config/boards/shields/swweeep/swweeep.keymap @@ -0,0 +1,142 @@ +#include +#include +#include +#include + +#define DEFAULT 0 +#define NAV 1 +#define SYM 2 +#define FUNC 3 +#define MEDIA 4 +#define MOUSE 5 +#define WINNAV 6 + +&caps_word { + continue-list = ; +}; + +/ { + combos { + compatible = "zmk,combos"; + combo_undo { + timeout-ms = <50>; + key-positions = <20 21>; + bindings = <&kp LC(Z)>; + }; + combo_q { + timeout-ms = <50>; + key-positions = <21 22>; + bindings = <&kp Q>; + }; + combo_semicolon { + timeout-ms = <50>; + key-positions = <27 28>; + bindings = <&kp SEMI>; + }; + }; +}; + +/ { + + behaviors { + hm: homerow_mods { + compatible = "zmk,behavior-hold-tap"; + label = "HOMEROW_MODS"; + #binding-cells = <2>; + tapping-term-ms = <200>; + quick_tap_ms = <0>; + flavor = "balanced"; + bindings = <&kp>, <&kp>; + }; + hs: homerow_shift { + compatible = "zmk,behavior-hold-tap"; + label = "HOMEROW_SHIFT"; + #binding-cells = <2>; + tapping-term-ms = <175>; + quick_tap_ms = <0>; + flavor = "balanced"; + bindings = <&kp>, <&kp>; + }; + }; + + keymap { + compatible = "zmk,keymap"; + + default_layer { + label = "Default"; + + bindings = < + &kp Q &kp W &kp F &kp P &kp B &kp J &kp L < WINNAV U &kp Y &kp SEMI + &hm LCTL A &hm LGUI R &hm LALT S &hs LSHIFT T &kp G < MOUSE M &hs RSHIFT N &hm RALT E &hm RGUI I &hm RCTL O + &kp Z &kp X &kp C &kp D &kp V &kp K &kp H &kp COMMA &kp DOT &kp FSLH + &kp DEL < NAV RET < FUNC TAB < MEDIA BSPC < SYM SPACE &kp SQT + >; + }; + + nav_layer { + label = "Navigation"; + + bindings = < + &kp ESC &kp PG_UP &kp UP &kp PG_DN &trans &kp ASTRK &kp N7 &kp N8 &kp N9 &kp MINUS + &kp HOME &kp LEFT &kp DOWN &kp RIGHT &kp END &kp FSLH &kp N4 &kp N5 &kp N6 &kp PLUS + &trans &trans &trans &trans &trans &kp EQUAL &kp N1 &kp N2 &kp N3 &kp N0 + &trans &trans &kp TAB &kp BSPC &kp SPACE &kp DOT + >; + }; + + sym_layer { + label = "Symbols"; + + bindings = < + &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp ASTRK &kp UNDER &kp EQUAL + &kp MINUS &kp LBKT &kp LBRC &kp LPAR &kp LT &kp GT &kp RPAR &kp RBRC &kp RBKT &kp PLUS + &kp CAPS &kp GRAVE &kp LC(LS(TAB)) &kp LC(LG(LEFT)) &caps_word &trans &kp LC(LG(RIGHT)) &kp LC(TAB) &trans &kp BSLH + &trans &kp RET &kp DEL &kp BSPC &trans &trans + >; + }; + + func_layer { + label = "Function"; + + bindings = < + &trans &kp LS(PG_UP) &kp LS(UP) &kp LS(PG_DN) &trans &kp C_PLAY_PAUSE &kp F7 &kp F8 &kp F9 &kp F10 + &kp LS(HOME) &kp LS(LEFT) &kp LS(DOWN) &kp LS(RIGHT) &kp LS(END) &kp K_VOL_UP &kp F4 &kp F5 &kp F6 &kp F11 + &trans &trans &trans &trans &kp C_MUTE &kp K_VOL_DN &kp F1 &kp F2 &kp F3 &kp F12 + &trans &trans &trans &trans &trans &kp SPACE + >; + }; + + media_layer { + label = "Media"; + + bindings = < + &trans &trans &trans &trans &trans &trans &bt BT_PRV &bt BT_NXT &trans &trans + &trans &trans &trans &trans &trans &bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 + &trans &trans &trans &trans &trans &ext_power EP_TOG &ext_power EP_ON &ext_power EP_OFF &out OUT_USB &out OUT_BLE + &trans &trans &trans &trans &trans &trans + >; + }; + + mouse_layer { + label = "Mouse"; + + bindings = < + &bootloader &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans + >; + }; + + winnav_layer { + label = "Win Navigation"; + + bindings = < + &trans &trans &kp LG(UP) &trans &trans &trans &trans &trans &trans &trans + &trans &kp LG(LEFT) &kp LG(DOWN) &kp LG(RIGHT) &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans + >; + }; + }; +}; diff --git a/config/boards/shields/swweeep/swweeep.zmk.yml b/config/boards/shields/swweeep/swweeep.zmk.yml new file mode 100644 index 0000000..ed26b2e --- /dev/null +++ b/config/boards/shields/swweeep/swweeep.zmk.yml @@ -0,0 +1,11 @@ +file_format: "1" +id: swweeep +name: swweeep +type: shield +url: https://github.com/sadekbaroudi/sweep36 +requires: [pro_micro] +features: + - keys +siblings: + - swweeep_left + - swweeep_right \ No newline at end of file diff --git a/config/boards/shields/swweeep/swweeep_left.conf b/config/boards/shields/swweeep/swweeep_left.conf new file mode 100644 index 0000000..e69de29 diff --git a/config/boards/shields/swweeep/swweeep_left.overlay b/config/boards/shields/swweeep/swweeep_left.overlay new file mode 100644 index 0000000..dde597d --- /dev/null +++ b/config/boards/shields/swweeep/swweeep_left.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include "swweeep.dtsi" diff --git a/config/boards/shields/swweeep/swweeep_right.conf b/config/boards/shields/swweeep/swweeep_right.conf new file mode 100644 index 0000000..e69de29 diff --git a/config/boards/shields/swweeep/swweeep_right.overlay b/config/boards/shields/swweeep/swweeep_right.overlay new file mode 100644 index 0000000..b254890 --- /dev/null +++ b/config/boards/shields/swweeep/swweeep_right.overlay @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include "swweeep.dtsi" + +&default_transform { + col-offset = <18>; +}; diff --git a/config/west.yml b/config/west.yml new file mode 100644 index 0000000..adc97b7 --- /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 \ No newline at end of file