From d18cb60206cdb14924ecbac8a240c367a3ea096f Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 21 Jul 2023 22:29:18 +0200 Subject: [PATCH] add niceview adapter and reduce complexity --- .../boards/shields/ownkb/Kconfig.defconfig | 32 ++----------------- .../config/boards/shields/ownkb/ownkb.conf | 5 +++ .../config/boards/shields/ownkb/ownkb.dtsi | 28 ++++------------ .../config/boards/shields/ownkb/ownkb.keymap | 2 ++ .../config/boards/shields/ownkb/ownkb.zmk.yml | 7 ++-- .../boards/shields/ownkb/ownkb_left.conf | 2 -- .../boards/shields/ownkb/ownkb_left.overlay | 6 ++-- .../boards/shields/ownkb/ownkb_right.conf | 2 -- .../boards/shields/ownkb/ownkb_right.overlay | 6 ++-- zmk-config/config/ownkb.conf | 17 ++++++++++ zmk-config/ownkb.conf | 7 ---- 11 files changed, 41 insertions(+), 73 deletions(-) delete mode 100644 zmk-config/config/boards/shields/ownkb/ownkb_left.conf delete mode 100644 zmk-config/config/boards/shields/ownkb/ownkb_right.conf create mode 100644 zmk-config/config/ownkb.conf delete mode 100644 zmk-config/ownkb.conf diff --git a/zmk-config/config/boards/shields/ownkb/Kconfig.defconfig b/zmk-config/config/boards/shields/ownkb/Kconfig.defconfig index b777d8b..65f95d8 100644 --- a/zmk-config/config/boards/shields/ownkb/Kconfig.defconfig +++ b/zmk-config/config/boards/shields/ownkb/Kconfig.defconfig @@ -4,7 +4,7 @@ if SHIELD_OWNKB_LEFT config ZMK_KEYBOARD_NAME - default "SplitKeyboard" + default "ownkb" config ZMK_SPLIT_ROLE_CENTRAL default y @@ -16,34 +16,6 @@ if SHIELD_OWNKB_LEFT || SHIELD_OWNKB_RIGHT config ZMK_SPLIT default y -if ZMK_DISPLAY - -config I2C - default y - -config SSD1306 - default y - -config SSD1306_REVERSE_MODE - default y - -endif # ZMK_DISPLAY - -if LVGL - -config LV_Z_VDB_SIZE - default 64 - -config LV_Z_DPI - default 148 - -config LV_Z_BITS_PER_PIXEL - default 1 - -choice LV_COLOR_DEPTH - default LV_COLOR_DEPTH_1 -endchoice - -endif # LVGL +# TODO add support for normal OLED endif diff --git a/zmk-config/config/boards/shields/ownkb/ownkb.conf b/zmk-config/config/boards/shields/ownkb/ownkb.conf index cf7b6ce..f727433 100644 --- a/zmk-config/config/boards/shields/ownkb/ownkb.conf +++ b/zmk-config/config/boards/shields/ownkb/ownkb.conf @@ -3,6 +3,11 @@ # Uncomment the following line to enable the Sofle OLED Display # CONFIG_ZMK_DISPLAY=y +# CONFIG_ZMK_DISPLAY=y +# CONFIG_ZMK_WIDGET_LAYER_STATUS=y +# CONFIG_ZMK_WIDGET_OUTPUT_STATUS=y +# CONFIG_ZMK_WIDGET_WPM_STATUS=n +#CONFIG_ZMK_WIDGET_PERIPHERAL_STATUS=y # Uncomment these two lines to add support for encoders # CONFIG_EC11=y diff --git a/zmk-config/config/boards/shields/ownkb/ownkb.dtsi b/zmk-config/config/boards/shields/ownkb/ownkb.dtsi index 5b4aef3..162821f 100644 --- a/zmk-config/config/boards/shields/ownkb/ownkb.dtsi +++ b/zmk-config/config/boards/shields/ownkb/ownkb.dtsi @@ -7,8 +7,8 @@ / { chosen { - zephyr,display = &oled; zmk,kscan = &kscan0; + // zephyr,display = &oled; // TODO remove or keep? zmk,matrix_transform = &default_transform; }; @@ -47,8 +47,8 @@ RC(0,3) RC(1,3) RC(2,3) RC(3,3) RC(4,3) RC(5,3) RC(5,4) RC(6,4) RC(6,3) RC(7,3) right_encoder: encoder_right { compatible = "alps,ec11"; label = "RIGHT_ENCODER"; - a-gpios = <&pro_micro 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; - b-gpios = <&pro_micro 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + a-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; resolution = <4>; status = "disabled"; }; @@ -59,22 +59,6 @@ RC(0,3) RC(1,3) RC(2,3) RC(3,3) RC(4,3) RC(5,3) RC(5,4) RC(6,4) RC(6,3) RC(7,3) }; }; -&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>; - }; -}; +nice_view_spi: &spi0 { + cs-gpios = <&pro_micro 4 GPIO_ACTIVE_HIGH>; +}; \ No newline at end of file diff --git a/zmk-config/config/boards/shields/ownkb/ownkb.keymap b/zmk-config/config/boards/shields/ownkb/ownkb.keymap index 3790a06..a09d99b 100644 --- a/zmk-config/config/boards/shields/ownkb/ownkb.keymap +++ b/zmk-config/config/boards/shields/ownkb/ownkb.keymap @@ -7,6 +7,8 @@ #include #include + + / { keymap { compatible = "zmk,keymap"; diff --git a/zmk-config/config/boards/shields/ownkb/ownkb.zmk.yml b/zmk-config/config/boards/shields/ownkb/ownkb.zmk.yml index f4cb4d8..1214959 100644 --- a/zmk-config/config/boards/shields/ownkb/ownkb.zmk.yml +++ b/zmk-config/config/boards/shields/ownkb/ownkb.zmk.yml @@ -1,14 +1,13 @@ file_format: "1" id: ownkb -name: SplitKeyboard +name: ownkb type: shield url: https://github.com/dnlbauer/splitkeyboard requires: [pro_micro] -exposes: [i2c_oled] features: - keys - - display - - encoder +# - display TODO remove? +# - encoder TODO use siblings: - ownkb_left - ownkb_right diff --git a/zmk-config/config/boards/shields/ownkb/ownkb_left.conf b/zmk-config/config/boards/shields/ownkb/ownkb_left.conf deleted file mode 100644 index 4e7f290..0000000 --- a/zmk-config/config/boards/shields/ownkb/ownkb_left.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Copyright (c) 2023 The ZMK Contributors -# SPDX-License-Identifier: MIT \ No newline at end of file diff --git a/zmk-config/config/boards/shields/ownkb/ownkb_left.overlay b/zmk-config/config/boards/shields/ownkb/ownkb_left.overlay index 5917d43..c035a27 100644 --- a/zmk-config/config/boards/shields/ownkb/ownkb_left.overlay +++ b/zmk-config/config/boards/shields/ownkb/ownkb_left.overlay @@ -24,6 +24,6 @@ ; }; -&left_encoder { - status = "okay"; -}; +// &left_encoder { +// status = "okay"; +// }; diff --git a/zmk-config/config/boards/shields/ownkb/ownkb_right.conf b/zmk-config/config/boards/shields/ownkb/ownkb_right.conf deleted file mode 100644 index 4e7f290..0000000 --- a/zmk-config/config/boards/shields/ownkb/ownkb_right.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Copyright (c) 2023 The ZMK Contributors -# SPDX-License-Identifier: MIT \ No newline at end of file diff --git a/zmk-config/config/boards/shields/ownkb/ownkb_right.overlay b/zmk-config/config/boards/shields/ownkb/ownkb_right.overlay index cba9a1b..25d82e2 100644 --- a/zmk-config/config/boards/shields/ownkb/ownkb_right.overlay +++ b/zmk-config/config/boards/shields/ownkb/ownkb_right.overlay @@ -28,6 +28,6 @@ ; }; -&right_encoder { - status = "okay"; -}; +// &right_encoder { +// status = "okay"; +// }; diff --git a/zmk-config/config/ownkb.conf b/zmk-config/config/ownkb.conf new file mode 100644 index 0000000..e599a70 --- /dev/null +++ b/zmk-config/config/ownkb.conf @@ -0,0 +1,17 @@ +# Copyright (c) 2020 Ryan Cross +# SPDX-License-Identifier: MIT + +# Uncomment the following line to enable the Sofle OLED Display +# CONFIG_ZMK_DISPLAY=y +# CONFIG_ZMK_WIDGET_LAYER_STATUS=y +# CONFIG_ZMK_WIDGET_OUTPUT_STATUS=y +# CONFIG_ZMK_WIDGET_WPM_STATUS=n +#CONFIG_ZMK_WIDGET_PERIPHERAL_STATUS=y +# Uncomment these two lines to add support for encoders +CONFIG_EC11=y +CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y +CONFIG_ZMK_KEYBOARD_NAME="test" + +CONFIG_ZMK_IDLE_TIMEOUT=30000 +#CONFIG_ZMK_SLEEP=y +#CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000 \ No newline at end of file diff --git a/zmk-config/ownkb.conf b/zmk-config/ownkb.conf deleted file mode 100644 index 285781d..0000000 --- a/zmk-config/ownkb.conf +++ /dev/null @@ -1,7 +0,0 @@ -# Uncomment these two lines to add support for encoders -CONFIG_EC11=y -CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y - -# Uncomment the following line to enable the Sofle OLED Display -CONFIG_ZMK_DISPLAY=y -