From 055baeac7fdb9d6e7a67fbb95c5eccbc8255ab3f Mon Sep 17 00:00:00 2001 From: Gerardo Nevarez Moorillon Date: Tue, 6 Jul 2021 13:52:10 -0400 Subject: [PATCH] Fix minor layout errors, setup OLED display --- .../shields/reviung41/Kconfig.defconfig | 36 +++++++++++++++++++ app/boards/shields/reviung41/reviung41.conf | 14 ++++++-- app/boards/shields/reviung41/reviung41.keymap | 22 ++++++------ .../shields/reviung41/reviung41.overlay | 25 +++++++++++++ 4 files changed, 85 insertions(+), 12 deletions(-) diff --git a/app/boards/shields/reviung41/Kconfig.defconfig b/app/boards/shields/reviung41/Kconfig.defconfig index 0625cb21..4d7c0de6 100644 --- a/app/boards/shields/reviung41/Kconfig.defconfig +++ b/app/boards/shields/reviung41/Kconfig.defconfig @@ -5,5 +5,41 @@ if SHIELD_REVIUNG41 config ZMK_KEYBOARD_NAME default "Reviung41" + +if ZMK_DISPLAY + +config I2C + default y + +config SSD1306 + default y + +config SSD1306_REVERSE_MODE + default y + +endif # ZMK_DISPLAY + +if LVGL + +config LVGL_HOR_RES_MAX + default 128 + +config LVGL_VER_RES_MAX + default 32 + +config LVGL_VDB_SIZE + default 64 + +config LVGL_DPI + default 148 + +config LVGL_BITS_PER_PIXEL + default 1 + +choice LVGL_COLOR_DEPTH + default LVGL_COLOR_DEPTH_1 +endchoice + +endif # LVGL endif diff --git a/app/boards/shields/reviung41/reviung41.conf b/app/boards/shields/reviung41/reviung41.conf index 289f070b..eeab1e38 100644 --- a/app/boards/shields/reviung41/reviung41.conf +++ b/app/boards/shields/reviung41/reviung41.conf @@ -1,3 +1,13 @@ # Uncomment the following lines to enable RGB underglow -# CONFIG_ZMK_RGB_UNDERGLOW=y -# CONFIG_WS2812_STRIP=y +#CONFIG_ZMK_RGB_UNDERGLOW=y +#CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER=n +#CONFIG_WS2812_STRIP=y + +# Uncomment the following lines to enable display +#CONFIG_ZMK_DISPLAY=y +#CONFIG_MAIN_STACK_SIZE=8192 +#CONFIG_ZMK_WIDGET_WPM_STATUS=y +#CONFIG_ZMK_IDLE_TIMEOUT=30000 +#CONFIG_ZMK_WIDGET_BATTERY_STATUS=y +#CONFIG_ZMK_WIDGET_LAYER_STATUS=y +#CONFIG_ZMK_WIDGET_OUTPUT_STATUS=y diff --git a/app/boards/shields/reviung41/reviung41.keymap b/app/boards/shields/reviung41/reviung41.keymap index 9c189759..f73fec19 100644 --- a/app/boards/shields/reviung41/reviung41.keymap +++ b/app/boards/shields/reviung41/reviung41.keymap @@ -8,6 +8,8 @@ #include #include #include +#include +#include / { keymap { @@ -23,7 +25,7 @@ &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSPC &kp LCTRL &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &mt RSHFT RET - &kp LALT &mo 1 &kp SPACE &mo 2 &kp RALT + &kp LALT &mo 1 &kp SPACE &mo 2 &kp RGUI >; }; @@ -31,12 +33,12 @@ // ---------------------------------------------------------------------------------- // | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | DEL | // | | _ | + | { | } | "|" | | LFT | DWN | UP | RGT | ` | ~ | -// | | ESC | GUI | ALT | CAPS| " | | HOME| END | PGUP| PGDN| PRSC| SHFT(RET) | +// | | ESC | GUI | ALT | CAPS| " | | HOME| END | PGUP| PGDN| PRSC| SHFT(SPC) | // | | | RET | ADJ | | bindings = < &trans &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp N8 &kp LPAR &kp RPAR &kp DEL - &trans &kp MINUS &kp KP_PLUS &kp LBRC &kp RBRC &kp PIPE &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp GRAVE &kp GRAVE - &trans &kp ESC &kp LGUI &kp LALT &kp CLCK &kp SQT &kp HOME &kp END &kp PG_UP &kp PG_DN &kp PSCRN &mt RSHFT RET + &trans &kp UNDERSCORE &kp KP_PLUS &kp LBRC &kp RBRC &kp PIPE &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp GRAVE &kp TILDE + &trans &kp ESC &kp LGUI &kp LALT &kp CLCK &kp DQT &kp HOME &kp END &kp PG_UP &kp PG_DN &kp PSCRN &mt RSHFT SPC &trans &trans &kp RET &mo 3 &trans >; }; @@ -45,12 +47,12 @@ // ----------------------------------------------------------------------------------------- // | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | DEL | // | | - | = | [ | ] | \ | | F1 | F2 | F3 | F4 | F5 | F6 | -// | | ESC | GUI | ALT | CAPS| " | | F7 | F8 | F9 | F10 | F11 | F12 | +// | | ESC | GUI | ALT | CAPS| ' | | F7 | F8 | F9 | F10 | F11 | F12 | // | | ADJ | BKSP | | | bindings = < &trans &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp DEL &trans &kp MINUS &kp EQUAL &kp LBKT &kp RBKT &kp BSLH &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 - &trans &kp ESC &kp LGUI &kp RALT &kp CLCK &kp SQT &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 + &trans &kp ESC &kp RGUI &kp RALT &kp CLCK &kp SQT &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &trans &mo 3 &kp BSPC &trans &trans >; }; @@ -59,13 +61,13 @@ // ----------------------------------------------------------------------------------------- // | RGB BRI+ | RGB SAT+ | RGB HUE+ | RGB ANI+ | | RGB TOG | | BT1 | BT2 | BT3 | BT4 | BT5 | BT CLR | // | RGB BRI- | RGB SAT- | RGB HUE- | RGB ANI+ | | | | | | | | | | -// | | | | | | | | RESET | | | | | | -// | | | | | | +// | | | | | | Boot | | RESET | | | | | | +// | | | adjust_layer | | | bindings = < &rgb_ug RGB_BRI &rgb_ug RGB_SAI &rgb_ug RGB_HUI &rgb_ug RGB_EFF &none &rgb_ug RGB_TOG &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &bt BT_CLR &rgb_ug RGB_BRD &rgb_ug RGB_SAD &rgb_ug RGB_HUD &rgb_ug RGB_EFR &none &none &none &none &none &none &none &none - &none &none &none &none &none &none &reset &none &none &none &none &none - &trans &trans &tog 3 &trans &trans + &none &none &none &none &none &bootloader &reset &none &none &none &none &none + &trans &trans &tog 3 &trans &out OUT_TOG >; }; }; diff --git a/app/boards/shields/reviung41/reviung41.overlay b/app/boards/shields/reviung41/reviung41.overlay index 5336853b..b4b0caa2 100644 --- a/app/boards/shields/reviung41/reviung41.overlay +++ b/app/boards/shields/reviung41/reviung41.overlay @@ -50,3 +50,28 @@ RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(5,0) RC(5,1) RC(5,2) RC(5,3) ; }; }; + + +/* + * Uncomment to enable OLED display + */ + + /* +&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>; + com-sequential; + prechargep = <0x22>; + }; +}; +*/