Merge branch 'pillbug' of github.com:kylemccreery/zmk into pillbug

This commit is contained in:
Kyle McCreery 2022-11-10 13:34:11 -05:00
commit 07bdc9aaaf
5 changed files with 82 additions and 11 deletions

View file

@ -6,6 +6,20 @@ if SHIELD_SUGARGLIDER
config ZMK_KEYBOARD_NAME
default "Sugar Glider"
if ZMK_DISPLAY
config I2C
default y
config SSD1306
default y
config SSD1306_REVERSE_MODE
default y
endif # ZMK_DISPLAY
if LVGL
config LVGL_VDB_SIZE

View file

@ -1,3 +1,3 @@
# Uncomment both to enable underglow
#CONFIG_ZMK_RGB_UNDERGLOW=y
#CONFIG_WS2812_STRIP=y
CONFIG_ZMK_RGB_UNDERGLOW=y
CONFIG_WS2812_STRIP=y

View file

@ -1,11 +1,11 @@
# 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
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
@ -15,4 +15,16 @@ CONFIG_PINCTRL=y
CONFIG_ZMK_KSCAN_MATRIX_POLLING=y
CONFIG_GPIO_MCP230XX=y
#CONFIG_ZMK_KSCAN_MATRIX_WAIT_BEFORE_INPUTS=150
#CONFIG_ZMK_KSCAN_MATRIX_WAIT_BETWEEN_OUTPUTS=150
# OLED config
CONFIG_ZMK_DISPLAY=y
CONFIG_SSD1306=y
CONFIG_SSD1306_REVERSE_MODE=y
CONFIG_LVGL_HOR_RES_MAX=128
CONFIG_LVGL_VER_RES_MAX=64
CONFIG_LVGL_VDB_SIZE=64
CONFIG_LVGL_DPI=148
CONFIG_LVGL_BITS_PER_PIXEL=1
CONFIG_LVGL_COLOR_DEPTH_1=y

View file

@ -11,7 +11,7 @@
#include <dt-bindings/zmk/ext_power.h>
#include <dt-bindings/zmk/outputs.h>
#define TIMEOUT 100
#define TIMEOUT 10
&encoder_1 {
status = "okay";
@ -21,11 +21,19 @@
status = "okay";
};
&encoder_3 {
status = "okay";
};
&encoder_4 {
status = "okay";
};
/ {
sensors {
compatible = "zmk,keymap-sensors";
sensors = <&encoder_1 &encoder_2>;
sensors = <&encoder_1 &encoder_2 &encoder_3 &encoder_4>;
};
@ -40,7 +48,7 @@
&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
>;
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>;
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN &inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp C_VOL_UP C_VOL_DN>;
};
@ -52,7 +60,7 @@
&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 &inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp C_VOL_UP C_VOL_DN>;
};
};

View file

@ -8,6 +8,7 @@
/ {
chosen {
zephyr,display = &oled;
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};
@ -17,6 +18,7 @@
label = "KSCAN";
diode-direction = "row2col";
debounce-scan-period-ms = <10>;
row-gpios
= <&ext_gpio 14 (GPIO_ACTIVE_LOW)>
, <&ext_gpio 15 (GPIO_ACTIVE_LOW)>
@ -68,6 +70,28 @@
status = "disabled";
};
encoder_3: encoder_3 {
compatible = "alps,ec11";
label = "Encoder 3";
a-gpios = <&blackpill 45 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
b-gpios = <&blackpill 46 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
resolution = <4>;
status = "disabled";
};
encoder_4: encoder_4 {
compatible = "alps,ec11";
label = "Encoder 4";
a-gpios = <&blackpill 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
b-gpios = <&blackpill 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
resolution = <2>;
status = "disabled";
};
};
&spi1 {
cs-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
};
&i2c0 {
@ -83,5 +107,18 @@
#gpio-cells = <2>;
ngpios = <16>;
};
oled: ssd1306@3c {
compatible = "solomon,ssd1306fb";
status = "okay";
reg = <0x3c>;
label = "DISPLAY";
width = <128>;
height = <64>;
segment-offset = <0>;
page-offset = <0>;
display-offset = <0>;
multiplex-ratio = <63>;
prechargep = <0x22>;
};
};