From 463e70549841ac07925d4ddb769c1e9ff1ecfd78 Mon Sep 17 00:00:00 2001 From: Eric Neiman Date: Thu, 7 Mar 2024 01:33:33 -0500 Subject: [PATCH] split --- boards/shields/esplit/Kconfig.defconfig | 13 ++++++- boards/shields/esplit/Kconfig.shield | 7 ++-- boards/shields/esplit/esplit.dtsi | 34 ++++++++++++++++++ boards/shields/esplit/esplit.keymap | 30 ++++++++-------- boards/shields/esplit/esplit.overlay | 41 ---------------------- boards/shields/esplit/esplit_left.overlay | 11 ++++++ boards/shields/esplit/esplit_right.overlay | 15 ++++++++ build.yaml | 6 ++-- 8 files changed, 95 insertions(+), 62 deletions(-) create mode 100644 boards/shields/esplit/esplit.dtsi delete mode 100644 boards/shields/esplit/esplit.overlay create mode 100644 boards/shields/esplit/esplit_left.overlay create mode 100644 boards/shields/esplit/esplit_right.overlay diff --git a/boards/shields/esplit/Kconfig.defconfig b/boards/shields/esplit/Kconfig.defconfig index 2c03b30..1a97ae8 100644 --- a/boards/shields/esplit/Kconfig.defconfig +++ b/boards/shields/esplit/Kconfig.defconfig @@ -1,6 +1,17 @@ -if SHIELD_ESPLIT +if SHIELD_ESPLIT_LEFT config ZMK_KEYBOARD_NAME default "esplit" +config ZMK_SPLIT_ROLE_CENTRAL + default y + +endif + + +if SHIELD_ESPLIT_LEFT || SHIELD_ESPLIT_RIGHT + +config ZMK_SPLIT + default y + endif \ No newline at end of file diff --git a/boards/shields/esplit/Kconfig.shield b/boards/shields/esplit/Kconfig.shield index 84eb86e..ed519e5 100644 --- a/boards/shields/esplit/Kconfig.shield +++ b/boards/shields/esplit/Kconfig.shield @@ -1,2 +1,5 @@ -config SHIELD_ESPLIT - def_bool $(shields_list_contains,esplit) \ No newline at end of file +config SHIELD_ESPLIT_LEFT + def_bool $(shields_list_contains,esplit_left) + +config SHIELD_ESPLIT_RIGHT + def_bool $(shields_list_contains,esplit_right) \ No newline at end of file diff --git a/boards/shields/esplit/esplit.dtsi b/boards/shields/esplit/esplit.dtsi new file mode 100644 index 0000000..36c383b --- /dev/null +++ b/boards/shields/esplit/esplit.dtsi @@ -0,0 +1,34 @@ +#include + +/ { + chosen { + zmk,kscan = &kscan0; + zmk,matrix-transform = &default_transform; + }; + + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <14>; + rows = <5>; + + 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(0,12) RC(0,13) + 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,11) RC(1,11) RC(1,12) RC(1,13) + 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,12) RC(2,11) RC(2,12) RC(2,13) + 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,13) RC(3,11) RC(3,12) RC(3,13) + 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,14) RC(4,11) RC(4,12) RC(4,13) + >; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + + diode-direction = "col2row"; + row-gpios = <&pro_micro 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>, + <&pro_micro 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>, + <&pro_micro 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>, + <&pro_micro 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>, + <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; + + }; +}; \ No newline at end of file diff --git a/boards/shields/esplit/esplit.keymap b/boards/shields/esplit/esplit.keymap index f686d1a..9d06b67 100644 --- a/boards/shields/esplit/esplit.keymap +++ b/boards/shields/esplit/esplit.keymap @@ -7,31 +7,31 @@ compatible = "zmk,keymap"; default_layer { bindings = < - &kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 - &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp F5 - &kp CAPS &kp A &kp S &kp D &kp F &kp G &kp F10 - &kp LSHIFT &kp Z &kp X &kp C &kp V &kp B &kp F12 - &kp LCTRL &kp LGUI &kp LALT &kp ESC &mo 2 &mo 1 &kp SPACE + &kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BACKSPACE + &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp F5 &kp C_VOL_UP &kp Y &kp U &kp I &kp O &kp P &kp BSLH + &kp CAPS &kp A &kp S &kp D &kp F &kp G &kp F10 &kp C_VOL_DOWN &kp H &kp J &kp K &kp L &kp SEMI &kp ENTER + &kp LSHIFT &kp Z &kp X &kp C &kp V &kp B &kp F12 &kp PAUSE_BREAK &kp N &kp M &kp COMMA &kp DOT &kp SLASH &kp RSHIFT + &kp LCTRL &kp LGUI &kp LALT &kp ESC &mo 2 &mo 1 &kp SPACE &kp SPACE &mo 1 &mo 2 &kp HOME &kp QUOTE &kp LBKT &kp RBKT >; }; lower_layer { bindings = < - &kp ESC &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 - &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 ESC &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &kp DEL + &trans &trans &kp UP &trans &trans &trans &kp PSCRN &trans &trans &trans &trans &trans &trans &trans + &trans &kp LEFT &kp DOWN &kp RIGHT &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 &trans &trans >; }; raise_layer { bindings = < - &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &bt BT_CLR &sys_reset - &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 + &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &bt BT_CLR &sys_reset &sys_reset &trans &trans &trans &trans &trans &kp INS + &trans &kp KP_N7 &kp KP_N8 &kp KP_N8 &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &kp KP_NUM &kp KP_N4 &kp KP_N5 &kp KP_N6 &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &kp KP_N1 &kp KP_N2 &kp KP_N9 &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &kp KP_N0 &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans >; }; }; diff --git a/boards/shields/esplit/esplit.overlay b/boards/shields/esplit/esplit.overlay deleted file mode 100644 index 6f52da0..0000000 --- a/boards/shields/esplit/esplit.overlay +++ /dev/null @@ -1,41 +0,0 @@ -#include - -/ { - chosen { - zmk,kscan = &default_kscan; - zmk_matrix_transform = &default_transform; - }; - - default_kscan: kscan { - compatible = "zmk,kscan-gpio-matrix"; - diode-direction = "col2row"; - - row-gpios = <&pro_micro 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>, - <&pro_micro 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>, - <&pro_micro 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>, - <&pro_micro 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>, - <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; - - col-gpios = <&pro_micro 16 GPIO_ACTIVE_HIGH>, - <&pro_micro 14 GPIO_ACTIVE_HIGH>, - <&pro_micro 15 GPIO_ACTIVE_HIGH>, - <&pro_micro 18 GPIO_ACTIVE_HIGH>, - <&pro_micro 19 GPIO_ACTIVE_HIGH>, - <&pro_micro 20 GPIO_ACTIVE_HIGH>, - <&pro_micro 21 GPIO_ACTIVE_HIGH>; - }; - - default_transform: matrix_transform { - compatible = "zmk,matrix-transform"; - rows = <5>; - columns = <7>; - - map = < - RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) - RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) - RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) - RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) - RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,5) RC(4,6) - >; - }; -}; \ No newline at end of file diff --git a/boards/shields/esplit/esplit_left.overlay b/boards/shields/esplit/esplit_left.overlay new file mode 100644 index 0000000..8b09ece --- /dev/null +++ b/boards/shields/esplit/esplit_left.overlay @@ -0,0 +1,11 @@ +#include "iris.dtsi" + +kscan0: kscan { + col-gpios = <&pro_micro 16 GPIO_ACTIVE_HIGH>, // C0 + <&pro_micro 14 GPIO_ACTIVE_HIGH>, // C1 + <&pro_micro 15 GPIO_ACTIVE_HIGH>, // C2 + <&pro_micro 18 GPIO_ACTIVE_HIGH>, // C3 + <&pro_micro 19 GPIO_ACTIVE_HIGH>, // C4 + <&pro_micro 20 GPIO_ACTIVE_HIGH>, // C5 + <&pro_micro 21 GPIO_ACTIVE_HIGH>; // C6 +}; diff --git a/boards/shields/esplit/esplit_right.overlay b/boards/shields/esplit/esplit_right.overlay new file mode 100644 index 0000000..d987d43 --- /dev/null +++ b/boards/shields/esplit/esplit_right.overlay @@ -0,0 +1,15 @@ +#include "iris.dtsi" + +&default_transform { + col-offset = <7>; +}; + +kscan0: kscan { + col-gpios = <&pro_micro 21 GPIO_ACTIVE_HIGH>, // C7 + <&pro_micro 20 GPIO_ACTIVE_HIGH>, // C8 + <&pro_micro 19 GPIO_ACTIVE_HIGH>, // C9 + <&pro_micro 18 GPIO_ACTIVE_HIGH>, // C10 + <&pro_micro 15 GPIO_ACTIVE_HIGH>, // C11 + <&pro_micro 14 GPIO_ACTIVE_HIGH>, // C12 + <&pro_micro 16 GPIO_ACTIVE_HIGH>; // C13 +}; diff --git a/build.yaml b/build.yaml index 7272ce6..f5480d1 100644 --- a/build.yaml +++ b/build.yaml @@ -19,6 +19,6 @@ --- include: - board: nice_nano_v2 - shield: esplit - # - board: nice_nano_v2 - # shield: esplit_right + shield: esplit_left + - board: nice_nano_v2 + shield: esplit_right