diff --git a/.gitignore b/.gitignore index 93c801d9..e6b187d7 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,6 @@ /zmk-config /build *.DS_Store -__pycache__ \ No newline at end of file +__pycache__ +.ipynb_checkpoints +.gitignore diff --git a/app/boards/shields/bastyl/Kconfig.defconfig b/app/boards/shields/bastyl/Kconfig.defconfig new file mode 100644 index 00000000..70761a30 --- /dev/null +++ b/app/boards/shields/bastyl/Kconfig.defconfig @@ -0,0 +1,28 @@ + +# Copyright (c) 2020 Derek Schmell +# SPDX-License-Identifier: MIT + + +if SHIELD_BASTYL_LEFT + +config ZMK_KEYBOARD_NAME + default "Bastyl Left" + +config ZMK_SPLIT_BLE_ROLE_CENTRAL + default y + +endif + +if SHIELD_BASTYL_RIGHT + +config ZMK_KEYBOARD_NAME + default "Bastyl Right" + +endif + +if SHIELD_BASTYL_LEFT || SHIELD_BASTYL_RIGHT + +config ZMK_SPLIT + default y + +endif diff --git a/app/boards/shields/bastyl/Kconfig.shield b/app/boards/shields/bastyl/Kconfig.shield new file mode 100644 index 00000000..384a10af --- /dev/null +++ b/app/boards/shields/bastyl/Kconfig.shield @@ -0,0 +1,8 @@ +# Copyright (c) 2020 Derek Schmell +# SPDX-License-Identifier: MIT + +config SHIELD_BASTYL_LEFT + def_bool $(shields_list_contains,bastyl_left) + +config SHIELD_BASTYL_RIGHT + def_bool $(shields_list_contains,bastyl_right) diff --git a/app/boards/shields/bastyl/bastyl.conf b/app/boards/shields/bastyl/bastyl.conf new file mode 100644 index 00000000..e69de29b diff --git a/app/boards/shields/bastyl/bastyl.dtsi b/app/boards/shields/bastyl/bastyl.dtsi new file mode 100644 index 00000000..a479bc03 --- /dev/null +++ b/app/boards/shields/bastyl/bastyl.dtsi @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2020 Derek Schmell + * + * SPDX-License-Identifier: MIT + */ + +#include + +/ { + chosen { + zmk,kscan = &kscan0; + zmk,matrix_transform = &default_transform; + }; + + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <12>; + rows = <5>; +// 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(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11) +// 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) RC(3,10) RC(3,11) +// RC(4,0) 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) RC(4,11) +// RC(5,5) RC(5,6) + + 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(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11) +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) RC(3,10) RC(3,11) + RC(4,3) RC(4,4) RC(4,1) RC(4,10) RC(4,7) RC(4,8) + RC(4,5) RC(4,2) RC(4,6) RC(4,9) + >; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + + diode-direction = "row2col"; + row-gpios + = <&pro_micro_d 6 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 9 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 0 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 1 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 10 GPIO_ACTIVE_HIGH> + ; + + }; +}; + diff --git a/app/boards/shields/bastyl/bastyl.keymap b/app/boards/shields/bastyl/bastyl.keymap new file mode 100644 index 00000000..648c73bb --- /dev/null +++ b/app/boards/shields/bastyl/bastyl.keymap @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + + +#include +#include +#include + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { +// ------------------------------------------------------------------------------------------------------------ +// | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BKSP | +// | TAB | Q | W | E | R | T | | Y | U | I | O | P | - | +// | SHIFT | A | S | D | F | G | | H | J | K | L | ; | ' | +// | CTRL | Z | X | C | V | B | | N | M | , | . | / | \ | +// | CTRL | SPCE | LOWER| | RAISE| ENTR | RGUI| +// | HOME | BKSP | | DEL | ALT | + bindings = < +&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp BSPC +&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp MINUS +&kp LSHFT &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT +&kp LCTRL &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp BSLH + &kp LCTRL &kp SPACE &mo 1 &mo 2 &kp ENTER &kp RGUI + &kp HOME &kp BSPC &kp DEL &kp RALT + >; + }; + + lower_layer { +// ------------------------------------------------------------------------------------------------------------ +// | BTCLR | BT1 | BT2 | BT3 | BT4 | BT5 | | | | | | | | +// | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | +// | ` | ! | @ | # | $ | % | | ^ | & | * | ( | ) | ~ | +// | | | | | | | | | | | _ | + | { | } | "|" | +// | | | | | | | | | | + bindings = < +&kp TILDE &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp STAR &kp LPAR &kp RPAR &kp DEL +&reset &trans &trans &trans &trans &kp LBKT &kp RBKT &kp KP_N7 &kp KP_N8 &kp N9 &trans &kp PLUS +&trans &kp HOME &kp PG_UP &kp PG_DN &kp END &kp LPAR &kp RPAR &kp KP_N4 &kp KP_N5 &kp KP_N6 &kp KP_MINUS &kp PIPE +&trans &trans &trans &trans &trans &trans &trans &kp KP_N1 &kp KP_N2 &kp KP_N3 &kp KP_EQUAL &kp UNDER + &kp LCTRL &kp SPACE &trans &trans &kp ENTER &kp RGUI + &kp HOME &kp BSPC &kp DEL &kp RALT + >; + }; + + raise_layer { +// ------------------------------------------------------------------------------------------------------------ +// | BTCLR | BT1 | BT2 | BT3 | BT4 | BT5 | | | | | | | | +// | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | +// | ` | ! | @ | # | $ | % | | ^ | & | * | ( | ) | ~ | +// | | | | | | | | | | | _ | + | { | } | "|" | +// | | | | | | | | | | + bindings = < +&kp F12 &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 +&trans &trans &trans &trans &trans &kp LBKT &kp RBKT &trans &kp LNLCK &kp INS &kp SLCK &kp K_MUTE +&trans &kp LEFT &kp UP &kp DOWN &kp RIGHT &kp LPAR &kp RPAR &kp K_PREV &kp C_PLAY &kp K_NEXT &trans &kp K_VOL_UP +&bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &trans &trans &trans &trans &trans &kp K_VOL_DN + &kp LCTRL &kp SPACE &trans &trans &kp ENTER &kp RGUI + &kp HOME &kp BSPC &kp DEL &kp RALT + >; + }; + }; +}; diff --git a/app/boards/shields/bastyl/bastyl_left.conf b/app/boards/shields/bastyl/bastyl_left.conf new file mode 100644 index 00000000..e69de29b diff --git a/app/boards/shields/bastyl/bastyl_left.overlay b/app/boards/shields/bastyl/bastyl_left.overlay new file mode 100644 index 00000000..6bac1cdb --- /dev/null +++ b/app/boards/shields/bastyl/bastyl_left.overlay @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2020 Derek Schmell + * + * SPDX-License-Identifier: MIT + */ + +#include "bastyl.dtsi" + +&kscan0 { + col-gpios + = <&pro_micro_d 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; +}; diff --git a/app/boards/shields/bastyl/bastyl_right.conf b/app/boards/shields/bastyl/bastyl_right.conf new file mode 100644 index 00000000..e69de29b diff --git a/app/boards/shields/bastyl/bastyl_right.overlay b/app/boards/shields/bastyl/bastyl_right.overlay new file mode 100644 index 00000000..dd2b9242 --- /dev/null +++ b/app/boards/shields/bastyl/bastyl_right.overlay @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 Derek Schmell + * + * SPDX-License-Identifier: MIT + */ + +#include "bastyl.dtsi" + +&default_transform { + col-offset = <6>; +}; + +&kscan0 { + col-gpios + = <&pro_micro_d 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; +};