initial commit

This commit is contained in:
Glen Goodwin 2022-01-05 14:18:26 -05:00
commit 34e3e2b2ff
12 changed files with 312 additions and 0 deletions

View file

@ -0,0 +1,12 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
if SHIELD_HUMMINGBIRD
config ZMK_KEYBOARD_NAME
default "Hummingbird"
config ZMK_USB
default y
endif

View file

@ -0,0 +1,5 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
config SHIELD_HUMMINGBIRD
def_bool $(shields_list_contains,hummingbird)

View file

@ -0,0 +1,4 @@
CONFIG_CONSOLE=n
CONFIG_UART_CONSOLE=n
CONFIG_UART_INTERRUPT_DRIVEN=n
CONFIG_SERIAL=n

View file

@ -0,0 +1 @@

View file

@ -0,0 +1,160 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
/* Layers */
#define DEF_L 0
#define NAV_L 1
#define UPP_L 2
#define SYM_L 3
#define NUM_L 4
/* Behavior Settings */
&caps_word {
continue-list = <UNDERSCORE MINUS BACKSPACE>;
};
&sk {
release-after-ms = <60000>;
};
/ {
behaviors {
// A hold-tap that activates without delay (like `&mo`)
mo_tap: mo_with_tap {
compatible = "zmk,behavior-hold-tap";
label = "MO_WITH_TAP";
#binding-cells = <2>;
tapping_term_ms = <0>;
retro-tap;
flavor = "hold-preferred";
bindings = <&mo>, <&kp>;
};
#define MO(LAYER) &mo_tap LAYER F24
};
combos {
compatible = "zmk,combos";
#define COMBO(NAME, BINDINGS, KEYPOS, LAYERS) \
combo_##NAME { \
bindings = <BINDINGS>; \
key-positions = <KEYPOS>; \
layers = <LAYERS>; \
};
/* KEY POSITIONS
╭────────────────────╮ ╭────────────────────╮
│ 0 1 2 3 4 │ │ 5 6 7 8 9 │
│ 10 11 12 13 14 │ │ 15 16 17 18 19 │
│ 20 21 22 │ │ 23 24 25 │
╰───────────╮ 26 27 │ │ 28 29 ╭───────────╯
╰────────╯ ╰────────╯ */
/* Letters */
COMBO(lower_v, &kp V, 1 2, DEF_L)
COMBO(lower_q, &kp Q, 1 3, DEF_L)
COMBO(lower_z, &kp Z, 20 21, DEF_L)
COMBO(upper_v, &kp LS(V), 1 2, UPP_L)
COMBO(upper_q, &kp LS(Q), 1 3, UPP_L)
COMBO(upper_z, &kp LS(Z), 20 21, UPP_L)
/* Brackets */
COMBO(left_bracket, &kp LBKT, 1 11, DEF_L UPP_L SYM_L NUM_L)
COMBO(right_bracket, &kp RBKT, 8 18, DEF_L UPP_L SYM_L NUM_L)
COMBO(left_parenthesis, &kp LPAR, 2 12, DEF_L UPP_L SYM_L NUM_L)
COMBO(right_parenthesis, &kp RPAR, 7 17, DEF_L UPP_L SYM_L NUM_L)
COMBO(left_brace, &kp LBRC, 3 13, DEF_L UPP_L SYM_L NUM_L)
COMBO(right_brace, &kp RBRC, 6 16, DEF_L UPP_L SYM_L NUM_L)
/* Convenience */
COMBO(esc, &kp ESC, 3 4, DEF_L)
COMBO(del, &kp DEL, 13 14, DEF_L)
COMBO(select_all, &kp LC(A), 20 21, NAV_L)
};
conditional_layers {
compatible = "zmk,conditional-layers";
tri_layer {
if-layers = <UPP_L SYM_L>;
then-layer = <NUM_L>;
};
};
keymap {
compatible = "zmk,keymap";
default_layer {
bindings = <
// ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
&kp J &kp P &kp U &kp O &kp K &kp B &kp D &kp R &kp F &kp H
&kp W &kp I &kp E &kp A &kp DOT &kp D &kp T &kp N &kp S &kp X
&kp Y &kp QUOT &kp COMMA &kp M &kp L &kp C
// ╰─────────────┴─────────────┴─────────────╮ ╭─────────────┴─────────────┴─────────────╯
MO(NAV_L) &kp SPACE MO(UPP_L) MO(SYM_L)
// ╰─────────────┴─────────────╯ ╰─────────────┴─────────────╯
>;
};
nav_layer {
label = "Nav";
bindings = <
// ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
&kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp PG_UP &kp HOME &kp UARW &kp END &caps_word
&sk LGUI &sk LALT &sk LSHFT &sk LCTRL &kp LC(Z) &kp PG_DN &kp LARW &kp ENTER &kp RARW &kp ESC
&kp LC(X) &kp LC(C) &kp LC(V) &kp TAB &kp DARW &key_repeat
// ╰─────────────┴─────────────┴─────────────╮ ╭─────────────┴─────────────┴─────────────╯
&trans &trans &kp BSPC &kp DEL
// ╰─────────────┴─────────────╯ ╰─────────────┴─────────────╯
>;
};
upper_layer {
label = "Upp";
bindings = <
// ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
&kp LS(W) &kp LS(F) &kp LS(M) &kp LS(P) &kp LS(G) &kp LS(K) &kp LS(U) &kp LS(O) &kp LS(Y) &kp DQT
&kp LS(R) &kp LS(S) &kp LS(N) &kp LS(T) &kp LS(B) &kp LS(J) &kp LS(A) &kp LS(E) &kp LS(I) &kp LS(H)
&kp LS(C) &kp LS(L) &kp LS(D) &kp LS(X) &kp LT &kp GT
// ╰─────────────┴─────────────┴─────────────╮ ╭─────────────┴─────────────┴─────────────╯
&trans &kp LS(SPACE) &trans &trans
// ╰─────────────┴─────────────╯ ╰─────────────┴─────────────╯
>;
};
sym_layer {
label = "Sym";
bindings = <
// ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
&kp EXCL &kp AT &kp POUND &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp SEMI &kp COLON &kp DQT
&kp MINUS &kp PLUS &kp EQUAL &kp ASTRK &kp FSLH &kp BSLH &sk LCTRL &sk LSHFT &sk LALT &sk LGUI
&kp TILDE &kp GRAVE &kp QMARK &kp PIPE &kp LT &kp GT
// ╰─────────────┴─────────────┴─────────────╮ ╭─────────────┴─────────────┴─────────────╯
&trans &kp UNDER &trans &trans
// ╰─────────────┴─────────────╯ ╰─────────────┴─────────────╯
>;
};
num_layer {
label = "Num";
bindings = <
// ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
&none &kp N7 &kp N8 &kp N9 &none &kp F6 &kp F7 &kp F8 &kp F9 &kp F10
&kp MINUS &kp N4 &kp N5 &kp N6 &kp SLASH &kp F11 &sk LCTRL &sk LSHFT &sk LALT &sk LGUI
&kp N1 &kp N2 &kp N3 &kp F12 &kp COMMA &kp DOT
// ╰─────────────┴─────────────┴─────────────╮ ╭─────────────┴─────────────┴─────────────╯
&trans &kp N0 &trans &trans
// ╰─────────────┴─────────────╯ ╰─────────────┴─────────────╯
>;
};
};
};

