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.
This commit is contained in:
honorless 2024-11-17 15:16:27 -05:00
parent c49abff17e
commit 96b95ad919
No known key found for this signature in database
GPG Key ID: 1B48A311ABE8DA4D
13 changed files with 27 additions and 187 deletions

View File

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

View File

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

View File

@ -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 = <NRF_PSEL(TWIM_SDA, 0, 17)>,
<NRF_PSEL(TWIM_SCL, 0, 20)>;
psels = <NRF_PSEL(SPIM_SCK, 0, 20)>,
<NRF_PSEL(SPIM_MOSI, 0, 17)>,
<NRF_PSEL(SPIM_MISO, 0, 25)>;
};
};
i2c0_sleep: i2c0_sleep {
spi0_sleep: spi0_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 17)>,
<NRF_PSEL(TWIM_SCL, 0, 20)>;
psels = <NRF_PSEL(SPIM_SCK, 0, 20)>,
<NRF_PSEL(SPIM_MOSI, 0, 17)>,
<NRF_PSEL(SPIM_MISO, 0, 25)>;
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";

View File

@ -7,7 +7,6 @@ toolchain:
- zephyr
- gnuarmemb
- xtools
ram: 40
supported:
- adc
- usb_device
@ -16,5 +15,4 @@ supported:
- pwm
- watchdog
- gpio
- i2c
- spi
- spi

View File

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

View File

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

View File

@ -1,2 +0,0 @@
config SHIELD_NICE_VIEW_ADAPTER
def_bool $(shields_list_contains,nice_view_adapter)

View File

@ -1,29 +0,0 @@
&pinctrl {
spi0_default: spi0_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 20)>,
<NRF_PSEL(SPIM_MOSI, 0, 17)>,
<NRF_PSEL(SPIM_MISO, 0, 25)>;
};
};
spi0_sleep: spi0_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 20)>,
<NRF_PSEL(SPIM_MOSI, 0, 17)>,
<NRF_PSEL(SPIM_MISO, 0, 25)>;
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";
};

View File

@ -1,29 +0,0 @@
&pinctrl {
spi0_default: spi0_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 20)>,
<NRF_PSEL(SPIM_MOSI, 0, 17)>,
<NRF_PSEL(SPIM_MISO, 0, 25)>;
};
};
spi0_sleep: spi0_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 20)>,
<NRF_PSEL(SPIM_MOSI, 0, 17)>,
<NRF_PSEL(SPIM_MISO, 0, 25)>;
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";
};

View File

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

View File

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