initial add andante shield

This commit is contained in:
jmding8 2021-01-30 19:51:38 -08:00
parent f39121f82e
commit 1fda2188ab
10 changed files with 235 additions and 0 deletions

View file

@ -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

View file

@ -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)

View file

View file

@ -0,0 +1,33 @@
#include <dt-bindings/zmk/matrix_transform.h>
/ {
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>;
};
};

View file

@ -0,0 +1,108 @@
/*
* Copyright (c) 2021 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/keys.h>
#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
>;
};
};
};

View file

@ -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>
;
};

View file

@ -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>
;
};

View file

@ -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