From 96b95ad919e970405f1c7feab2ec2e66b29394e1 Mon Sep 17 00:00:00 2001 From: honorless <86894501+lesshonor@users.noreply.github.com> Date: Sun, 17 Nov 2024 15:16:27 -0500 Subject: [PATCH] refactor: display configuration This keyboard is not offered with an I2C OLED, so no need to configure one just to immediately convert it to an SPI MIP display. --- build.yaml | 12 ++--- config/boards/arm/corne/Kconfig.defconfig | 38 ++------------- config/boards/arm/corne/corne.dtsi | 47 +++++++------------ config/boards/arm/corne/corne.yaml | 4 +- config/boards/arm/corne/corne_left_defconfig | 20 +------- config/boards/arm/corne/corne_right_defconfig | 20 +------- .../nice_view_adapter/Kconfig.defconfig | 0 .../shields/nice_view_adapter/Kconfig.shield | 2 - .../boards/corne_left.overlay | 29 ------------ .../boards/corne_right.overlay | 29 ------------ .../nice_view_adapter/nice_view_adapter.conf | 6 --- .../nice_view_adapter.overlay | 0 .../nice_view_adapter.zmk.yml | 7 --- 13 files changed, 27 insertions(+), 187 deletions(-) delete mode 100644 config/boards/shields/nice_view_adapter/Kconfig.defconfig delete mode 100644 config/boards/shields/nice_view_adapter/Kconfig.shield delete mode 100644 config/boards/shields/nice_view_adapter/boards/corne_left.overlay delete mode 100644 config/boards/shields/nice_view_adapter/boards/corne_right.overlay delete mode 100644 config/boards/shields/nice_view_adapter/nice_view_adapter.conf delete mode 100644 config/boards/shields/nice_view_adapter/nice_view_adapter.overlay delete mode 100644 config/boards/shields/nice_view_adapter/nice_view_adapter.zmk.yml diff --git a/build.yaml b/build.yaml index bb362f7..e79cfc6 100644 --- a/build.yaml +++ b/build.yaml @@ -1,10 +1,8 @@ +--- include: - - - board: nice_nano_v2 - shield: settings_reset - board: corne_left - shield: nice_view_adapter nice_view - artifact-name: corne_left_nice_view + shield: nice_view - board: corne_right - shield: nice_view_adapter nice_view - artifact-name: corne_right_nice_view + shield: nice_view + - board: corne_left + shield: settings_reset diff --git a/config/boards/arm/corne/Kconfig.defconfig b/config/boards/arm/corne/Kconfig.defconfig index 55a36f2..f4f5092 100644 --- a/config/boards/arm/corne/Kconfig.defconfig +++ b/config/boards/arm/corne/Kconfig.defconfig @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 Darryl deHaan +# Copyright (c) 2024 The ZMK Contributors # SPDX-License-Identifier: MIT # @@ -13,7 +13,6 @@ config ZMK_SPLIT_ROLE_CENTRAL endif # BOARD_CORNE_LEFT - if BOARD_CORNE_LEFT || BOARD_CORNE_RIGHT config BOARD @@ -29,7 +28,7 @@ config BOARD_ENABLE_DCDC_HV default y select SOC_DCDC_NRF52X_HV depends on (BOARD_CORNE_LEFT || BOARD_CORNE_RIGHT) - + config ZMK_SPLIT default y @@ -47,38 +46,6 @@ config USB_DEVICE_STACK endif # USB -if ZMK_DISPLAY - -config I2C - default y - -config SSD1306 - default y - -choice ZMK_DISPLAY_WORK_QUEUE - default ZMK_DISPLAY_WORK_QUEUE_DEDICATED -endchoice - -endif - -if SSD1306 - -config LV_Z_VDB_SIZE - default 64 - -config LV_DPI_DEF - default 148 - -config LV_Z_BITS_PER_PIXEL - default 1 - -choice LV_COLOR_DEPTH - default LV_COLOR_DEPTH_1 -endchoice - -endif - -endif # BOARD_CORNE_LEFT || BOARD_CORNE_RIGHT if ZMK_BACKLIGHT config PWM @@ -89,3 +56,4 @@ config LED_PWM endif # ZMK_BACKLIGHT +endif # BOARD_CORNE_LEFT || BOARD_CORNE_RIGHT diff --git a/config/boards/arm/corne/corne.dtsi b/config/boards/arm/corne/corne.dtsi index 4f9c487..96b77d6 100644 --- a/config/boards/arm/corne/corne.dtsi +++ b/config/boards/arm/corne/corne.dtsi @@ -1,6 +1,6 @@ /* * -* Copyright (c) 2021 Darryl deHaan +* Copyright (c) 2024 The ZMK Contributors * SPDX-License-Identifier: MIT * */ @@ -19,7 +19,6 @@ zephyr,sram = &sram0; zephyr,flash = &flash0; zmk,kscan = &kscan0; - zephyr,display = &oled; zephyr,console = &cdc_acm_uart; zmk,underglow = &led_strip; zmk,matrix-transform = &default_transform; @@ -113,17 +112,19 @@ }; &pinctrl { - i2c0_default: i2c0_default { + spi0_default: spi0_default { group1 { - psels = , - ; + psels = , + , + ; }; }; - i2c0_sleep: i2c0_sleep { + spi0_sleep: spi0_sleep { group1 { - psels = , - ; + psels = , + , + ; low-power-enable; }; }; @@ -142,34 +143,18 @@ }; }; -&i2c0 { - status = "okay"; - - compatible = "nordic,nrf-twi"; - pinctrl-0 = <&i2c0_default>; - pinctrl-1 = <&i2c0_sleep>; - pinctrl-names = "default", "sleep"; - 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 { + compatible = "nordic,nrf-spim"; + pinctrl-0 = <&spi0_default>; + pinctrl-1 = <&spi0_sleep>; + pinctrl-names = "default", "sleep"; + cs-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; }; &spi3 { - compatible = "nordic,nrf-spim"; status = "okay"; + compatible = "nordic,nrf-spim"; pinctrl-0 = <&spi3_default>; pinctrl-1 = <&spi3_sleep>; pinctrl-names = "default", "sleep"; diff --git a/config/boards/arm/corne/corne.yaml b/config/boards/arm/corne/corne.yaml index a98a8b8..65d6300 100644 --- a/config/boards/arm/corne/corne.yaml +++ b/config/boards/arm/corne/corne.yaml @@ -7,7 +7,6 @@ toolchain: - zephyr - gnuarmemb - xtools -ram: 40 supported: - adc - usb_device @@ -16,5 +15,4 @@ supported: - pwm - watchdog - gpio - - i2c - - spi \ No newline at end of file + - spi diff --git a/config/boards/arm/corne/corne_left_defconfig b/config/boards/arm/corne/corne_left_defconfig index 6a37a2a..30a26b0 100644 --- a/config/boards/arm/corne/corne_left_defconfig +++ b/config/boards/arm/corne/corne_left_defconfig @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 Darryl deHaan +# Copyright (c) 2024 The ZMK Contributors # SPDX-License-Identifier: MIT # @@ -43,24 +43,6 @@ CONFIG_CLOCK_CONTROL_NRF_K32SRC_30PPM=y CONFIG_ZMK_USB=y CONFIG_ZMK_BLE=y -# enable display drivers -CONFIG_ZMK_DISPLAY=y - - - -#CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y -#CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=2048 -#CONFIG_LV_Z_BITS_PER_PIXEL=1 -#CONFIG_LV_COLOR_DEPTH_1=y -#CONFIG_LV_DPI_DEF=145 -#CONFIG_LV_Z_VDB_SIZE=100 -#CONFIG_LV_USE_THEME_MONO=y -#CONFIG_LV_COLOR_CHROMA_KEY_HEX=0x00FF00 -#CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_16=y -#CONFIG_LV_FONT_MONTSERRAT_26=y -#CONFIG_LV_FONT_DEFAULT_MONTSERRAT_26=y - - #EXT POWER CONFIG_ZMK_EXT_POWER=y diff --git a/config/boards/arm/corne/corne_right_defconfig b/config/boards/arm/corne/corne_right_defconfig index 51901fa..dca513b 100644 --- a/config/boards/arm/corne/corne_right_defconfig +++ b/config/boards/arm/corne/corne_right_defconfig @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 Darryl deHaan +# Copyright (c) 2024 The ZMK Contributors # SPDX-License-Identifier: MIT # @@ -42,24 +42,6 @@ CONFIG_CLOCK_CONTROL_NRF_K32SRC_30PPM=y CONFIG_ZMK_USB=n CONFIG_ZMK_BLE=y -# enable display drivers -CONFIG_ZMK_DISPLAY=y - - - - -#CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y -#CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=2048 -#CONFIG_LV_Z_BITS_PER_PIXEL=1 -#CONFIG_LV_COLOR_DEPTH_1=y -#CONFIG_LV_DPI_DEF=145 -#CONFIG_LV_Z_VDB_SIZE=100 -#CONFIG_LV_USE_THEME_MONO=y -#CONFIG_LV_COLOR_CHROMA_KEY_HEX=0x00FF00 -#CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_16=y -#CONFIG_LV_FONT_MONTSERRAT_26=y -#CONFIG_LV_FONT_DEFAULT_MONTSERRAT_26=y - #EXT POWER CONFIG_ZMK_EXT_POWER=y diff --git a/config/boards/shields/nice_view_adapter/Kconfig.defconfig b/config/boards/shields/nice_view_adapter/Kconfig.defconfig deleted file mode 100644 index e69de29..0000000 diff --git a/config/boards/shields/nice_view_adapter/Kconfig.shield b/config/boards/shields/nice_view_adapter/Kconfig.shield deleted file mode 100644 index e465bd0..0000000 --- a/config/boards/shields/nice_view_adapter/Kconfig.shield +++ /dev/null @@ -1,2 +0,0 @@ -config SHIELD_NICE_VIEW_ADAPTER - def_bool $(shields_list_contains,nice_view_adapter) \ No newline at end of file diff --git a/config/boards/shields/nice_view_adapter/boards/corne_left.overlay b/config/boards/shields/nice_view_adapter/boards/corne_left.overlay deleted file mode 100644 index 982bc32..0000000 --- a/config/boards/shields/nice_view_adapter/boards/corne_left.overlay +++ /dev/null @@ -1,29 +0,0 @@ -&pinctrl { - spi0_default: spi0_default { - group1 { - psels = , - , - ; - }; - }; - spi0_sleep: spi0_sleep { - group1 { - psels = , - , - ; - low-power-enable; - }; - }; -}; - -nice_view_spi: &spi0 { - compatible = "nordic,nrf-spim"; - pinctrl-0 = <&spi0_default>; - pinctrl-1 = <&spi0_sleep>; - pinctrl-names = "default", "sleep"; - cs-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; -}; - -&i2c0 { - status = "disabled"; -}; \ No newline at end of file diff --git a/config/boards/shields/nice_view_adapter/boards/corne_right.overlay b/config/boards/shields/nice_view_adapter/boards/corne_right.overlay deleted file mode 100644 index 982bc32..0000000 --- a/config/boards/shields/nice_view_adapter/boards/corne_right.overlay +++ /dev/null @@ -1,29 +0,0 @@ -&pinctrl { - spi0_default: spi0_default { - group1 { - psels = , - , - ; - }; - }; - spi0_sleep: spi0_sleep { - group1 { - psels = , - , - ; - low-power-enable; - }; - }; -}; - -nice_view_spi: &spi0 { - compatible = "nordic,nrf-spim"; - pinctrl-0 = <&spi0_default>; - pinctrl-1 = <&spi0_sleep>; - pinctrl-names = "default", "sleep"; - cs-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; -}; - -&i2c0 { - status = "disabled"; -}; \ No newline at end of file diff --git a/config/boards/shields/nice_view_adapter/nice_view_adapter.conf b/config/boards/shields/nice_view_adapter/nice_view_adapter.conf deleted file mode 100644 index 07872d2..0000000 --- a/config/boards/shields/nice_view_adapter/nice_view_adapter.conf +++ /dev/null @@ -1,6 +0,0 @@ -CONFIG_SSD1306=n -# Enable Nice View -#CONFIG_ZMK_DISPLAY_STATUS_SCREEN_BUILT_IN=y -#CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_26=y -#CONFIG_LV_FONT_DEFAULT_MONTSERRAT_26=y -CONFIG_ZMK_DISPLAY_STATUS_SCREEN_CUSTOM=y \ No newline at end of file diff --git a/config/boards/shields/nice_view_adapter/nice_view_adapter.overlay b/config/boards/shields/nice_view_adapter/nice_view_adapter.overlay deleted file mode 100644 index e69de29..0000000 diff --git a/config/boards/shields/nice_view_adapter/nice_view_adapter.zmk.yml b/config/boards/shields/nice_view_adapter/nice_view_adapter.zmk.yml deleted file mode 100644 index 3d44235..0000000 --- a/config/boards/shields/nice_view_adapter/nice_view_adapter.zmk.yml +++ /dev/null @@ -1,7 +0,0 @@ -file_format: "1" -id: nice_view_adapter -name: nice!view adapter -type: shield -url: https://nicekeyboards.com/nice-view -requires: [i2c_oled] -exposes: [nice_view_header] \ No newline at end of file