From d9829a6b49470a07471ceb525cf2d4b8ce01fd31 Mon Sep 17 00:00:00 2001 From: Nick Winans Date: Wed, 21 Sep 2022 15:36:24 -0500 Subject: [PATCH] feature(shields): Add nice!view --- app/boards/arm/nice_nano/nice_nano.dtsi | 8 +++++ .../shields/nice_view/Kconfig.defconfig | 26 +++++++++++++++++ app/boards/shields/nice_view/Kconfig.shield | 5 ++++ app/boards/shields/nice_view/nice_view.conf | 5 ++++ .../shields/nice_view/nice_view.overlay | 29 +++++++++++++++++++ .../shields/nice_view/nice_view.zmk.yml | 8 +++++ 6 files changed, 81 insertions(+) create mode 100644 app/boards/shields/nice_view/Kconfig.defconfig create mode 100644 app/boards/shields/nice_view/Kconfig.shield create mode 100644 app/boards/shields/nice_view/nice_view.conf create mode 100644 app/boards/shields/nice_view/nice_view.overlay create mode 100644 app/boards/shields/nice_view/nice_view.zmk.yml diff --git a/app/boards/arm/nice_nano/nice_nano.dtsi b/app/boards/arm/nice_nano/nice_nano.dtsi index 6c9d081c..c3e4bc1e 100644 --- a/app/boards/arm/nice_nano/nice_nano.dtsi +++ b/app/boards/arm/nice_nano/nice_nano.dtsi @@ -49,6 +49,13 @@ scl-pin = <20>; }; +&spi0 { + compatible = "nordic,nrf-spim"; + sck-pin = <20>; + mosi-pin = <17>; + miso-pin = <25>; +}; + &uart0 { compatible = "nordic,nrf-uarte"; tx-pin = <6>; @@ -63,6 +70,7 @@ }; }; +nice_view_spi: &spi0 {}; &flash0 { /* diff --git a/app/boards/shields/nice_view/Kconfig.defconfig b/app/boards/shields/nice_view/Kconfig.defconfig new file mode 100644 index 00000000..27938ee5 --- /dev/null +++ b/app/boards/shields/nice_view/Kconfig.defconfig @@ -0,0 +1,26 @@ +# Copyright (c) 2022 The ZMK Contributors +# SPDX-License-Identifier: MIT + +if SHIELD_NICE_VIEW + +config ZMK_DISPLAY + select LVGL_FONT_MONTSERRAT_26 + +if ZMK_DISPLAY + +config SPI + default y + +config LS0XX + default y + +if !ZMK_SPLIT || ZMK_SPLIT_ROLE_CENTRAL + +config ZMK_WIDGET_WPM_STATUS + default y + +endif # !ZMK_SPLIT || ZMK_SPLIT_ROLE_CENTRAL + +endif # ZMK_DISPLAY + +endif diff --git a/app/boards/shields/nice_view/Kconfig.shield b/app/boards/shields/nice_view/Kconfig.shield new file mode 100644 index 00000000..55cba788 --- /dev/null +++ b/app/boards/shields/nice_view/Kconfig.shield @@ -0,0 +1,5 @@ +# Copyright (c) 2022 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config SHIELD_NICE_VIEW + def_bool $(shields_list_contains,nice_view) diff --git a/app/boards/shields/nice_view/nice_view.conf b/app/boards/shields/nice_view/nice_view.conf new file mode 100644 index 00000000..fc19f48c --- /dev/null +++ b/app/boards/shields/nice_view/nice_view.conf @@ -0,0 +1,5 @@ +# Enable nice!view +CONFIG_ZMK_DISPLAY=y +CONFIG_SSD1306=n +CONFIG_LVGL_THEME_DEFAULT_FONT_SMALL_MONTSERRAT_26=y +CONFIG_LVGL_THEME_DEFAULT_FONT_NORMAL_MONTSERRAT_26=y diff --git a/app/boards/shields/nice_view/nice_view.overlay b/app/boards/shields/nice_view/nice_view.overlay new file mode 100644 index 00000000..f6033782 --- /dev/null +++ b/app/boards/shields/nice_view/nice_view.overlay @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +&nice_view_spi { + status = "okay"; + cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>; + + nice_view: ls0xx@0 { + compatible = "sharp,ls0xx"; + label = "DISPLAY"; + spi-max-frequency = <1000000>; + reg = <0>; + width = <160>; + height = <68>; + }; +}; + +&pro_micro_i2c { + status = "disabled"; +}; + +/ { + chosen { + zephyr,display = &nice_view; + }; +}; diff --git a/app/boards/shields/nice_view/nice_view.zmk.yml b/app/boards/shields/nice_view/nice_view.zmk.yml new file mode 100644 index 00000000..0c95d59d --- /dev/null +++ b/app/boards/shields/nice_view/nice_view.zmk.yml @@ -0,0 +1,8 @@ +file_format: "1" +id: nice_view +name: nice!view +type: shield +url: https://nicekeyboards.com/nice-view +requires: [pro_micro, i2c_oled] +features: + - display