aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Sangdahl <[email protected]>2024-02-25 01:34:55 -0700
committerJack Sangdahl <[email protected]>2024-02-25 01:34:55 -0700
commit22004dc2c7b090f1f07bf47f114cef730a05a50b (patch)
treefd053f773d5b958ca293a862c47371f5def35fd2
parent9d61a1f55ff211b196c21922803011901455bec2 (diff)
downloadzmk_build-22004dc2c7b090f1f07bf47f114cef730a05a50b.tar.gz
zmk_build-22004dc2c7b090f1f07bf47f114cef730a05a50b.zip
revxlp fixup & misc
-rwxr-xr-xbuild.sh14
-rw-r--r--config/corne.keymap49
-rw-r--r--config/revxlp.conf1
-rw-r--r--config/revxlp.keymap49
-rw-r--r--config/splitkb_aurora_sweep.keymap41
-rw-r--r--config/user.dtsi52
-rw-r--r--config/util.h34
-rw-r--r--readme.md2
-rw-r--r--revxlp/boards/seeeduino_xiao.conf2
-rw-r--r--revxlp/boards/seeeduino_xiao_ble.overlay14
-rw-r--r--revxlp/revxlp.keymap149
-rw-r--r--revxlp/revxlp.overlay2
12 files changed, 249 insertions, 160 deletions
diff --git a/build.sh b/build.sh
index 1633b15..749007c 100755
--- a/build.sh
+++ b/build.sh
@@ -1,26 +1,28 @@
#!/bin/sh
-ZMK_DIR=~/waffle_git/zmk
+ZMK_DIR=~/git/zmk
RED=$(tput setaf 1)
-YELLOW=$(tput setaf 3)
GREEN=$(tput setaf 2)
+YELLOW=$(tput setaf 3)
BLUE=$(tput setaf 4)
BOLD=$(tput bold)
NORMAL=$(tput sgr0)
source $ZMK_DIR/.venv/bin/activate
+set -e
build() {
- printf "building $GREEN$1$NORMAL for $BLUE$2$NORMAL...\n"
+ printf "building ${GREEN}$1${NORMAL} for $BLUE$2$NORMAL...\n"
(cd $ZMK_DIR/app
west build -p always -b $2 -- -DSHIELD=$1 \
- -DZMK_CONFIG="$HOME/waffle_git/zmk-build/config" \
+ -DZMK_CONFIG="$HOME/git/zmk-build/config" \
&> /dev/null
-
read -p "${BOLD}flash? (y/n) $NORMAL" yn
case $yn in
[Yy]*)
printf "${YELLOW}enter bootloader$NORMAL...\n"
sleep 5
- west flash
+ doas mount /dev/sdb ~/.local/Media
+ west flash &> /dev/null
+ doas umount /dev/sdb
;;
[Nn]*) cp build/zephyr/zmk.uf2 ~/$1.uf2 ;;
* ) printf "${RED}invalid entry$NORMAL\n" ;;
diff --git a/config/corne.keymap b/config/corne.keymap
index 9c1ea89..91140e8 100644
--- a/config/corne.keymap
+++ b/config/corne.keymap
@@ -1,14 +1,11 @@
-// Copyright 2022 jack (@waffle87)
+// Copyright 2024 jack (@waffle87)
// SPDX-License-Identifier: MIT
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include "util.h"
-
-&lt {
- tapping-term-ms = <100>;
-};
+#include "user.dtsi"
/ {
keymap {
@@ -39,48 +36,6 @@
};
};
- behaviors {
- hm: homerow_mods {
- compatible = "zmk,behavior-hold-tap";
- label = "HOMEROW_MODS";
- #binding-cells = <2>;
- tapping-term-ms = <130>;
- quick-tap-ms = <160>;
- flavor = "tap-preferred";
- bindings = <&kp>, <&kp>;
- };
-
- pnp: play_next_prev {
- compatible = "zmk,behavior-tap-dance";
- label = "PLAY_NEXT_PREV";
- #binding-cells = <0>;
- tapping-term-ms = <210>;
- bindings = <&kp C_PLAY>, <&kp C_NEXT>, <&kp C_PREV>;
- };
- TAP_DANCE(bsls_pipe, &kp BSLH, &kp PIPE)
- TAP_DANCE(quot_dquo, &kp SQT, &kp DQT)
- TAP_DANCE(cbrkt, &kp LBRC, &kp RBRC)
- TAP_DANCE(brkt, &kp LBKT, &kp RBKT)
- TAP_DANCE(min_dash, &kp MINUS, &emdash)
- };
-
- macros {
- updir: updir {
- label = "UP_DIR";
- compatible = "zmk,behavior-macro";
- #binding-cells = <0>;
- bindings = <&macro_tap &kp DOT &kp DOT &kp FSLH>;
- };
- emdash: emdash {
- label = "EM_DASH";
- compatible = "zmk,behavior-macro";
- #binding-cells = <0>;
- bindings = <&macro_press &kp LSHFT &kp LCTRL>,
- <&macro_tap &kp U &kp N2 &kp N0 &kp N1 &kp N4>,
- <&macro_release &kp LSHFT &kp LCTRL>;
- };
- };
-
combos {
compatible = "zmk,combos";
// name output pos.
diff --git a/config/revxlp.conf b/config/revxlp.conf
index dfa521c..d85021a 100644
--- a/config/revxlp.conf
+++ b/config/revxlp.conf
@@ -1 +1,2 @@
CONFIG_ZMK_SLEEP=y
+CONFIG_ZMK_USB_LOGGING=n
diff --git a/config/revxlp.keymap b/config/revxlp.keymap
index 9c1ea89..91140e8 100644
--- a/config/revxlp.keymap
+++ b/config/revxlp.keymap
@@ -1,14 +1,11 @@
-// Copyright 2022 jack (@waffle87)
+// Copyright 2024 jack (@waffle87)
// SPDX-License-Identifier: MIT
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include "util.h"
-
-&lt {
- tapping-term-ms = <100>;
-};
+#include "user.dtsi"
/ {
keymap {
@@ -39,48 +36,6 @@
};
};
- behaviors {
- hm: homerow_mods {
- compatible = "zmk,behavior-hold-tap";
- label = "HOMEROW_MODS";
- #binding-cells = <2>;
- tapping-term-ms = <130>;
- quick-tap-ms = <160>;
- flavor = "tap-preferred";
- bindings = <&kp>, <&kp>;
- };
-
- pnp: play_next_prev {
- compatible = "zmk,behavior-tap-dance";
- label = "PLAY_NEXT_PREV";
- #binding-cells = <0>;
- tapping-term-ms = <210>;
- bindings = <&kp C_PLAY>, <&kp C_NEXT>, <&kp C_PREV>;
- };
- TAP_DANCE(bsls_pipe, &kp BSLH, &kp PIPE)
- TAP_DANCE(quot_dquo, &kp SQT, &kp DQT)
- TAP_DANCE(cbrkt, &kp LBRC, &kp RBRC)
- TAP_DANCE(brkt, &kp LBKT, &kp RBKT)
- TAP_DANCE(min_dash, &kp MINUS, &emdash)
- };
-
- macros {
- updir: updir {
- label = "UP_DIR";
- compatible = "zmk,behavior-macro";
- #binding-cells = <0>;
- bindings = <&macro_tap &kp DOT &kp DOT &kp FSLH>;
- };
- emdash: emdash {
- label = "EM_DASH";
- compatible = "zmk,behavior-macro";
- #binding-cells = <0>;
- bindings = <&macro_press &kp LSHFT &kp LCTRL>,
- <&macro_tap &kp U &kp N2 &kp N0 &kp N1 &kp N4>,
- <&macro_release &kp LSHFT &kp LCTRL>;
- };
- };
-
combos {
compatible = "zmk,combos";
// name output pos.
diff --git a/config/splitkb_aurora_sweep.keymap b/config/splitkb_aurora_sweep.keymap
index 720ffb1..9e7600c 100644
--- a/config/splitkb_aurora_sweep.keymap
+++ b/config/splitkb_aurora_sweep.keymap
@@ -1,14 +1,11 @@
-// Copyright 2022 jack (@waffle87)
+// Copyright 2024 jack (@waffle87)
// SPDX-License-Identifier: MIT
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include "util.h"
-
-&lt {
- tapping-term-ms = <100>;
-};
+#include "user.dtsi"
/ {
keymap {
@@ -38,39 +35,7 @@
>;
};
};
- macros {
- emdash: emdash {
- label = "EM_DASH";
- compatible = "zmk,behavior-macro";
- #binding-cells = <0>;
- bindings = <&macro_press &kp LSHFT &kp LCTRL>,
- <&macro_tap &kp U &kp N2 &kp N0 &kp N1 &kp N4>,
- <&macro_release &kp LSHFT &kp LCTRL>;
- };
- };
- behaviors {
- hm: homerow_mods {
- compatible = "zmk,behavior-hold-tap";
- label = "HOMEROW_MODS";
- #binding-cells = <2>;
- tapping-term-ms = <130>;
- quick-tap-ms = <160>;
- flavor = "tap-preferred";
- bindings = <&kp>, <&kp>;
- };
- pnp: play_next_prev {
- compatible = "zmk,behavior-tap-dance";
- label = "PLAY_NEXT_PREV";
- #binding-cells = <0>;
- tapping-term-ms = <210>;
- bindings = <&kp C_PLAY>, <&kp C_NEXT>, <&kp C_PREV>;
- };
- TAP_DANCE(bsls_pipe, &kp BSLH, &kp PIPE)
- TAP_DANCE(quot_dquo, &kp SQT, &kp DQT)
- TAP_DANCE(cbrkt, &kp LBRC, &kp RBRC)
- TAP_DANCE(brkt, &kp LBKT, &kp RBKT)
- TAP_DANCE(min_dash, &kp MINUS, &emdash)
- };
+
combos {
compatible = "zmk,combos";
// name output pos.
diff --git a/config/user.dtsi b/config/user.dtsi
new file mode 100644
index 0000000..8496d07
--- /dev/null
+++ b/config/user.dtsi
@@ -0,0 +1,52 @@
+// Copyright 2024 jack (@waffle87)
+// SPDX-License-Identifier: MIT
+
+&lt {
+ tapping-term-ms = <100>;
+};
+
+\ {
+ behaviors {
+ hm: homerow_mods {
+ compatible = "zmk,behavior-hold-tap";
+ label = "HOMEROW_MODS";
+ #binding-cells = <2>;
+ tapping-term-ms = <130>;
+ quick-tap-ms = <160>;
+ flavor = "tap-preferred";
+ bindings = <&kp>, <&kp>;
+ };
+
+ pnp: play_next_prev {
+ compatible = "zmk,behavior-tap-dance";
+ label = "PLAY_NEXT_PREV";
+ #binding-cells = <0>;
+ tapping-term-ms = <210>;
+ bindings = <&kp C_PLAY>, <&kp C_NEXT>, <&kp C_PREV>;
+ };
+ TAP_DANCE(bsls_pipe, &kp BSLH, &kp PIPE)
+ TAP_DANCE(quot_dquo, &kp SQT, &kp DQT)
+ TAP_DANCE(cbrkt, &kp LBRC, &kp RBRC)
+ TAP_DANCE(brkt, &kp LBKT, &kp RBKT)
+ TAP_DANCE(min_dash, &kp MINUS, &emdash)
+ };
+
+ macros {
+ updir: updir {
+ label = "UP_DIR";
+ compatible = "zmk,behavior-macro";
+ #binding-cells = <0>;
+ bindings = <&macro_tap &kp DOT &kp DOT &kp FSLH>;
+ };
+ emdash: emdash {
+ label = "EM_DASH";
+ compatible = "zmk,behavior-macro";
+ #binding-cells = <0>;
+ bindings = <&macro_press &kp LSHFT &kp LCTRL>,
+ <&macro_tap &kp U &kp N2 &kp N0 &kp N1 &kp N4>,
+ <&macro_release &kp LSHFT &kp LCTRL>;
+ };
+ };
+
+
+}
diff --git a/config/util.h b/config/util.h
index e8b33a9..b6fe42a 100644
--- a/config/util.h
+++ b/config/util.h
@@ -1,21 +1,21 @@
-// Copyright 2022 jack (@waffle87)
+// Copyright 2024 jack (@waffle87)
// SPDX-License-Identifier: MIT
-#define COMBO(name, keypress, keypos) \
-combo_##name { \
- timeout-ms = <50>; \
- bindings = <keypress>; \
- key-positions = <keypos>; \
-};
+#define COMBO(name, keypress, keypos) \
+ combo_##name { \
+ timeout - ms = <50>; \
+ bindings = <keypress>; \
+ key - positions = <keypos>; \
+ };
-#define TAP_DANCE(name, keypress1, keypress2) \
-td_##name: name { \
- compatible = "zmk,behavior-tap-dance"; \
- label = ###name; \
- #binding-cells = <0>; \
- tapping-term-ms = <200>; \
- bindings = <keypress1>, <keypress2>; \
-};
+#define TAP_DANCE(name, keypress1, keypress2) \
+ td_##name : name { \
+ compatible = "zmk,behavior-tap-dance"; \
+ label = ## #name; \
+ #binding - cells = <0>; \
+ tapping - term - ms = <200>; \
+ bindings = <keypress1>, <keypress2>; \
+ };
-#define HRML(k1,k2,k3,k4) &hm LALT k1 &hm LGUI k2 &hm LCTRL k3 &hm LSHFT k4
-#define HRMR(k1,k2,k3,k4) &hm RSHFT k1 &hm RCTRL k2 &hm RGUI k3 &hm RALT k4
+#define HRML(k1, k2, k3, k4) &hm LALT k1 &hm LGUI k2 &hm LCTRL k3 &hm LSHFT k4
+#define HRMR(k1, k2, k3, k4) &hm RSHFT k1 &hm RCTRL k2 &hm RGUI k3 &hm RALT k4
diff --git a/readme.md b/readme.md
index 06d6703..4d2a569 100644
--- a/readme.md
+++ b/readme.md
@@ -1,7 +1,7 @@
### zmk build repository
my [zmk](https://zmk.dev) configuration & keyboard code
-![keyboard](https://i.imgur.com/bCRPsDyh.jpg)
+![revxlp](https://i.imgur.com/bCRPsDyh.jpg)
### misc
* [`util.h`](util.h) contains some simple c macros for combos, 2-key tap dance, & home-row mods.
diff --git a/revxlp/boards/seeeduino_xiao.conf b/revxlp/boards/seeeduino_xiao.conf
new file mode 100644
index 0000000..81b8cd7
--- /dev/null
+++ b/revxlp/boards/seeeduino_xiao.conf
@@ -0,0 +1,2 @@
+CONFIG_SPI=y
+CONFIG_ZMK_KSCAN_MATRIX_POLLING=y
diff --git a/revxlp/boards/seeeduino_xiao_ble.overlay b/revxlp/boards/seeeduino_xiao_ble.overlay
index 5cd88ae..5b37ffb 100644
--- a/revxlp/boards/seeeduino_xiao_ble.overlay
+++ b/revxlp/boards/seeeduino_xiao_ble.overlay
@@ -1,3 +1,13 @@
-&xiao_spi {
- miso-pin = <6>;
+&spi2_default {
+ group1 {
+ psels = <NRF_PSEL(SPIM_SCK, 1, 13)>,
+ <NRF_PSEL(SPIM_MOSI, 1, 15)>;
+ };
+};
+
+&spi2_sleep {
+ group1 {
+ psels = <NRF_PSEL(SPIM_SCK, 1, 13)>,
+ <NRF_PSEL(SPIM_MOSI, 1, 15)>;
+ };
};
diff --git a/revxlp/revxlp.keymap b/revxlp/revxlp.keymap
new file mode 100644
index 0000000..e22fd49
--- /dev/null
+++ b/revxlp/revxlp.keymap
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2024 The ZMK Contributors
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#include <behaviors.dtsi>
+#include <dt-bindings/zmk/keys.h>
+#include <dt-bindings/zmk/bt.h>
+#include <dt-bindings/zmk/backlight.h>
+
+#define NAV_L 1
+#define NUM_L 2
+#define MED_L 3
+#define FUN_L 4
+
+/ {
+ tap_dances {
+ shifty: shift_caps_word {
+ compatible = "zmk,behavior-tap-dance";
+ #binding-cells = <0>;
+ tapping-term-ms = <150>;
+ bindings = <&kp LSHFT>, <&caps_word>;
+ };
+ };
+
+ cond_layers {
+ compatible = "zmk,conditional-layers";
+ tri {
+ if-layers = <NUM_L NAV_L>;
+ then-layer = <MED_L>;
+ };
+ };
+
+ combos {
+ compatible = "zmk,combos";
+
+ l_curly_bracket {
+ timeout-ms = <50>;
+ key-positions = <2 14>;
+ bindings = <&kp LS(LBKT)>;
+ layers = <NUM_L>;
+ };
+
+ r_curly_bracket {
+ timeout-ms = <50>;
+ key-positions = <4 16>;
+ bindings = <&kp LS(RBKT)>;
+ layers = <NUM_L>;
+ };
+
+ lbracket {
+ timeout-ms = <50>;
+ key-positions = <14 26>;
+ bindings = <&kp LBKT>;
+ layers = <NUM_L>;
+ };
+
+ rbracket {
+ timeout-ms = <50>;
+ key-positions = <16 28>;
+ bindings = <&kp RBKT>;
+ layers = <NUM_L>;
+ };
+
+ ques_mark_combo {
+ timeout-ms = <50>;
+ key-positions = <21 33>;
+ bindings = <&kp LS(FSLH)>;
+ };
+
+ bslash_combo {
+ timeout-ms = <50>;
+ key-positions = <10 22>;
+ bindings = <&kp BSLH>;
+ };
+
+ fslash_combo {
+ timeout-ms = <50>;
+ key-positions = <22 34>;
+ bindings = <&kp FSLH>;
+ };
+
+ bootloader_combo {
+ timeout-ms = <50>;
+ key-positions = <5 6>;
+ bindings = <&bootloader>;
+ layers = <MED_L>;
+ };
+
+ gui_combo {
+ timeout-ms = <50>;
+ key-positions = <16 19>;
+ bindings = <&kp LGUI>;
+ layers = <MED_L>;
+ };
+ };
+
+ keymap {
+ compatible = "zmk,keymap";
+
+#ifdef QWERTY_BASE
+ qwerty_layer {
+ bindings = <
+ &none &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &none
+ &none &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp QUOT &none
+ &none &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp SEMI &none
+ &none &mo NAV_L &shifty &kp SPACE &mo NUM_L &none
+ >;
+ };
+#else
+ colemak_dhm_layer {
+ bindings = <
+ &none &kp Q &kp W &kp F &kp P &kp B &kp J &kp L &kp U &kp Y &kp QUOT &none
+ &none &kp A &kp R &kp S &kp T &kp G &kp M &kp N &kp E &kp I &kp O &none
+ &none &kp Z &kp X &kp C &kp D &kp V &kp K &kp H &kp COMMA &kp DOT &kp SEMI &none
+ &none &mo NAV_L &shifty &kp SPACE &mo NUM_L &none
+ >;
+ };
+#endif
+
+ nav_layer {
+ bindings = <
+ &none &trans &trans &trans &trans &trans &kp GRAVE &kp TAB &kp GRAVE &kp BKSP &kp DEL &none
+ &none &sk LSHFT &sk LALT &sk LCTRL &sk LGUI &trans &kp TAB &kp LARW &kp DARW &kp UARW &kp RARW &none
+ &none &trans &trans &trans &trans &trans &trans &kp HOME &kp PG_DN &kp PG_UP &kp END &none
+ &none &trans &trans &kp RET &trans &none
+ >;
+ };
+
+ num_layer {
+ bindings = <
+ &none &kp ESC &kp N7 &kp N8 &kp N9 &kp RBKT &trans &trans &trans &trans &trans &none
+ &none &kp MINUS &kp N4 &kp N5 &kp N6 &kp EQUAL &trans &sk LGUI &sk LCTRL &sk LALT &sk LSHFT &none
+ &none &kp PLUS &kp N1 &kp N2 &kp N3 &kp N0 &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &none
+ &none &trans &trans &trans &trans &none
+ >;
+ };
+
+ media_layer {
+ bindings = <
+ &bt BT_CLR &trans &trans &trans &trans &trans &trans &kp C_PREV &kp C_VOL_DN &kp C_VOL_UP &kp C_NEXT &none
+ &none &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &none
+ &none &trans &trans &trans &trans &trans &trans &trans &kp C_PLAY_PAUSE &kp C_MUTE &trans &none
+ &none &trans &trans &trans &trans &none
+ >;
+ };
+ };
+};
diff --git a/revxlp/revxlp.overlay b/revxlp/revxlp.overlay
index c9a3600..53faae0 100644
--- a/revxlp/revxlp.overlay
+++ b/revxlp/revxlp.overlay
@@ -14,7 +14,6 @@
gpio-controller;
spi-max-frequency = <200000>;
reg = <0>;
- label = "4HC595";
#gpio-cells = <2>;
ngpios = <8>;
};
@@ -41,7 +40,6 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,5) RC(5,5) RC(5,4) RC(5,3) RC(5,2)
kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
- label = "KSCAN";
diode-direction = "col2row";
col-gpios