From 1fda2188ab7cbc173de0af113f20dc6ee1df5d38 Mon Sep 17 00:00:00 2001 From: jmding8 <44815547+jmding8@users.noreply.github.com> Date: Sat, 30 Jan 2021 19:51:38 -0800 Subject: [PATCH] initial add andante shield --- app/boards/shields/andante/Kconfig.defconfig | 28 +++++ app/boards/shields/andante/Kconfig.shield | 8 ++ app/boards/shields/andante/andante.conf | 0 app/boards/shields/andante/andante.dtsi | 33 ++++++ app/boards/shields/andante/andante.keymap | 108 ++++++++++++++++++ app/boards/shields/andante/andante_left.conf | 0 .../shields/andante/andante_left.overlay | 25 ++++ app/boards/shields/andante/andante_right.conf | 0 .../shields/andante/andante_right.overlay | 29 +++++ app/boards/shields/andante/readme.txt | 4 + 10 files changed, 235 insertions(+) create mode 100644 app/boards/shields/andante/Kconfig.defconfig create mode 100644 app/boards/shields/andante/Kconfig.shield create mode 100644 app/boards/shields/andante/andante.conf create mode 100644 app/boards/shields/andante/andante.dtsi create mode 100644 app/boards/shields/andante/andante.keymap create mode 100644 app/boards/shields/andante/andante_left.conf create mode 100644 app/boards/shields/andante/andante_left.overlay create mode 100644 app/boards/shields/andante/andante_right.conf create mode 100644 app/boards/shields/andante/andante_right.overlay create mode 100644 app/boards/shields/andante/readme.txt diff --git a/app/boards/shields/andante/Kconfig.defconfig b/app/boards/shields/andante/Kconfig.defconfig new file mode 100644 index 00000000..25aff723 --- /dev/null +++ b/app/boards/shields/andante/Kconfig.defconfig @@ -0,0 +1,28 @@ +# Copyright (c) 2021 The ZMK Contributors +# SPDX-License-Identifier: MIT + +if SHIELD_ANDANTE_LEFT + +config ZMK_KEYBOARD_NAME + default "Andante-L" + +config ZMK_SPLIT_BLE_ROLE_CENTRAL + default y + +endif + + +if SHIELD_ANDANTE_RIGHT + +config ZMK_KEYBOARD_NAME + default "Andante-R" + +endif + + +if SHIELD_ANDANTE_LEFT || SHIELD_ANDANTE_RIGHT + +config ZMK_SPLIT + default y + +endif \ No newline at end of file diff --git a/app/boards/shields/andante/Kconfig.shield b/app/boards/shields/andante/Kconfig.shield new file mode 100644 index 00000000..1a05f588 --- /dev/null +++ b/app/boards/shields/andante/Kconfig.shield @@ -0,0 +1,8 @@ +# Copyright (c) 2021 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config SHIELD_ANDANTE_LEFT + def_bool $(shields_list_contains,andante_left) + +config SHIELD_ANDANTE_RIGHT + def_bool $(shields_list_contains,andante_right) diff --git a/app/boards/shields/andante/andante.conf b/app/boards/shields/andante/andante.conf new file mode 100644 index 00000000..e69de29b diff --git a/app/boards/shields/andante/andante.dtsi b/app/boards/shields/andante/andante.dtsi new file mode 100644 index 00000000..0076467c --- /dev/null +++ b/app/boards/shields/andante/andante.dtsi @@ -0,0 +1,33 @@ +#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 | | 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(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11) + RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) + >; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + diode-direction = "col2row"; + debounce-period = <5>; + }; +}; + + diff --git a/app/boards/shields/andante/andante.keymap b/app/boards/shields/andante/andante.keymap new file mode 100644 index 00000000..6f774c4a --- /dev/null +++ b/app/boards/shields/andante/andante.keymap @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2021 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include + +#define APL 0 +#define WIN 1 +#define NUM 2 +#define FUN 3 +#define NAV 4 +#define MED 5 +#define SYS 6 + +/ { + behaviors { + hlt: hold_preferred_layer_tap { + compatible = "zmk,behavior-hold-tap"; + label = "HOLD_PREFERRED_LAYER_TAP"; + #binding-cells = <2>; + flavor = "hold-preferred"; + tapping_term_ms = <200>; + bindings = <&mo>, <&kp>; + }; + + tmt: tap_preferred_mod_tap { + compatible = "zmk,behavior-hold-tap"; + label = "TAP_PREFERRED_MOD_TAP"; + #binding-cells = <2>; + flavor = "tap-preferred"; + tapping_term_ms = <200>; + bindings = <&kp>, <&kp>; + }; + }; + + + keymap { + compatible = "zmk,keymap"; + + apple_layer { + bindings = < + &hlt FUN TAB &kp Q &kp W &kp E &kp R &kp T /**/ &kp Y &kp U &kp I &kp O &kp P &kp BKSP + &hlt NUM ESC &kp A &kp S &kp D &kp F &kp G /**/ &kp H &kp J &kp K &kp L &kp SCLN &kp QUOT + &kp LSFT &kp Z &kp X &kp C &kp V &kp B /**/ &kp N &kp M &kp CMMA &kp DOT &tmt RALT FSLH &mt RSFT BSLH + &kp LCTL &kp LALT &kp LGUI /**/ &kp SPC &hlt NAV RET &hlt MED DEL + >; + }; + + windows_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 + &kp LGUI &kp LALT &mt LCTL K_CMENU /**/ &trans &trans &trans + >; + }; + + num_layer { + bindings = < + &mo SYS &trans &trans &trans &trans &trans /**/ &trans &kp NUM_7 &kp NUM_8 &kp NUM_9 &trans &trans + &trans &kp LSFT &trans &kp GRAV &kp TILDE &trans /**/ &kp EQL &kp NUM_4 &kp NUM_5 &kp NUM_6 &kp LBKT &kp RBKT + &trans &trans &trans &trans &trans &trans /**/ &kp MINUS &kp NUM_1 &kp NUM_2 &kp NUM_3 &trans &trans + &trans &trans &trans /**/ &trans &kp NUM_0 &trans + >; + }; + + function_layer { + bindings = < + &trans &kp LSFT &trans &trans &trans &trans /**/ &kp F12 &kp F7 &kp F8 &kp F9 &trans &trans + &mo SYS &trans &trans &trans &trans &trans /**/ &kp F11 &kp F4 &kp F5 &kp F6 &kp LBRC &kp RBRC + &trans &trans &trans &trans &trans &trans /**/ &kp F10 &kp F1 &kp F2 &kp F3 &trans &trans + &trans &trans &trans /**/ &trans &trans &trans + >; + }; + + nav_layer { + bindings = < + &trans &trans &trans &trans &trans &trans /**/ &trans &trans &kp UARW &kp PGUP &kp PRSC &trans + &trans &trans &kp SLCK &trans &trans &trans /**/ &trans &kp LARW &kp DARW &kp RARW &trans &trans + &trans &trans &trans &kp CLCK &trans &kp PAUSE_BREAK /**/ &kp INS &kp PGDN &kp HOME &kp END &trans &trans + &trans &trans &trans /**/ &trans &trans &trans + >; + }; + + media_layer { + bindings = < + &trans &trans &to WIN &trans &trans &trans /**/ &trans &trans &kp C_VOL_UP &trans &trans &trans + &trans &to APL &trans &trans &trans &trans /**/ &trans &kp C_BRI_DN &kp C_VOL_DN &kp C_BRI_UP &trans &trans + &trans &trans &trans &trans &trans &trans /**/ &trans &kp C_MUTE &trans &trans &trans &trans + &trans &trans &trans /**/ &trans &trans &trans + >; + }; + + system_layer { + bindings = < + &trans &trans &to WIN &trans &reset &trans /**/ &trans &trans &trans &trans &trans &trans + &trans &to APL &trans &trans &bootloader &trans /**/ &trans &trans &trans &trans &trans &trans + &trans &trans &trans &bt BT_CLR &trans &trans /**/ &trans &trans &trans &trans &trans &trans + &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 /**/ &trans &trans &trans + + >; + }; + }; +}; diff --git a/app/boards/shields/andante/andante_left.conf b/app/boards/shields/andante/andante_left.conf new file mode 100644 index 00000000..e69de29b diff --git a/app/boards/shields/andante/andante_left.overlay b/app/boards/shields/andante/andante_left.overlay new file mode 100644 index 00000000..17180cec --- /dev/null +++ b/app/boards/shields/andante/andante_left.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include "andante.dtsi" + +&kscan0 { + row-gpios + = <&pro_micro_d 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + + col-gpios + = <&pro_micro_a 3 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 2 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 1 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 0 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 15 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 14 GPIO_ACTIVE_HIGH> + ; +}; \ No newline at end of file diff --git a/app/boards/shields/andante/andante_right.conf b/app/boards/shields/andante/andante_right.conf new file mode 100644 index 00000000..e69de29b diff --git a/app/boards/shields/andante/andante_right.overlay b/app/boards/shields/andante/andante_right.overlay new file mode 100644 index 00000000..bd6bc96f --- /dev/null +++ b/app/boards/shields/andante/andante_right.overlay @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2021 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include "andante.dtsi" + +&default_transform { + col-offset = <6>; +}; + +&kscan0 { + row-gpios + = <&pro_micro_d 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_a 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + + col-gpios + = <&pro_micro_d 10 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 9 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 8 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 7 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 6 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 5 GPIO_ACTIVE_HIGH> + ; +}; \ No newline at end of file diff --git a/app/boards/shields/andante/readme.txt b/app/boards/shields/andante/readme.txt new file mode 100644 index 00000000..587ff36a --- /dev/null +++ b/app/boards/shields/andante/readme.txt @@ -0,0 +1,4 @@ +from Windows CMD: +cd zmk\app +west build -d build/left -p -b nice_nano -- -DSHIELD=andante_left +west build -d build/right -p -b nice_nano -- -DSHIELD=andante_right \ No newline at end of file