Making progress on sugarglider functionality

This commit is contained in:
Kyle McCreery 2022-09-07 10:17:39 -04:00
parent 7eb0b37de3
commit 33882223b6
5 changed files with 50 additions and 51 deletions

View file

@ -25,6 +25,11 @@
key-positions = <1 6>; key-positions = <1 6>;
bindings = <&bt BT_CLR>; bindings = <&bt BT_CLR>;
}; };
combo_lock {
timeout-ms = <TIMEOUT>;
key-positions = <1 7>;
bindings = <&tog 2>;
};
combo_reset { combo_reset {
timeout-ms = <TIMEOUT>; timeout-ms = <TIMEOUT>;
key-positions = <1 3>; key-positions = <1 3>;
@ -67,14 +72,27 @@
fn_layer { fn_layer {
label = "fn layer"; label = "fn layer";
bindings = < 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 &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 &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 &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>; 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>;
};
}; };
}; };

View file

@ -2,7 +2,7 @@
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
if SHIELD_SUGARGLIDER if SHIELD_SUGARGLIDER
config ZMK_KEYBOARD_NAME config ZMK_KEYBOARD_NAME
default "Sugar Glider" default "Sugar Glider"

View file

@ -1,14 +1,18 @@
# Uncomment to turn on logging, and set ZMK logging to debug output # Uncomment to turn on logging, and set ZMK logging to debug output
CONFIG_ZMK_USB_LOGGING=y CONFIG_ZMK_USB_LOGGING=y
#CONFIG_I2C_LOG_LEVEL_DBG=y
CONFIG_GPIO_LOG_LEVEL_DBG=y
# Uncomment both to enable encoder # Uncomment both to enable encoder
CONFIG_EC11=y #CONFIG_EC11=y
CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y #CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
# Enable i2c # Enable i2c
CONFIG_I2C=y CONFIG_I2C=y
CONFIG_PINCTRL=y
CONFIG_ZMK_KSCAN_MATRIX_POLLING=y CONFIG_ZMK_KSCAN_MATRIX_POLLING=y
CONFIG_GPIO_MCP23017=y CONFIG_GPIO_MCP230XX=y

View file

@ -9,9 +9,9 @@
#include <dt-bindings/zmk/bt.h> #include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/rgb.h> #include <dt-bindings/zmk/rgb.h>
#include <dt-bindings/zmk/ext_power.h> #include <dt-bindings/zmk/ext_power.h>
#include <dt-bindings/zmk/outputs.h>
#define TIMEOUT 100
#define TIMEOUT 300
&encoder_1 { &encoder_1 {
status = "okay"; status = "okay";
@ -22,30 +22,7 @@
}; };
/ { / {
combos {
compatible = "zmk,combos";
combo_btclr {
timeout-ms = <TIMEOUT>;
key-positions = <1 6>;
bindings = <&bt BT_CLR>;
};
combo_reset {
timeout-ms = <TIMEOUT>;
key-positions = <1 3>;
bindings = <&reset>;
};
combo_bootloader {
timeout-ms = <TIMEOUT>;
key-positions = <1 2>;
bindings = <&bootloader>;
};
combo_bt_nxt {
timeout-ms = <TIMEOUT>;
key-positions = <1 4>;
bindings = <&bt BT_NXT>;
};
};
sensors { sensors {
compatible = "zmk,keymap-sensors"; compatible = "zmk,keymap-sensors";
sensors = <&encoder_1 &encoder_2>; sensors = <&encoder_1 &encoder_2>;
@ -59,7 +36,7 @@
label = "default layer"; label = "default layer";
bindings = < 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 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 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 &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 { fn_layer {
label = "fn layer"; label = "fn layer";
bindings = < 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 &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>; sensor-bindings = <&inc_dec_kp PG_UP PG_DN &inc_dec_kp C_VOL_UP C_VOL_DN>;

View file

@ -16,25 +16,25 @@
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN"; label = "KSCAN";
diode-direction = "col2row"; diode-direction = "row2col";
row-gpios row-gpios
= <&ext_gpio 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> = <&ext_gpio 14 (GPIO_ACTIVE_LOW)>
, <&ext_gpio 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> , <&ext_gpio 15 (GPIO_ACTIVE_LOW)>
, <&ext_gpio 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> , <&ext_gpio 6 (GPIO_ACTIVE_LOW)>
, <&ext_gpio 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> , <&ext_gpio 7 (GPIO_ACTIVE_LOW)>
, <&ext_gpio 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> , <&ext_gpio 2 (GPIO_ACTIVE_LOW)>
, <&ext_gpio 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> , <&ext_gpio 4 (GPIO_ACTIVE_LOW)>
, <&ext_gpio 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> , <&ext_gpio 5 (GPIO_ACTIVE_LOW)>
, <&ext_gpio 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> , <&ext_gpio 1 (GPIO_ACTIVE_LOW)>
, <&ext_gpio 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> , <&ext_gpio 3 (GPIO_ACTIVE_LOW)>
; ;
col-gpios col-gpios
= <&ext_gpio 8 (GPIO_ACTIVE_HIGH)> = <&ext_gpio 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&ext_gpio 9 (GPIO_ACTIVE_HIGH)> , <&ext_gpio 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&ext_gpio 10 (GPIO_ACTIVE_HIGH)> , <&ext_gpio 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&ext_gpio 11 (GPIO_ACTIVE_HIGH)> , <&ext_gpio 11 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&ext_gpio 12 (GPIO_ACTIVE_HIGH)> , <&ext_gpio 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&ext_gpio 13 (GPIO_ACTIVE_HIGH)> , <&ext_gpio 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
; ;
}; };