Skip to content

Commit

Permalink
feat: justin vip is on fire!
Browse files Browse the repository at this point in the history
  • Loading branch information
mctechnology17 committed Sep 15, 2023
1 parent c188b91 commit 6f04a8a
Show file tree
Hide file tree
Showing 17 changed files with 1,357 additions and 0 deletions.
12 changes: 12 additions & 0 deletions config/boards/shields/nice_view/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
if(CONFIG_ZMK_DISPLAY AND CONFIG_CUSTOM_WIDGET_STATUS)
zephyr_library_include_directories(${CMAKE_SOURCE_DIR}/include)
zephyr_library_sources(custom_status_screen.c)
target_sources(app PRIVATE widgets/bolt.c)
target_sources(app PRIVATE widgets/util.c)
target_sources(app PRIVATE widgets/art.c)
if(NOT CONFIG_ZMK_SPLIT OR CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
target_sources(app PRIVATE widgets/status.c)
else()
target_sources(app PRIVATE widgets/peripheral_status.c)
endif()
endif()
48 changes: 48 additions & 0 deletions config/boards/shields/nice_view/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright (c) 2023 The ZMK Contributors
# SPDX-License-Identifier: MIT

if SHIELD_NICE_VIEW

choice ZMK_DISPLAY_STATUS_SCREEN
default ZMK_DISPLAY_STATUS_SCREEN_CUSTOM
endchoice


if ZMK_DISPLAY

config LV_Z_VDB_SIZE
default 100

config LV_Z_DPI
default 161

config LV_Z_BITS_PER_PIXEL
default 1

choice LV_COLOR_DEPTH
default LV_COLOR_DEPTH_1
endchoice

endif # ZMK_DISPLAY

config CUSTOM_WIDGET_STATUS
bool "Custom status widget"
default y if ZMK_DISPLAY_STATUS_SCREEN_CUSTOM
select LV_FONT_MONTSERRAT_16
select LV_USE_IMG
select LV_USE_CANVAS

if !ZMK_SPLIT || ZMK_SPLIT_ROLE_CENTRAL

config CUSTOM_WIDGET_STATUS
select LV_FONT_MONTSERRAT_18
select LV_FONT_MONTSERRAT_14
select LV_FONT_UNSCII_16
select ZMK_WPM

endif # !ZMK_SPLIT || ZMK_SPLIT_ROLE_CENTRAL

config CUSTOM_WIDGET_INVERTED
bool "Invert custom status widget"

endif
5 changes: 5 additions & 0 deletions config/boards/shields/nice_view/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -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)
5 changes: 5 additions & 0 deletions config/boards/shields/nice_view/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# nice!view

The nice!view is a low-power, high refresh rate display meant to replace I2C OLEDs traditionally used.

This shield requires that an `&nice_view_spi` labeled SPI bus is provided with _at least_ MOSI, SCK, and CS pins defined.
29 changes: 29 additions & 0 deletions config/boards/shields/nice_view/custom_status_screen.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
*
* Copyright (c) 2023 The ZMK Contributors
* SPDX-License-Identifier: MIT
*
*/

#include "widgets/status.h"
#include "custom_status_screen.h"

#include <zephyr/logging/log.h>
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);

#if IS_ENABLED(CONFIG_CUSTOM_WIDGET_STATUS)
static struct zmk_widget_status status_widget;
#endif

lv_obj_t *zmk_display_status_screen() {

lv_obj_t *screen;
screen = lv_obj_create(NULL);

#if IS_ENABLED(CONFIG_CUSTOM_WIDGET_STATUS)
zmk_widget_status_init(&status_widget, screen);
lv_obj_align(zmk_widget_status_obj(&status_widget), LV_ALIGN_TOP_LEFT, 0, 0);
#endif

return screen;
}
12 changes: 12 additions & 0 deletions config/boards/shields/nice_view/custom_status_screen.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
*
* Copyright (c) 2023 The ZMK Contributors
* SPDX-License-Identifier: MIT
*
*/

#pragma once

#include <lvgl.h>

lv_obj_t *zmk_display_status_screen();
9 changes: 9 additions & 0 deletions config/boards/shields/nice_view/nice_view.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Enable nice!view
CONFIG_ZMK_DISPLAY=y

CONFIG_ZMK_WIDGET_BATTERY_STATUS=n
CONFIG_ZMK_WIDGET_OUTPUT_STATUS=n
CONFIG_ZMK_WIDGET_LAYER_STATUS=n
CONFIG_ZMK_WIDGET_PERIPHERAL_STATUS=n
CONFIG_LV_USE_THEME_MONO=n
CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y
23 changes: 23 additions & 0 deletions config/boards/shields/nice_view/nice_view.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright (c) 2022 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

&nice_view_spi {
status = "okay";
nice_view: ls0xx@0 {
compatible = "sharp,ls0xx";
label = "DISPLAY";
spi-max-frequency = <1000000>;
reg = <0>;
width = <160>;
height = <68>;
};
};

/ {
chosen {
zephyr,display = &nice_view;
};
};
8 changes: 8 additions & 0 deletions config/boards/shields/nice_view/nice_view.zmk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
file_format: "1"
id: nice_view
name: nice!view
type: shield
url: https://nicekeyboards.com/nice-view
requires: [nice_view_header]
features:
- display
Loading

0 comments on commit 6f04a8a

Please sign in to comment.