From 33882223b671585b9ef5569175e657060bca88b3 Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Wed, 7 Sep 2022 10:17:39 -0400 Subject: [PATCH] Making progress on sugarglider functionality --- app/boards/shields/obe/obe.keymap | 22 ++++++++++-- .../shields/sugarglider/Kconfig.defconfig | 2 +- .../shields/sugarglider/sugarglider.conf | 10 ++++-- .../shields/sugarglider/sugarglider.keymap | 35 ++++--------------- .../shields/sugarglider/sugarglider.overlay | 32 ++++++++--------- 5 files changed, 50 insertions(+), 51 deletions(-) diff --git a/app/boards/shields/obe/obe.keymap b/app/boards/shields/obe/obe.keymap index 05889365..febe95f5 100644 --- a/app/boards/shields/obe/obe.keymap +++ b/app/boards/shields/obe/obe.keymap @@ -25,6 +25,11 @@ key-positions = <1 6>; bindings = <&bt BT_CLR>; }; + combo_lock { + timeout-ms = ; + key-positions = <1 7>; + bindings = <&tog 2>; + }; combo_reset { timeout-ms = ; key-positions = <1 3>; @@ -67,14 +72,27 @@ fn_layer { label = "fn layer"; bindings = < - &bt BT_CLR &trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &trans &kp DEL + &tog 2 &trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &trans &kp DEL &bootloader &trans &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &trans &trans &trans &trans &trans &trans &trans &trans &trans &bt BT_NXT &kp CAPS &kp KP_NUM &kp SLCK &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_CLR &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &rgb_ug RGB_BRD &rgb_ug RGB_EFR &ext_power EP_TOG &rgb_ug RGB_EFF &rgb_ug RGB_BRI &trans &kp HOME &trans &kp END >; sensor-bindings = <&inc_dec_kp PG_UP PG_DN>; }; + + lock_layer { + label = "fn layer"; + bindings = < + &none &none &none &none &none &none &none &none &none &none &none &none &none &none &none &none + &none &none &none &none &none &none &none &none &none &none &none &none &none &none &none + &none &none &none &none &none &none &none &none &none &none &none &none &none &none + &none &none &none &none &none &none &none &none &none &none &none &none &none &none + &none &none &none &none &none &none &none &none &none &none &none + >; + sensor-bindings = <&inc_dec_kp PG_UP PG_DN>; + + }; }; }; diff --git a/app/boards/shields/sugarglider/Kconfig.defconfig b/app/boards/shields/sugarglider/Kconfig.defconfig index c4531daf..c75c7115 100644 --- a/app/boards/shields/sugarglider/Kconfig.defconfig +++ b/app/boards/shields/sugarglider/Kconfig.defconfig @@ -2,7 +2,7 @@ # SPDX-License-Identifier: MIT if SHIELD_SUGARGLIDER - + config ZMK_KEYBOARD_NAME default "Sugar Glider" diff --git a/app/boards/shields/sugarglider/sugarglider.conf b/app/boards/shields/sugarglider/sugarglider.conf index 21766236..b796acd1 100644 --- a/app/boards/shields/sugarglider/sugarglider.conf +++ b/app/boards/shields/sugarglider/sugarglider.conf @@ -1,14 +1,18 @@ # Uncomment to turn on logging, and set ZMK logging to debug output CONFIG_ZMK_USB_LOGGING=y +#CONFIG_I2C_LOG_LEVEL_DBG=y +CONFIG_GPIO_LOG_LEVEL_DBG=y # Uncomment both to enable encoder -CONFIG_EC11=y -CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y +#CONFIG_EC11=y +#CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y # Enable i2c CONFIG_I2C=y +CONFIG_PINCTRL=y CONFIG_ZMK_KSCAN_MATRIX_POLLING=y -CONFIG_GPIO_MCP23017=y +CONFIG_GPIO_MCP230XX=y + diff --git a/app/boards/shields/sugarglider/sugarglider.keymap b/app/boards/shields/sugarglider/sugarglider.keymap index 802730ec..b5c370e1 100644 --- a/app/boards/shields/sugarglider/sugarglider.keymap +++ b/app/boards/shields/sugarglider/sugarglider.keymap @@ -9,9 +9,9 @@ #include #include #include +#include - -#define TIMEOUT 300 +#define TIMEOUT 100 &encoder_1 { status = "okay"; @@ -22,30 +22,7 @@ }; / { - combos { - compatible = "zmk,combos"; - combo_btclr { - timeout-ms = ; - key-positions = <1 6>; - bindings = <&bt BT_CLR>; - }; - combo_reset { - timeout-ms = ; - key-positions = <1 3>; - bindings = <&reset>; - }; - combo_bootloader { - timeout-ms = ; - key-positions = <1 2>; - bindings = <&bootloader>; - }; - combo_bt_nxt { - timeout-ms = ; - key-positions = <1 4>; - bindings = <&bt BT_NXT>; - }; - }; - + sensors { compatible = "zmk,keymap-sensors"; sensors = <&encoder_1 &encoder_2>; @@ -59,7 +36,7 @@ label = "default layer"; bindings = < &kp ESC &kp Q &kp W &kp E &kp R &kp T &trans &kp Y &kp U &kp I &kp O &kp P &kp BSPC - &kp TAB &kp A &kp S &kp D &kp F &kp G &kp C_MUTE &trans &kp H &kp J &kp K &kp L &kp SEMI &kp ENTER + &mo 1 &kp A &kp S &kp D &kp F &kp G &kp C_MUTE &trans &kp H &kp J &kp K &kp L &kp SEMI &kp ENTER &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &trans &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT &kp C_MUTE &kp LCTRL &kp LALT &kp SPACE &kp Y &kp Y &kp Y &kp SPACE &kp SPACE &kp RGUI &kp C_MUTE >; @@ -70,10 +47,10 @@ fn_layer { label = "fn layer"; bindings = < - &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &out OUT_TOG &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 &trans - &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &kp TAB &trans &trans &trans &kp TAB &trans &trans &trans >; sensor-bindings = <&inc_dec_kp PG_UP PG_DN &inc_dec_kp C_VOL_UP C_VOL_DN>; diff --git a/app/boards/shields/sugarglider/sugarglider.overlay b/app/boards/shields/sugarglider/sugarglider.overlay index 1c83e110..96c2d4a8 100644 --- a/app/boards/shields/sugarglider/sugarglider.overlay +++ b/app/boards/shields/sugarglider/sugarglider.overlay @@ -16,25 +16,25 @@ compatible = "zmk,kscan-gpio-matrix"; label = "KSCAN"; - diode-direction = "col2row"; + diode-direction = "row2col"; row-gpios - = <&ext_gpio 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&ext_gpio 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&ext_gpio 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&ext_gpio 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&ext_gpio 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&ext_gpio 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&ext_gpio 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&ext_gpio 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&ext_gpio 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + = <&ext_gpio 14 (GPIO_ACTIVE_LOW)> + , <&ext_gpio 15 (GPIO_ACTIVE_LOW)> + , <&ext_gpio 6 (GPIO_ACTIVE_LOW)> + , <&ext_gpio 7 (GPIO_ACTIVE_LOW)> + , <&ext_gpio 2 (GPIO_ACTIVE_LOW)> + , <&ext_gpio 4 (GPIO_ACTIVE_LOW)> + , <&ext_gpio 5 (GPIO_ACTIVE_LOW)> + , <&ext_gpio 1 (GPIO_ACTIVE_LOW)> + , <&ext_gpio 3 (GPIO_ACTIVE_LOW)> ; col-gpios - = <&ext_gpio 8 (GPIO_ACTIVE_HIGH)> - , <&ext_gpio 9 (GPIO_ACTIVE_HIGH)> - , <&ext_gpio 10 (GPIO_ACTIVE_HIGH)> - , <&ext_gpio 11 (GPIO_ACTIVE_HIGH)> - , <&ext_gpio 12 (GPIO_ACTIVE_HIGH)> - , <&ext_gpio 13 (GPIO_ACTIVE_HIGH)> + = <&ext_gpio 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&ext_gpio 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&ext_gpio 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&ext_gpio 11 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&ext_gpio 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&ext_gpio 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> ; };