diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..37cba72 --- /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 \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ + diff --git a/build.yaml b/build.yaml new file mode 100644 index 0000000..487566a --- /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: cygnus_left + - board: nice_nano_v2 + shield: cygnus_right + - board: nice_nano_v2 + shield: settings_reset diff --git a/config/boards/shields/cygnus/Kconfig.defconfig b/config/boards/shields/cygnus/Kconfig.defconfig new file mode 100644 index 0000000..80c3fe5 --- /dev/null +++ b/config/boards/shields/cygnus/Kconfig.defconfig @@ -0,0 +1,19 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +if SHIELD_CYGNUS_LEFT + +config ZMK_KEYBOARD_NAME + default "Cygnus" + +config ZMK_SPLIT_BLE_ROLE_CENTRAL + default y + +endif + +if SHIELD_CYGNUS_LEFT || SHIELD_CYGNUS_RIGHT + +config ZMK_SPLIT + default y + +endif \ No newline at end of file diff --git a/config/boards/shields/cygnus/Kconfig.shield b/config/boards/shields/cygnus/Kconfig.shield new file mode 100644 index 0000000..e46d1e8 --- /dev/null +++ b/config/boards/shields/cygnus/Kconfig.shield @@ -0,0 +1,8 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config SHIELD_CYGNUS_LEFT + def_bool $(shields_list_contains,cygnus_left) + +config SHIELD_CYGNUS_RIGHT + def_bool $(shields_list_contains,cygnus_right) \ No newline at end of file diff --git a/config/boards/shields/cygnus/README.md b/config/boards/shields/cygnus/README.md new file mode 100644 index 0000000..e69de29 diff --git a/config/boards/shields/cygnus/cygnus.conf b/config/boards/shields/cygnus/cygnus.conf new file mode 100644 index 0000000..e69de29 diff --git a/config/boards/shields/cygnus/cygnus.dtsi b/config/boards/shields/cygnus/cygnus.dtsi new file mode 100644 index 0000000..79d4358 --- /dev/null +++ b/config/boards/shields/cygnus/cygnus.dtsi @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2020 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 = <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,2) RC(3,3) RC(3,0) RC(3,9) RC(3,6) RC(3,7) + >; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + diode-direction = "col2row"; + row-gpios + = <&pro_micro 18 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + }; + +}; \ No newline at end of file diff --git a/config/boards/shields/cygnus/cygnus.keymap b/config/boards/shields/cygnus/cygnus.keymap new file mode 100644 index 0000000..97d1197 --- /dev/null +++ b/config/boards/shields/cygnus/cygnus.keymap @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include + + +&mt { + tapping-term-ms = <200>; + flavor = "tap-preferred"; + }; +&sk { + release-after-ms = <2000>; + quick-release; + }; + + +/ { + combos { + compatible = "zmk,combos"; + combo_esc { + timeout-ms = <50>; + key-positions = <1 2>; + bindings = <&kp ESC>; + }; + combo_tab { + timeout-ms = <50>; + key-positions = <11 12>; + bindings = <&kp TAB>; + }; + }; + +behaviors { + hm: homerow_mods { + compatible = "zmk,behavior-hold-tap"; + label = "HOMEROW_MODS"; + #binding-cells = <2>; + tapping-term-ms = <240>; + quick_tap_ms = <0>; + flavor = "tap-preferred"; + bindings = <&kp>, <&kp>; + }; + hs: homerow_shifts { + compatible = "zmk,behavior-hold-tap"; + label = "HOMEROW_SHIFTS"; + #binding-cells = <2>; + tapping-term-ms = <150>; + quick_tap_ms = <0>; + flavor = "balanced"; + bindings = <&kp>, <&kp>; + }; + td: tapdance { + compatible = "zmk,behavior-hold-tap"; + label = "TAPDANCE"; + #binding-cells = <2>; + tapping-term-ms = <190>; + quick_tap_ms = <0>; + flavor = "tap-preferred"; + bindings = <&kp>, <&kp>; + }; +}; + +keymap { + compatible = "zmk,keymap"; + + default_layer { + bindings = < + &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P + &hm LCTRL A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &hm RCTRL SEMI + &hs LSHIFT Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp PERIOD &hs RSHIFT SLASH + &kp BSPC < 1 DEL &kp LALT &kp RALT < 2 RET &kp SPACE + >; + }; + + lower_layer { + bindings = < + &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 + &trans &trans &trans &trans &kp PSCRN &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp SQT + &trans &kp C_PREV &kp C_NEXT &kp LEFT &kp RIGHT &kp MINUS &kp PLUS &kp LBKT &kp RBKT &hs RSHIFT BSLH + &trans &trans &kp LGUI &trans &trans &trans + >; + }; + + raise_layer { + bindings = < + &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 + &kp F11 &kp F12 &trans &kp GRAVE &kp AMPS &kp EQUAL &kp LS(N9) &kp LS(N0) &kp RA(LBKT) &kp RA(RBKT) + &trans &trans &trans &trans &trans &kp MINUS &kp RA(SQT) &kp RA(BSLH) &kp BSLH &kp LS(BSLH) + &trans &trans &trans &trans &trans &trans + >; + }; + + adjust_layer { + bindings = < + &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 + &kp F11 &kp F12 &trans &trans &trans &trans &trans &trans &trans &trans + &bt BT_PRV &bt BT_NXT &bt BT_CLR &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans + >; + }; +}; +}; \ No newline at end of file diff --git a/config/boards/shields/cygnus/cygnus.zmk.yml b/config/boards/shields/cygnus/cygnus.zmk.yml new file mode 100644 index 0000000..21a97a9 --- /dev/null +++ b/config/boards/shields/cygnus/cygnus.zmk.yml @@ -0,0 +1,13 @@ +file_format: "1" +id: cygnus +name: Cygnus +type: shield +url: +requires: + - pro_micro +exposes: +features: + - keys +siblings: + - cygnus_left + - cygnus_right diff --git a/config/boards/shields/cygnus/cygnus_left.conf b/config/boards/shields/cygnus/cygnus_left.conf new file mode 100644 index 0000000..9d65bb6 --- /dev/null +++ b/config/boards/shields/cygnus/cygnus_left.conf @@ -0,0 +1,2 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT \ No newline at end of file diff --git a/config/boards/shields/cygnus/cygnus_left.overlay b/config/boards/shields/cygnus/cygnus_left.overlay new file mode 100644 index 0000000..d463f11 --- /dev/null +++ b/config/boards/shields/cygnus/cygnus_left.overlay @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include "cygnus.dtsi" +&kscan0 { + col-gpios + = <&pro_micro 20 GPIO_ACTIVE_HIGH> + , <&pro_micro 10 GPIO_ACTIVE_HIGH> + , <&pro_micro 6 GPIO_ACTIVE_HIGH> + , <&pro_micro 7 GPIO_ACTIVE_HIGH> + , <&pro_micro 8 GPIO_ACTIVE_HIGH> + ; +}; \ No newline at end of file diff --git a/config/boards/shields/cygnus/cygnus_right.conf b/config/boards/shields/cygnus/cygnus_right.conf new file mode 100644 index 0000000..9d65bb6 --- /dev/null +++ b/config/boards/shields/cygnus/cygnus_right.conf @@ -0,0 +1,2 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT \ No newline at end of file diff --git a/config/boards/shields/cygnus/cygnus_right.overlay b/config/boards/shields/cygnus/cygnus_right.overlay new file mode 100644 index 0000000..abbaea6 --- /dev/null +++ b/config/boards/shields/cygnus/cygnus_right.overlay @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include "cygnus.dtsi" + +&default_transform { + col-offset = <5>; +}; + +&kscan0 { + col-gpios + = <&pro_micro 8 GPIO_ACTIVE_HIGH> + , <&pro_micro 7 GPIO_ACTIVE_HIGH> + , <&pro_micro 6 GPIO_ACTIVE_HIGH> + , <&pro_micro 10 GPIO_ACTIVE_HIGH> + , <&pro_micro 20 GPIO_ACTIVE_HIGH> + ; +}; \ No newline at end of file diff --git a/config/cygnus.conf b/config/cygnus.conf new file mode 100644 index 0000000..c467ec9 --- /dev/null +++ b/config/cygnus.conf @@ -0,0 +1,9 @@ +# 电池电量报告间隔时间单位是秒 +CONFIG_ZMK_BATTERY_REPORT_INTERVAL=60 +# 增加键盘消抖 +CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS=5 +CONFIG_ZMK_KSCAN_DEBOUNCE_RELEASE_MS=5 +# 增加键盘的 BLE 无线电的发射功率,用解决延迟和左右通讯不佳的问题 +CONFIG_BT_CTLR_TX_PWR_PLUS_8=y +# 更改键盘默认显示名称 +CONFIG_ZMK_KEYBOARD_NAME="Skeletyl" diff --git a/config/cygnus.json b/config/cygnus.json new file mode 100644 index 0000000..26432c1 --- /dev/null +++ b/config/cygnus.json @@ -0,0 +1,51 @@ +{ + "id": "skeletyl", + "name": "skeletyl", + "layouts": { + "default_layout": { + "name": "default_layout", + "layout": [ + { "row": 0, "col": 0, "x": 0, "y": 0.36 }, + { "row": 0, "col": 2, "x": 1, "y": 0.36 }, + { "row": 0, "col": 4, "x": 2, "y": 0.11 }, + { "row": 0, "col": 6, "x": 3, "y": -0.015 }, + { "row": 0, "col": 7, "x": 4, "y": 0.11 }, + { "row": 0, "col": 8, "x": 9, "y": 0.11 }, + { "row": 0, "col": 10, "x": 10, "y": -0.015 }, + { "row": 0, "col": 11, "x": 11, "y": 0.11 }, + { "row": 0, "col": 12, "x": 12, "y": 0.36 }, + { "row": 0, "col": 13, "x": 13, "y": 0.36 }, + + { "row": 1, "col": 0, "x": 0, "y": 1.36 }, + { "row": 1, "col": 2, "x": 1, "y": 1.36 }, + { "row": 1, "col": 4, "x": 2, "y": 1.11 }, + { "row": 1, "col": 6, "x": 3, "y": 0.985 }, + { "row": 1, "col": 7, "x": 4, "y": 1.11 }, + { "row": 1, "col": 8, "x": 9, "y": 1.11 }, + { "row": 1, "col": 10, "x": 10, "y": 0.985 }, + { "row": 1, "col": 11, "x": 11, "y": 1.11 }, + { "row": 1, "col": 12, "x": 12, "y": 1.36 }, + { "row": 1, "col": 13, "x": 13, "y": 1.36 }, + + { "row": 2, "col": 0, "x": 0, "y": 2.36 }, + { "row": 2, "col": 2, "x": 1, "y": 2.36 }, + { "row": 2, "col": 4, "x": 2, "y": 2.11 }, + { "row": 2, "col": 6, "x": 3, "y": 1.985 }, + { "row": 2, "col": 7, "x": 4, "y": 2.11 }, + { "row": 2, "col": 8, "x": 9, "y": 2.11 }, + { "row": 2, "col": 10, "x": 10, "y": 1.985 }, + { "row": 2, "col": 11, "x": 11, "y": 2.11 }, + { "row": 2, "col": 12, "x": 12, "y": 2.36 }, + { "row": 2, "col": 13, "x": 13, "y": 2.36 }, + + { "row": 3, "col": 1, "x":3.48,"y":3.13,"r":0}, + { "row": 3, "col": 3, "x":3.48,"y":3.13,"r":15,"rx":3.98,"ry":7.63}, + { "row": 3, "col": 5, "x":3.48,"y":2.63,"r":30,"rx":3.98,"ry":7.63,"h":1.5}, + { "row": 3, "col": 7, "x":10.52,"y":2.63,"r":-30,"rx":11.02,"ry":7.63,"h":1.5}, + { "row": 3, "col": 8, "x":10.52,"y":3.13,"r":-15,"rx":11.02,"ry":7.63}, + { "row": 3, "col": 9, "x":10.52,"y":3.13} + ] + } + }, + "sensors": [] +} \ No newline at end of file diff --git a/config/cygnus.keymap b/config/cygnus.keymap new file mode 100644 index 0000000..6b001e0 --- /dev/null +++ b/config/cygnus.keymap @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include + +&mt { + tapping-term-ms = <200>; + flavor = "tap-preferred"; +}; + +&sk { + release-after-ms = <2000>; + quick-release; +}; + +/ { + combos { + compatible = "zmk,combos"; + + left_bkt { + bindings = <&kp LBKT>; + key-positions = <3 2>; + timeout-ms = <50>; + }; + + right_bkt { + bindings = <&kp RBKT>; + key-positions = <6 7>; + timeout-ms = <50>; + }; + + left_par { + bindings = <&kp LEFT_PARENTHESIS>; + key-positions = <12 13>; + timeout-ms = <50>; + }; + + right_par { + bindings = <&kp RIGHT_PARENTHESIS>; + key-positions = <16 17>; + timeout-ms = <50>; + }; + + left_brace { + bindings = <&kp LEFT_BRACE>; + key-positions = <23 22>; + timeout-ms = <50>; + }; + + right_brace { + bindings = <&kp RIGHT_BRACE>; + key-positions = <26 27>; + timeout-ms = <50>; + }; + + bac { + bindings = <&kp BACKSLASH>; + key-positions = <4 5>; + }; + + pipe { + bindings = <&kp PIPE>; + key-positions = <14 15>; + }; + }; + behaviors { + hm: homerow_mods { + compatible = "zmk,behavior-hold-tap"; + label = "HOMEROW_MODS"; + #binding-cells = <2>; + tapping-term-ms = <200>; + quick_tap_ms = <0>; + flavor = "tap-preferred"; + bindings = + <&kp>, + <&kp>; + + quick-tap-ms = <180>; + global-quick-tap; + }; + ltq: ltq { + compatible = "zmk,behavior-hold-tap"; + label = "LTQ"; + #binding-cells = <2>; + tapping-term-ms = <200>; + quick_tap_ms = <0>; + flavor = "hold-preferred"; + bindings = + <&mo>, + <&kp>; + + quick-tap-ms = <180>; + global-quick-tap; + }; + }; + + keymap { + compatible = "zmk,keymap"; + + default_layer { + bindings = < + &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P +&hm LEFT_GUI A &hm LEFT_ALT S &hm LCTRL D &hm LEFT_SHIFT F &kp G &kp H &hm RIGHT_SHIFT J &hm RCTRL K &hm RIGHT_ALT L &hm RIGHT_GUI SEMI + &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp PERIOD &kp FSLH + < 1 SPACE < 2 ENTER &kp LALT &kp RALT &mo 3 <q 2 BACKSPACE + >; + }; + + lower_layer { + bindings = < +&kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 +&trans &trans &trans &trans &trans &kp MINUS &kp EQUAL &kp GRAVE &trans &kp SQT +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &kp RSHFT &trans + >; + }; + raise_layer { + bindings = < +&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 &trans + >; + }; + adjust_layer { + bindings = < +&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 &trans + >; + }; + layer_4 { + bindings = < +&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 &trans + >; + }; + + layer_5 { + bindings = < +&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 &trans + >; + }; + + layer_6 { + bindings = < +&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 &trans + >; + }; + + layer_7 { + bindings = < +&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 &trans + >; + }; + }; +}; diff --git a/config/west.yml b/config/west.yml new file mode 100644 index 0000000..d321083 --- /dev/null +++ b/config/west.yml @@ -0,0 +1,17 @@ +manifest: + remotes: + - name: zmkfirmware + url-base: https://github.com/zmkfirmware + - name: kuolemax + url-base: https://github.com/kuolemax + projects: + - name: zmk + remote: kuolemax + revision: encoder-fix + import: app/west.yml + # - name: zmk + # remote: zmkfirmware + # revision: main + # import: app/west.yml + self: + path: config