View file

@ -0,0 +1,56 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/matrix_transform.h>
/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
/delete-property/ zephyr,console;
/delete-property/ zephyr,shell-uart;
};
default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <7>;
rows = <6>;
map = <
RC(0,0) RC(1,0) RC(0,1) RC(1,1) RC(0,2) RC(1,2) RC(0,3) RC(1,3) RC(0,4) RC(1,4)
RC(2,0) RC(3,0) RC(2,1) RC(3,1) RC(2,2) RC(3,2) RC(2,3) RC(3,3) RC(2,4) RC(3,4)
RC(4,0) RC(5,0) RC(4,1) RC(5,2) RC(4,3) RC(5,3)
RC(5,1) RC(4,2) RC(5,4) RC(4,4)
>;
};
kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "row2col";
col-gpios
= <&portb 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&portb 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&porta 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&porta 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&porta 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
row-gpios
= <&porta 2 GPIO_ACTIVE_HIGH>
, <&porta 4 GPIO_ACTIVE_HIGH>
, <&porta 10 GPIO_ACTIVE_HIGH>
, <&porta 11 GPIO_ACTIVE_HIGH>
, <&porta 8 GPIO_ACTIVE_HIGH>
, <&porta 9 GPIO_ACTIVE_HIGH>
;
};
};
&sercom0 { status = "disabled"; };
&sercom4 { status = "disabled"; };