add niceview adapter and reduce complexity

This commit is contained in:
daniel
2023-07-21 22:29:18 +02:00
parent 8221ea14e7
commit d18cb60206
11 changed files with 41 additions and 73 deletions

View File

@@ -4,7 +4,7 @@
if SHIELD_OWNKB_LEFT if SHIELD_OWNKB_LEFT
config ZMK_KEYBOARD_NAME config ZMK_KEYBOARD_NAME
default "SplitKeyboard" default "ownkb"
config ZMK_SPLIT_ROLE_CENTRAL config ZMK_SPLIT_ROLE_CENTRAL
default y default y
@@ -16,34 +16,6 @@ if SHIELD_OWNKB_LEFT || SHIELD_OWNKB_RIGHT
config ZMK_SPLIT config ZMK_SPLIT
default y default y
if ZMK_DISPLAY # TODO add support for normal OLED
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
endif endif

View File

@@ -3,6 +3,11 @@
# Uncomment the following line to enable the Sofle OLED Display # Uncomment the following line to enable the Sofle OLED Display
# CONFIG_ZMK_DISPLAY=y # 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 # Uncomment these two lines to add support for encoders
# CONFIG_EC11=y # CONFIG_EC11=y

View File

@@ -7,8 +7,8 @@
/ { / {
chosen { chosen {
zephyr,display = &oled;
zmk,kscan = &kscan0; zmk,kscan = &kscan0;
// zephyr,display = &oled; // TODO remove or keep?
zmk,matrix_transform = &default_transform; 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 { right_encoder: encoder_right {
compatible = "alps,ec11"; compatible = "alps,ec11";
label = "RIGHT_ENCODER"; label = "RIGHT_ENCODER";
a-gpios = <&pro_micro 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; a-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; b-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>; resolution = <4>;
status = "disabled"; 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 { nice_view_spi: &spi0 {
status = "okay"; cs-gpios = <&pro_micro 4 GPIO_ACTIVE_HIGH>;
};
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>;
};
};

View File

@@ -7,6 +7,8 @@
#include <dt-bindings/zmk/keys.h> #include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h> #include <dt-bindings/zmk/bt.h>
/ { / {
keymap { keymap {
compatible = "zmk,keymap"; compatible = "zmk,keymap";

View File

@@ -1,14 +1,13 @@
file_format: "1" file_format: "1"
id: ownkb id: ownkb
name: SplitKeyboard name: ownkb
type: shield type: shield
url: https://github.com/dnlbauer/splitkeyboard url: https://github.com/dnlbauer/splitkeyboard
requires: [pro_micro] requires: [pro_micro]
exposes: [i2c_oled]
features: features:
- keys - keys
- display # - display TODO remove?
- encoder # - encoder TODO use
siblings: siblings:
- ownkb_left - ownkb_left
- ownkb_right - ownkb_right

View File

@@ -1,2 +0,0 @@
# Copyright (c) 2023 The ZMK Contributors
# SPDX-License-Identifier: MIT

View File

@@ -24,6 +24,6 @@
; ;
}; };
&left_encoder { // &left_encoder {
status = "okay"; // status = "okay";
}; // };

View File

@@ -1,2 +0,0 @@
# Copyright (c) 2023 The ZMK Contributors
# SPDX-License-Identifier: MIT

View File

@@ -28,6 +28,6 @@
; ;
}; };
&right_encoder { // &right_encoder {
status = "okay"; // status = "okay";
}; // };

View File

@@ -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

View File

@@ -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