From d389aeb4f387d51908c35d1c33d15392b2e1c038 Mon Sep 17 00:00:00 2001 From: KemoNine Date: Sat, 7 Aug 2021 18:40:51 +0000 Subject: [PATCH] Add big artsey to main code --- config/artsey.dtsi | 109 +++++++++++++++++- .../shields/corne_left/Kconfig.defconfig | 2 +- .../boards/shields/corne_left/Kconfig.shield | 3 + .../corne_5_col_artsey_left_big.conf | 20 ++++ .../corne_5_col_artsey_left_big.keymap | 40 +++++++ .../corne_5_col_artsey_left_big.overlay | 74 ++++++++++++ .../shields/corne_right/Kconfig.defconfig | 2 +- .../boards/shields/corne_right/Kconfig.shield | 3 + .../corne_5_col_artsey_right_big.conf | 20 ++++ .../corne_5_col_artsey_right_big.keymap | 40 +++++++ .../corne_5_col_artsey_right_big.overlay | 74 ++++++++++++ 11 files changed, 384 insertions(+), 3 deletions(-) create mode 100644 config/boards/shields/corne_left/corne_5_col_artsey_left_big.conf create mode 100644 config/boards/shields/corne_left/corne_5_col_artsey_left_big.keymap create mode 100644 config/boards/shields/corne_left/corne_5_col_artsey_left_big.overlay create mode 100644 config/boards/shields/corne_right/corne_5_col_artsey_right_big.conf create mode 100644 config/boards/shields/corne_right/corne_5_col_artsey_right_big.keymap create mode 100644 config/boards/shields/corne_right/corne_5_col_artsey_right_big.overlay diff --git a/config/artsey.dtsi b/config/artsey.dtsi index e387f42..cbd95bf 100644 --- a/config/artsey.dtsi +++ b/config/artsey.dtsi @@ -77,6 +77,9 @@ // #define KEY_Y 5 // #define KEY_I 6 // #define KEY_O 7 +// Big artsey F1-12 layer keys for combo +// #define KEY_F_TOP -1 +// #define KEY_F_BOTTOM -1 /***************************************** * Define key position offsets in main keymap @@ -87,6 +90,11 @@ // #define LEADING_NONES NONE(0, 1, 0) // #define MIDDLE_NONES NONE(0, 0, 3) // #define TRAILING_NONES NONE(0, 1, 0) +// #define BIG_LEADING_NONES NONE(0, 0, 0) +// #define BIG_BETWEEN_ROW_ONE_TWO_NONES NONE(0, 0, 0) +// #define BIG_BETWEEN_ROW_TWO_THREE_NONES NONE(0, 0, 0) +// #define BIG_BETWEEN_ROW_THREE_THUMBS NONE(0, 0, 0) +// #define BIG_TRAILING_NONES NONE(0, 0, 0) /***************************************** * Define custom BT layer extra keys @@ -193,7 +201,8 @@ #define LAYER_ID_NAVIGATION 4 #define LAYER_ID_BT_SEL 5 #define LAYER_ID_CUSTOM 6 -#define LAYER_ID_MOUSE 7 +#define LAYER_ID_BIG_SYM 7 +#define LAYER_ID_BIG_FUNCTION 8 /***************************************** * Standard ARTSEY combo definitions @@ -244,6 +253,10 @@ combo_layer_bt_select { key-positions = ; bindings = <&tog LAYER_ID_BT_SEL>; }; combo_bt_clr { key-positions = ; bindings = <&bt BT_CLR>; }; combo_layer_navigation { key-positions = ; bindings = <&tog LAYER_ID_NAVIGATION>; }; + // Function layer doesn't apply to non-big artsey presently + #if defined ARTSEY_BIG + combo_layer_functions { key-positions = ; bindings = <&sl LAYER_ID_BIG_FUNCTION>; }; + #endif }; }; @@ -279,6 +292,22 @@ / { keymap { compatible = "zmk,keymap"; + #if defined ARTSEY_BIG + base { + label = "*ARTSEY*"; + bindings = < + BIG_LEADING_NONES + &kp MINUS &layer_parentheticals_kp LAYER_ID_PARENTHETICALS ARTSEY_BASE_A &kp ARTSEY_BASE_R &kp ARTSEY_BASE_T &layer_numbers_kp LAYER_ID_NUMBERS ARTSEY_BASE_S + BIG_BETWEEN_ROW_ONE_TWO_NONES + &kp TAB &layer_symbols_kp LAYER_ID_SYMBOLS ARTSEY_BASE_E &kp ARTSEY_BASE_Y &kp ARTSEY_BASE_I &layer_custom_kp LAYER_ID_CUSTOM ARTSEY_BASE_O + BIG_BETWEEN_ROW_TWO_THREE_NONES + &kp AT &kp EQUAL &kp DEL &sk LCTRL &sk LSHFT + BIG_BETWEEN_ROW_THREE_THUMBS + &kp ENTER &kp SPACE &mo LAYER_ID_BIG_SYM + BIG_TRAILING_NONES + >; + }; + #else base { label = "ARTSEY"; bindings = < @@ -289,6 +318,7 @@ TRAILING_NONES >; }; + #endif numbers { label = "Number"; bindings = < @@ -340,6 +370,36 @@ >; }; ARTSEY_LAYER_CUSTOM + #if defined ARTSEY_BIG + big_artsey_symbol { + label = "*Symbol*"; + bindings = < + BIG_LEADING_NONES + &kp GRAVE &kp HASH &kp LBRC &kp RBRC &kp CARET + BIG_BETWEEN_ROW_ONE_TWO_NONES + &kp BSLH &kp DLLR &kp LPAR &kp RPAR &kp AMPS + BIG_BETWEEN_ROW_TWO_THREE_NONES + &kp PIPE &kp PRCNT &kp LBKT &kp RBKT &kp ASTRK + BIG_BETWEEN_ROW_THREE_THUMBS + &trans &kp SEMI &none + BIG_TRAILING_NONES + >; + }; + big_artsey_function { + label = "*Func*"; + bindings = < + BIG_LEADING_NONES + &none &kp F1 &kp F2 &kp F3 &kp F4 + BIG_BETWEEN_ROW_ONE_TWO_NONES + &none &kp F5 &kp F6 &kp F7 &kp F8 + BIG_BETWEEN_ROW_TWO_THREE_NONES + &none &kp F9 &kp F10 &kp F11 &kp F12 + BIG_BETWEEN_ROW_THREE_THUMBS + &trans &none &none + BIG_TRAILING_NONES + >; + }; + #endif }; }; #endif @@ -352,6 +412,22 @@ / { keymap { compatible = "zmk,keymap"; + #if defined ARTSEY_BIG + base { + label = "*ARTSEY*"; + bindings = < + BIG_LEADING_NONES + &layer_numbers_kp LAYER_ID_NUMBERS ARTSEY_BASE_S &kp ARTSEY_BASE_T &kp ARTSEY_BASE_R &layer_parentheticals_kp LAYER_ID_PARENTHETICALS ARTSEY_BASE_A &kp MINUS + BIG_BETWEEN_ROW_ONE_TWO_NONES + &layer_custom_kp LAYER_ID_CUSTOM ARTSEY_BASE_O &kp ARTSEY_BASE_I &kp ARTSEY_BASE_Y &layer_symbols_kp LAYER_ID_SYMBOLS ARTSEY_BASE_E &kp TAB + BIG_BETWEEN_ROW_TWO_THREE_NONES + &sk LSHFT &sk LCTRL &kp DEL &kp EQUAL &kp AT + BIG_BETWEEN_ROW_THREE_THUMBS + &mo LAYER_ID_BIG_SYM &kp SPACE &kp ENTER + BIG_TRAILING_NONES + >; + }; + #else base { label = "ARTSEY"; bindings = < @@ -362,6 +438,7 @@ TRAILING_NONES >; }; + #endif numbers { label = "Number"; bindings = < @@ -413,6 +490,36 @@ >; }; ARTSEY_LAYER_CUSTOM + #if defined ARTSEY_BIG + big_artsey_symbol { + label = "*Symbol*"; + bindings = < + BIG_LEADING_NONES + &kp CARET &kp LBRC &kp RBRC &kp HASH &kp GRAVE + BIG_BETWEEN_ROW_ONE_TWO_NONES + &kp AMPS &kp LPAR &kp RPAR &kp DLLR &kp BSLH + BIG_BETWEEN_ROW_TWO_THREE_NONES + &kp ASTRK &kp LBKT &kp RBKT &kp PRCNT &kp PIPE + BIG_BETWEEN_ROW_THREE_THUMBS + &none &kp SEMI &none + BIG_TRAILING_NONES + >; + }; + big_artsey_function { + label = "*Func*"; + bindings = < + BIG_LEADING_NONES + &kp F4 &kp F3 &kp F2 &kp F1 &none + BIG_BETWEEN_ROW_ONE_TWO_NONES + &kp F8 &kp F7 &kp F6 &kp F5 &none + BIG_BETWEEN_ROW_TWO_THREE_NONES + &kp F12 &kp F11 &kp F10 &kp F9 &none + BIG_BETWEEN_ROW_THREE_THUMBS + &none &none &none + BIG_TRAILING_NONES + >; + }; + #endif }; }; #endif diff --git a/config/boards/shields/corne_left/Kconfig.defconfig b/config/boards/shields/corne_left/Kconfig.defconfig index 96ba689..b9898ac 100644 --- a/config/boards/shields/corne_left/Kconfig.defconfig +++ b/config/boards/shields/corne_left/Kconfig.defconfig @@ -1,4 +1,4 @@ -if SHIELD_CORNE_ARTSEY_LEFT || SHIELD_CORNE_5_COL_ARTSEY_LEFT +if SHIELD_CORNE_ARTSEY_LEFT || SHIELD_CORNE_5_COL_ARTSEY_LEFT || SHIELD_CORNE_5_COL_ARTSEY_LEFT_BIG config ZMK_KEYBOARD_NAME default "ARTSEY L" diff --git a/config/boards/shields/corne_left/Kconfig.shield b/config/boards/shields/corne_left/Kconfig.shield index a7eaa63..0a3975c 100755 --- a/config/boards/shields/corne_left/Kconfig.shield +++ b/config/boards/shields/corne_left/Kconfig.shield @@ -6,3 +6,6 @@ config SHIELD_CORNE_ARTSEY_LEFT config SHIELD_CORNE_5_COL_ARTSEY_LEFT def_bool $(shields_list_contains,corne_5_col_artsey_left) + +config SHIELD_CORNE_5_COL_ARTSEY_LEFT_BIG + def_bool $(shields_list_contains,corne_5_col_artsey_left_big) diff --git a/config/boards/shields/corne_left/corne_5_col_artsey_left_big.conf b/config/boards/shields/corne_left/corne_5_col_artsey_left_big.conf new file mode 100644 index 0000000..ff3d2fc --- /dev/null +++ b/config/boards/shields/corne_left/corne_5_col_artsey_left_big.conf @@ -0,0 +1,20 @@ +# Copyright (c) 2021 Mike "KemoNine" Crosson +# SPDX-License-Identifier: MIT + +# Tune combos to allow proper ARTSEY support +CONFIG_ZMK_COMBO_MAX_COMBOS_PER_KEY=16 +CONFIG_ZMK_COMBO_MAX_KEYS_PER_COMBO=8 +CONFIG_ZMK_COMBO_MAX_PRESSED_COMBOS=8 + +# Tune bluetooth profiles for quick select +CONFIG_BT_MAX_CONN=6 + +# Enable display (layer in use is helpful) +CONFIG_ZMK_DISPLAY=y + +# Turn on deep sleep +CONFIG_ZMK_SLEEP=y +CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000 + +# Set screen blanking to 15s instead of 30s +#CONFIG_ZMK_IDLE_TIMEOUT=15000 diff --git a/config/boards/shields/corne_left/corne_5_col_artsey_left_big.keymap b/config/boards/shields/corne_left/corne_5_col_artsey_left_big.keymap new file mode 100644 index 0000000..726b2b3 --- /dev/null +++ b/config/boards/shields/corne_left/corne_5_col_artsey_left_big.keymap @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021 Mike "KemoNine" Crosson + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include + +// Enable ARTSEY Left +#define ARTSEY_LEFT 1 +#define ARTSEY_BIG 1 + +// ARTS Row +#define KEY_A 3 +#define KEY_R 2 +#define KEY_T 1 +#define KEY_S 0 +// EYIO Row +#define KEY_E 8 +#define KEY_Y 7 +#define KEY_I 6 +#define KEY_O 5 +// Big artsey F1-12 layer keys for combo +#define KEY_F_TOP 4 +#define KEY_F_BOTTOM 9 + +// Define Offsets +#define LEADING_NONES NONE(0,0, 0) +#define MIDDLE_NONES NONE(0, 0, 1) +#define TRAILING_NONES NONE(0, 0, 9) +#define BIG_LEADING_NONES NONE(0, 0, 0) +#define BIG_BETWEEN_ROW_ONE_TWO_NONES NONE(0, 0, 0) +#define BIG_BETWEEN_ROW_TWO_THREE_NONES NONE(0, 0, 0) +#define BIG_BETWEEN_ROW_THREE_THUMBS NONE(0, 0, 0) +#define BIG_TRAILING_NONES NONE(0, 0, 0) + +// Include main artsey.io keymap +#include "../../../artsey.dtsi" diff --git a/config/boards/shields/corne_left/corne_5_col_artsey_left_big.overlay b/config/boards/shields/corne_left/corne_5_col_artsey_left_big.overlay new file mode 100644 index 0000000..4ded30b --- /dev/null +++ b/config/boards/shields/corne_left/corne_5_col_artsey_left_big.overlay @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2021 Mike "KemoNine" Crosson + * + * SPDX-License-Identifier: MIT + */ + +#include + +/ { + chosen { + zmk,kscan = &kscan0; + zmk,matrix_transform = &default_transform; + }; + + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <6>; + rows = <4>; +// | SW2 | SW3 | SW4 | SW5 | SW6 | +// | SW8 | SW9 | SW10 | SW11 | SW12 | +// | SW14 | SW15 | SW16 | SW17 | SW18 | +// | SW19 | SW20 | SW21 | + map = < +RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) +RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) +RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) + RC(3,3) RC(3,4) RC(3,5) + >; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + + diode-direction = "col2row"; + 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> + ; + }; + + // TODO: per-key RGB node(s)? +}; + +&pro_micro_i2c { + status = "okay"; + + oled: ssd1306@3c { + compatible = "solomon,ssd1306fb"; + reg = <0x3c>; + label = "DISPLAY"; + width = <128>; + height = <32>; + segment-offset = <0>; + page-offset = <0>; + display-offset = <0>; + multiplex-ratio = <31>; + segment-remap; + com-invdir; + com-sequential; + prechargep = <0x22>; + }; +}; diff --git a/config/boards/shields/corne_right/Kconfig.defconfig b/config/boards/shields/corne_right/Kconfig.defconfig index 20304ee..4a2b5bc 100644 --- a/config/boards/shields/corne_right/Kconfig.defconfig +++ b/config/boards/shields/corne_right/Kconfig.defconfig @@ -1,4 +1,4 @@ -if SHIELD_CORNE_ARTSEY_RIGHT || SHIELD_CORNE_5_COL_ARTSEY_RIGHT +if SHIELD_CORNE_ARTSEY_RIGHT || SHIELD_CORNE_5_COL_ARTSEY_RIGHT || SHIELD_CORNE_5_COL_ARTSEY_RIGHT_BIG config ZMK_KEYBOARD_NAME default "ARTSEY R" diff --git a/config/boards/shields/corne_right/Kconfig.shield b/config/boards/shields/corne_right/Kconfig.shield index 61ff1cd..88fde3e 100755 --- a/config/boards/shields/corne_right/Kconfig.shield +++ b/config/boards/shields/corne_right/Kconfig.shield @@ -6,3 +6,6 @@ config SHIELD_CORNE_ARTSEY_RIGHT config SHIELD_CORNE_5_COL_ARTSEY_RIGHT def_bool $(shields_list_contains,corne_5_col_artsey_right) + +config SHIELD_CORNE_5_COL_ARTSEY_RIGHT_BIG + def_bool $(shields_list_contains,corne_5_col_artsey_right_big) diff --git a/config/boards/shields/corne_right/corne_5_col_artsey_right_big.conf b/config/boards/shields/corne_right/corne_5_col_artsey_right_big.conf new file mode 100644 index 0000000..ff3d2fc --- /dev/null +++ b/config/boards/shields/corne_right/corne_5_col_artsey_right_big.conf @@ -0,0 +1,20 @@ +# Copyright (c) 2021 Mike "KemoNine" Crosson +# SPDX-License-Identifier: MIT + +# Tune combos to allow proper ARTSEY support +CONFIG_ZMK_COMBO_MAX_COMBOS_PER_KEY=16 +CONFIG_ZMK_COMBO_MAX_KEYS_PER_COMBO=8 +CONFIG_ZMK_COMBO_MAX_PRESSED_COMBOS=8 + +# Tune bluetooth profiles for quick select +CONFIG_BT_MAX_CONN=6 + +# Enable display (layer in use is helpful) +CONFIG_ZMK_DISPLAY=y + +# Turn on deep sleep +CONFIG_ZMK_SLEEP=y +CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000 + +# Set screen blanking to 15s instead of 30s +#CONFIG_ZMK_IDLE_TIMEOUT=15000 diff --git a/config/boards/shields/corne_right/corne_5_col_artsey_right_big.keymap b/config/boards/shields/corne_right/corne_5_col_artsey_right_big.keymap new file mode 100644 index 0000000..58334f8 --- /dev/null +++ b/config/boards/shields/corne_right/corne_5_col_artsey_right_big.keymap @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021 Mike "KemoNine" Crosson + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include + +// Enable ARTSEY Right +#define ARTSEY_RIGHT 1 +#define ARTSEY_BIG 1 + +// ARTS Row +#define KEY_A 1 +#define KEY_R 2 +#define KEY_T 3 +#define KEY_S 4 +// EYIO Row +#define KEY_E 6 +#define KEY_Y 7 +#define KEY_I 8 +#define KEY_O 9 +// Big artsey F1-12 layer keys for combo +#define KEY_F_TOP 0 +#define KEY_F_BOTTOM 5 + +// Define Offsets +#define LEADING_NONES NONE(0,0,1) +#define MIDDLE_NONES NONE(0, 0, 1) +#define TRAILING_NONES NONE(0, 0, 8) +#define BIG_LEADING_NONES NONE(0, 0, 0) +#define BIG_BETWEEN_ROW_ONE_TWO_NONES NONE(0, 0, 0) +#define BIG_BETWEEN_ROW_TWO_THREE_NONES NONE(0, 0, 0) +#define BIG_BETWEEN_ROW_THREE_THUMBS NONE(0, 0, 0) +#define BIG_TRAILING_NONES NONE(0, 0, 0) + +// Include main artsey.io keymap +#include "../../../artsey.dtsi" diff --git a/config/boards/shields/corne_right/corne_5_col_artsey_right_big.overlay b/config/boards/shields/corne_right/corne_5_col_artsey_right_big.overlay new file mode 100644 index 0000000..7d12d32 --- /dev/null +++ b/config/boards/shields/corne_right/corne_5_col_artsey_right_big.overlay @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2021 Mike "KemoNine" Crosson + * + * SPDX-License-Identifier: MIT + */ + +#include + +/ { + chosen { + zmk,kscan = &kscan0; + zmk,matrix_transform = &default_transform; + }; + + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <6>; + rows = <4>; +// | SW6 | SW5 | SW4 | SW3 | SW2 | SW1 | +// | SW12 | SW11 | SW10 | SW9 | SW8 | SW7 | +// | SW18 | SW17 | SW16 | SW15 | SW14 | SW13 | +// | SW21 | SW20 | SW19 | + map = < +RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) +RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) +RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) +RC(3,0) RC(3,1) RC(3,2) + >; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + + diode-direction = "col2row"; + 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_d 14 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 15 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 0 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 1 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 2 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 3 GPIO_ACTIVE_HIGH> + ; + }; + + // TODO: per-key RGB node(s)? +}; + +&pro_micro_i2c { + status = "okay"; + + oled: ssd1306@3c { + compatible = "solomon,ssd1306fb"; + reg = <0x3c>; + label = "DISPLAY"; + width = <128>; + height = <32>; + segment-offset = <0>; + page-offset = <0>; + display-offset = <0>; + multiplex-ratio = <31>; + segment-remap; + com-invdir; + com-sequential; + prechargep = <0x22>; + }; +};