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/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/build.yaml b/build.yaml new file mode 100644 index 0000000..a7d028e --- /dev/null +++ b/build.yaml @@ -0,0 +1,19 @@ +# 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: seeeduino_xiao_ble + shield: corny_left rgbled_adapter + - board: seeeduino_xiao_ble + shield: corny_right rgbled_adapter diff --git a/config/boards/shields/corny/Kconfig.defconfig b/config/boards/shields/corny/Kconfig.defconfig new file mode 100644 index 0000000..f2ae9bb --- /dev/null +++ b/config/boards/shields/corny/Kconfig.defconfig @@ -0,0 +1,16 @@ +if SHIELD_CORNY_LEFT + +config ZMK_KEYBOARD_NAME + default "Corne" + +config ZMK_SPLIT_ROLE_CENTRAL + default y + +endif + +if SHIELD_CORNY_LEFT || SHIELD_CORNY_RIGHT + +config ZMK_SPLIT + default y + +endif diff --git a/config/boards/shields/corny/Kconfig.shield b/config/boards/shields/corny/Kconfig.shield new file mode 100644 index 0000000..b880cf6 --- /dev/null +++ b/config/boards/shields/corny/Kconfig.shield @@ -0,0 +1,5 @@ +config SHIELD_CORNY_LEFT + def_bool $(shields_list_contains,corny_left) + +config SHIELD_CORNY_RIGHT + def_bool $(shields_list_contains,corny_right) diff --git a/config/boards/shields/corny/corny.conf b/config/boards/shields/corny/corny.conf new file mode 100644 index 0000000..c972699 --- /dev/null +++ b/config/boards/shields/corny/corny.conf @@ -0,0 +1,3 @@ +CONFIG_EC11=y +CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y +CONFIG_ZMK_SLEEP=y diff --git a/config/boards/shields/corny/corny.dtsi b/config/boards/shields/corny/corny.dtsi new file mode 100644 index 0000000..737b6e0 --- /dev/null +++ b/config/boards/shields/corny/corny.dtsi @@ -0,0 +1,58 @@ +#include + +/ { + chosen { + zmk,kscan = &kscan0; + zmk,matrix_transform = &default_transform; + }; + + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <12>; + rows = <4>; +// | SW1 | SW2 | SW3 | SW4 | SW5 | SW6 | | SW6 | SW5 | SW4 | SW3 | SW2 | SW1 | +// | SW7 | SW8 | SW9 | SW10 | SW11 | SW12 | | SW12 | SW11 | SW10 | SW9 | SW8 | SW7 | +// | SW13 | SW14 | SW15 | SW16 | SW17 | SW18 | SW22 | | SW22 | SW18 | SW17 | SW16 | SW15 | SW14 | SW13 | +// | SW19 | SW20 | SW21 | | SW21 | SW20 | SW19 | + 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(0,10) RC(0,11) +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(1,10) RC(1,11) +RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(3,5) RC(3,6) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11) + RC(3,2) RC(3,3) RC(3,4) RC(3,7) RC(3,8) RC(3,9) + >; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + + diode-direction = "col2row"; + row-gpios + = <&xiao_d 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&xiao_d 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&xiao_d 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&xiao_d 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + }; + + left_encoder: encoder_left { + compatible = "alps,ec11"; + a-gpios = <&xiao_d 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&xiao_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + steps = <80>; + status = "disabled"; + }; + + right_encoder: encoder_right { + compatible = "alps,ec11"; + a-gpios = <&xiao_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&xiao_d 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + steps = <80>; + status = "disabled"; + }; + + sensors: sensors { + compatible = "zmk,keymap-sensors"; + sensors = <&left_encoder &right_encoder>; + triggers-per-rotation = <20>; + }; +}; diff --git a/config/boards/shields/corny/corny.keymap b/config/boards/shields/corny/corny.keymap new file mode 100644 index 0000000..71801e8 --- /dev/null +++ b/config/boards/shields/corny/corny.keymap @@ -0,0 +1,56 @@ +#include +#include +#include + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { +// ------------------------------------------------------------------------------------------------- +// | TAB | Q | W | E | R | T | | Y | U | I | O | P | BKSP | +// | CTRL | A | S | D | F | G | | H | J | K | L | ; | ' | +// | SHFT | Z | X | C | V | B | MUTE | | | N | M | , | . | / | ESC | +// | GUI | LWR | SPC | | ENT | RSE | ALT | + bindings = < + &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSPC + &kp LCTRL &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT + &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp C_MUTE &none &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp ESC + &kp LGUI &mo 1 &kp SPACE &kp RET &mo 2 &kp LALT + >; + + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>; + }; + lower_layer { +// ------------------------------------------------------------------------------------------------ +// | TAB | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BKSP | +// | BTCLR| BT1 | BT2 | BT3 | BT4 | BT5 | | LFT | DWN | UP | RGT | | F12 | +// | SHFT | F1 | F2 | F3 | F4 | F5 | boot | | | F6 | F7 | F8 | F9 | F10 | F11 | +// | GUI | | SPC | | ENT | | ALT | + bindings = < + &kp TAB &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp BSPC + &bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &kp LEFT &kp DOWN &kp UP &kp RIGHT &trans &kp F12 + &kp LSHFT &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &bootloader &none &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 + &kp LGUI &trans &kp SPACE &kp RET &trans &kp LALT + >; + + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>; + }; + + raise_layer { +// ------------------------------------------------------------------------------------------------ +// | TAB | ! | @ | # | $ | % | | ^ | & | * | ( | ) | BKSP | +// | CTRL | | | | | | | - | = | [ | ] | \ | ` | +// | SHFT | | | | | | | | boot | _ | + | { | } | "|" | ~ | +// | GUI | | SPC | | ENT | | ALT | + bindings = < + &kp TAB &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp KP_MULTIPLY &kp LPAR &kp RPAR &kp BSPC + &kp LCTRL &trans &trans &trans &trans &trans &kp MINUS &kp EQUAL &kp LBKT &kp RBKT &kp BSLH &kp GRAVE + &kp LSHFT &trans &trans &trans &trans &trans &none &bootloader &kp UNDER &kp PLUS &kp LBRC &kp RBRC &kp PIPE &kp TILDE + &kp LGUI &trans &kp SPACE &kp RET &trans &kp LALT + >; + + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>; + }; + }; +}; diff --git a/config/boards/shields/corny/corny_left.conf b/config/boards/shields/corny/corny_left.conf new file mode 100644 index 0000000..11c5f31 --- /dev/null +++ b/config/boards/shields/corny/corny_left.conf @@ -0,0 +1,4 @@ +CONFIG_NFCT_PINS_AS_GPIOS=y +CONFIG_EC11=y +CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y +CONFIG_ZMK_SLEEP=y diff --git a/config/boards/shields/corny/corny_left.overlay b/config/boards/shields/corny/corny_left.overlay new file mode 100644 index 0000000..6ec0d12 --- /dev/null +++ b/config/boards/shields/corny/corny_left.overlay @@ -0,0 +1,16 @@ +#include "corny.dtsi" + +&kscan0 { + col-gpios + = <&gpio0 10 GPIO_ACTIVE_HIGH> + , <&xiao_d 10 GPIO_ACTIVE_HIGH> + , <&xiao_d 3 GPIO_ACTIVE_HIGH> + , <&xiao_d 8 GPIO_ACTIVE_HIGH> + , <&xiao_d 6 GPIO_ACTIVE_HIGH> + , <&xiao_d 7 GPIO_ACTIVE_HIGH> + ; +}; + +&left_encoder { + status = "okay"; +}; diff --git a/config/boards/shields/corny/corny_right.conf b/config/boards/shields/corny/corny_right.conf new file mode 100644 index 0000000..11c5f31 --- /dev/null +++ b/config/boards/shields/corny/corny_right.conf @@ -0,0 +1,4 @@ +CONFIG_NFCT_PINS_AS_GPIOS=y +CONFIG_EC11=y +CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y +CONFIG_ZMK_SLEEP=y diff --git a/config/boards/shields/corny/corny_right.overlay b/config/boards/shields/corny/corny_right.overlay new file mode 100644 index 0000000..b1bd977 --- /dev/null +++ b/config/boards/shields/corny/corny_right.overlay @@ -0,0 +1,20 @@ +#include "corny.dtsi" + +&default_transform { + col-offset = <6>; +}; + +&kscan0 { + col-gpios + = <&xiao_d 6 GPIO_ACTIVE_HIGH> + , <&xiao_d 7 GPIO_ACTIVE_HIGH> + , <&xiao_d 8 GPIO_ACTIVE_HIGH> + , <&xiao_d 10 GPIO_ACTIVE_HIGH> + , <&xiao_d 3 GPIO_ACTIVE_HIGH> + , <&gpio0 10 GPIO_ACTIVE_HIGH> + ; +}; + +&right_encoder { + status = "okay"; +}; diff --git a/config/west.yml b/config/west.yml new file mode 100644 index 0000000..7c42d15 --- /dev/null +++ b/config/west.yml @@ -0,0 +1,16 @@ +manifest: + remotes: + - name: zmkfirmware + url-base: https://github.com/zmkfirmware + - name: caksoylar + url-base: https://github.com/caksoylar + projects: + - name: zmk + remote: zmkfirmware + revision: main + import: app/west.yml + - name: zmk-rgbled-widget + remote: caksoylar + revision: main + self: + path: config