From 5167d96a0c46a120f30785b0c97420d47f13c57c Mon Sep 17 00:00:00 2001 From: "Chow Castro, Marcos" Date: Thu, 19 Dec 2024 22:34:28 +0100 Subject: [PATCH] nice!oled support, dongle_display support, readme updated --- CHANGELOG.txt | 7 +- README.md | 57 ++- .../shields/corne/corne_dongle_xiao.overlay | 14 +- boards/shields/dongle_display/CMakeLists.txt | 18 - .../shields/dongle_display/Kconfig.defconfig | 41 -- boards/shields/dongle_display/Kconfig.shield | 5 - .../dongle_display/custom_status_screen.c | 63 --- .../dongle_display/custom_status_screen.h | 12 - .../dongle_display/dongle_display.conf | 17 - .../dongle_display/dongle_display.overlay | 5 - .../dongle_display/dongle_display.zmk.yml | 7 - .../dongle_display/widgets/battery_status.c | 115 ------ .../dongle_display/widgets/battery_status.h | 18 - .../dongle_display/widgets/bongo_cat.c | 148 ------- .../dongle_display/widgets/bongo_cat.h | 19 - .../dongle_display/widgets/bongo_cat_images.c | 383 ------------------ .../dongle_display/widgets/hid_indicators.c | 81 ---- .../dongle_display/widgets/hid_indicators.h | 18 - .../dongle_display/widgets/layer_status.c | 70 ---- .../dongle_display/widgets/layer_status.h | 18 - .../dongle_display/widgets/modifiers.c | 159 -------- .../dongle_display/widgets/modifiers.h | 21 - .../dongle_display/widgets/modifiers_sym.c | 215 ---------- .../dongle_display/widgets/output_status.c | 207 ---------- .../dongle_display/widgets/output_status.h | 18 - .../widgets/output_status_sym.c | 231 ----------- build.yaml | 95 +++-- config/west.yml | 28 +- 28 files changed, 135 insertions(+), 1955 deletions(-) delete mode 100644 boards/shields/dongle_display/CMakeLists.txt delete mode 100644 boards/shields/dongle_display/Kconfig.defconfig delete mode 100644 boards/shields/dongle_display/Kconfig.shield delete mode 100644 boards/shields/dongle_display/custom_status_screen.c delete mode 100644 boards/shields/dongle_display/custom_status_screen.h delete mode 100644 boards/shields/dongle_display/dongle_display.conf delete mode 100644 boards/shields/dongle_display/dongle_display.overlay delete mode 100644 boards/shields/dongle_display/dongle_display.zmk.yml delete mode 100644 boards/shields/dongle_display/widgets/battery_status.c delete mode 100644 boards/shields/dongle_display/widgets/battery_status.h delete mode 100644 boards/shields/dongle_display/widgets/bongo_cat.c delete mode 100644 boards/shields/dongle_display/widgets/bongo_cat.h delete mode 100644 boards/shields/dongle_display/widgets/bongo_cat_images.c delete mode 100644 boards/shields/dongle_display/widgets/hid_indicators.c delete mode 100644 boards/shields/dongle_display/widgets/hid_indicators.h delete mode 100644 boards/shields/dongle_display/widgets/layer_status.c delete mode 100644 boards/shields/dongle_display/widgets/layer_status.h delete mode 100644 boards/shields/dongle_display/widgets/modifiers.c delete mode 100644 boards/shields/dongle_display/widgets/modifiers.h delete mode 100644 boards/shields/dongle_display/widgets/modifiers_sym.c delete mode 100644 boards/shields/dongle_display/widgets/output_status.c delete mode 100644 boards/shields/dongle_display/widgets/output_status.h delete mode 100644 boards/shields/dongle_display/widgets/output_status_sym.c diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 94c06aa..fd8c3ab 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,8 +1,13 @@ Changelog file for Structures extra. https://github.com/mctechnology17/zmk-config/blob/main/CHANGELOG.txt -# FEATURES 0.0.2-beta1 (Nov 08, 2024) +# FEATURES 0.0.2-beta1 (Dec 19, 2024) ======================================= ++ NEW FEATURES +- [x] nice!oled support +- [x] dongle_display as modul support +- [x] oled display changed 128x32 to 128x64 for xiao +- [x] readme updated # FEATURES 0.0.1-beta1 (Aug 22, 2024) ======================================= diff --git a/README.md b/README.md index 27efedb..d9f648f 100644 --- a/README.md +++ b/README.md @@ -28,12 +28,34 @@ ---- -If you already have your corne configured with this repository and want to make +- If you already have your corne configured with this repository and want to make a modification to your keymap, you can do it with the online [ZMK-STUDIO](https://zmk.studio/). -If you already have your corne configured with this repository and want to make +- If you already have your corne configured with this repository and want to make a modification to your keymap, you can do it with the online [keymap-editor](https://nickcoutsos.github.io/keymap-editor/). +- If you already have a repository and you want only the dongle option of this repository with support for `zmk-studio`, just add this repository as a module to your configuration, here is a basic example (just copy and paste into your file `west.yml`): + +```yaml +manifest: + remotes: + - name: zmkfirmware + url-base: https://github.com/zmkfirmware + # include corne with dongle pro_micro and xiao compatible + - name: mctechnology17 + url-base: https://github.com/mctechnology17 + projects: + - name: zmk + remote: zmkfirmware + revision: main + import: app/west.yml + # include corne with dongle pro_micro and xiao compatible + - name: zmk-config + remote: mctechnology17 + revision: main + self: + path: config +``` # INTRO @@ -111,7 +133,7 @@ peripherals), **[nice_nano_v2]** (used as a dongle and as peripherals), > by default they are all activated. -### zmk-studio +### zmk-studio (quick start) This repository includes the necessary configuration to use zmk-studio without the need to configure anything else. You just have to follow the steps below: - fork this repository y flash the firmware to the keyboard with the uf2 files (see as below en normal procedure) @@ -166,16 +188,6 @@ documentation. Example of an advanced configuration hier -> [^4] -Below is a list of features currently included in this branch[^5] _on top of_ -the official ZMK master branch. - -- **pointer movement/scrolling** - PR #2027 -- **tri-state (aka swapper)** - PR [#1366](https://github.com/zmkfirmware/zmk/pull/1366) -- **smart-word** (PR [#1451](https://github.com/zmkfirmware/zmk/pull/1451)) -- **on-release-for-tap-preferred** - [tweak](https://github.com/celejewski/zmk/commit/d7a8482712d87963e59b74238667346221199293) by Andrzej -- **zen-tweaks** - [display & battery improvements](https://github.com/caksoylar/zmk/tree/caksoylar/zen-v1%2Bv2) by Cem Aksoylar - - 1. Clone _your fork_ of this repository. ```bash @@ -469,13 +481,13 @@ host OS, app/browser details, keyboard used, link to your config repo, etc. # MODULE INTEGRATION > [!TIP] > -> 1. You can activate or deactivate the animation with: CONFIG_NICE_VIEW_GEM_ANIMATION=n -> the animation is not activated by default in this repository for saving -> battery. This is activated only in the peripheries and the corne master, not -> in the dongles, because this module shows the status of the batteries in the -> peripheries +> 1. Remember that animations consume energy, so if you want to conserve your battery, turn off the animations! +> 2. Please consult the documentation of each module that you are going to use, here I leave you the links for each one. -See module details here for more information and more configurations: [nice-view-gem](https://github.com/M165437/nice-view-gem) +See module details here for more information and more configurations: +- [nice_view_gem](https://github.com/M165437/nice-view-gem) +- [nice_oled](https://github.com/mctechnology17/zmk-nice-oled) +- [dongle_display](https://github.com/englmaxi/zmk-dongle-display) # INSPIRATIONS @@ -487,6 +499,13 @@ See module details here for more information and more configurations: [nice-view - [urob/zmk-config](https://github.com/urob/zmk-config) # MY OTHER PROJECTS: +- [nice!oled](https://github.com/mctechnology17/zmk-nice-oled): nice_oled + vertical widgets for oled screens with zmk (for split and non-split + keyboards) +- [dongle_display!view](https://github.com/mctechnology17/zmk-dongle-display-view): This is a mix between display_dongle and nice!view that allows you to use the nice!view display with your dongle. +- [oled_adapter](https://github.com/mctechnology17/zmk-oled-adapter): This + module is an adapter for 128x32, 128x64 and 128x128 OLED screens, to be used + on keyboards with ZMK without having to modify the shields of the keyboards. - [qmk-config] will be updated soon - [qmk_userspace] will be updated soon - [vimtools] swiss army knife for vim (features and settings that will make your life easier) diff --git a/boards/shields/corne/corne_dongle_xiao.overlay b/boards/shields/corne/corne_dongle_xiao.overlay index ee33b01..7b09f4c 100644 --- a/boards/shields/corne/corne_dongle_xiao.overlay +++ b/boards/shields/corne/corne_dongle_xiao.overlay @@ -79,22 +79,24 @@ RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10 // TODO: per-key RGB node(s)? }; +// 128x64 OLED &xiao_i2c { status = "okay"; - oled: sh1106@3c { - compatible = "sinowealth,sh1106"; + + oled: ssd1306@3c { + compatible = "solomon,ssd1306fb"; reg = <0x3c>; - width = <120>; - height = <128>; + width = <128>; + height = <64>; segment-offset = <0>; page-offset = <0>; display-offset = <0>; - multiplex-ratio = <119>; + multiplex-ratio = <63>; segment-remap; com-invdir; inversion-on; prechargep = <0x22>; - }; + }; }; /* diff --git a/boards/shields/dongle_display/CMakeLists.txt b/boards/shields/dongle_display/CMakeLists.txt deleted file mode 100644 index dd4e60f..0000000 --- a/boards/shields/dongle_display/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -if(CONFIG_ZMK_DISPLAY AND CONFIG_ZMK_DISPLAY_STATUS_SCREEN_CUSTOM AND ((NOT CONFIG_ZMK_SPLIT) OR CONFIG_ZMK_SPLIT_ROLE_CENTRAL)) - zephyr_library() - zephyr_library_sources(${ZEPHYR_BASE}/misc/empty_file.c) - zephyr_library_include_directories(${ZEPHYR_LVGL_MODULE_DIR}) - zephyr_library_include_directories(${ZEPHYR_BASE}/lib/gui/lvgl/) - zephyr_library_include_directories(${ZEPHYR_BASE}/drivers) - zephyr_library_include_directories(${CMAKE_SOURCE_DIR}/include) - zephyr_library_sources(custom_status_screen.c) - zephyr_library_sources(widgets/battery_status.c) - zephyr_library_sources(widgets/bongo_cat.c) - zephyr_library_sources(widgets/bongo_cat_images.c) - target_sources_ifdef(CONFIG_ZMK_HID_INDICATORS app PRIVATE widgets/hid_indicators.c) - zephyr_library_sources(widgets/layer_status.c) - zephyr_library_sources(widgets/modifiers.c) - zephyr_library_sources(widgets/modifiers_sym.c) - zephyr_library_sources(widgets/output_status.c) - zephyr_library_sources(widgets/output_status_sym.c) -endif() diff --git a/boards/shields/dongle_display/Kconfig.defconfig b/boards/shields/dongle_display/Kconfig.defconfig deleted file mode 100644 index 03e87c8..0000000 --- a/boards/shields/dongle_display/Kconfig.defconfig +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2024 The ZMK Contributors -# SPDX-License-Identifier: MIT - -if SHIELD_DONGLE_DISPLAY - -choice ZMK_DISPLAY_STATUS_SCREEN - default ZMK_DISPLAY_STATUS_SCREEN_CUSTOM -endchoice - -config ZMK_DISPLAY_STATUS_SCREEN_CUSTOM - select LV_USE_LABEL - select LV_USE_IMG - select LV_USE_CANVAS - select LV_USE_ANIMIMG - select LV_USE_ANIMATION - select LV_USE_LINE - select LV_FONT_UNSCII_8 - select ZMK_WPM - imply ZMK_HID_INDICATORS - -choice ZMK_DISPLAY_WORK_QUEUE - default ZMK_DISPLAY_WORK_QUEUE_DEDICATED -endchoice - -config LV_Z_MEM_POOL_SIZE - default 8192 - -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 diff --git a/boards/shields/dongle_display/Kconfig.shield b/boards/shields/dongle_display/Kconfig.shield deleted file mode 100644 index d99dd81..0000000 --- a/boards/shields/dongle_display/Kconfig.shield +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2024 The ZMK Contributors -# SPDX-License-Identifier: MIT - -config SHIELD_DONGLE_DISPLAY - def_bool $(shields_list_contains,dongle_display) \ No newline at end of file diff --git a/boards/shields/dongle_display/custom_status_screen.c b/boards/shields/dongle_display/custom_status_screen.c deleted file mode 100644 index 00bbf4e..0000000 --- a/boards/shields/dongle_display/custom_status_screen.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2024 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#include "custom_status_screen.h" -#include "widgets/battery_status.h" -#include "widgets/modifiers.h" -#include "widgets/bongo_cat.h" -#include "widgets/layer_status.h" -#include "widgets/output_status.h" -#include "widgets/hid_indicators.h" - -#include -LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); - -static struct zmk_widget_output_status output_status_widget; -static struct zmk_widget_layer_status layer_status_widget; -static struct zmk_widget_peripheral_battery_status peripheral_battery_status_widget; -static struct zmk_widget_modifiers modifiers_widget; -static struct zmk_widget_bongo_cat bongo_cat_widget; - -#if IS_ENABLED(CONFIG_ZMK_HID_INDICATORS) -static struct zmk_widget_hid_indicators hid_indicators_widget; -#endif - -lv_style_t global_style; - -lv_obj_t *zmk_display_status_screen() { - lv_obj_t *screen; - - screen = lv_obj_create(NULL); - - lv_style_init(&global_style); - lv_style_set_text_font(&global_style, &lv_font_unscii_8); - lv_style_set_text_letter_space(&global_style, 1); - lv_style_set_text_line_space(&global_style, 1); - lv_obj_add_style(screen, &global_style, LV_PART_MAIN); - - zmk_widget_output_status_init(&output_status_widget, screen); - lv_obj_align(zmk_widget_output_status_obj(&output_status_widget), LV_ALIGN_TOP_LEFT, 0, 0); - - zmk_widget_bongo_cat_init(&bongo_cat_widget, screen); - lv_obj_align(zmk_widget_bongo_cat_obj(&bongo_cat_widget), LV_ALIGN_BOTTOM_RIGHT, 0, -7); - - zmk_widget_modifiers_init(&modifiers_widget, screen); - lv_obj_align(zmk_widget_modifiers_obj(&modifiers_widget), LV_ALIGN_BOTTOM_LEFT, 0, 0); - - #if IS_ENABLED(CONFIG_ZMK_HID_INDICATORS) - zmk_widget_hid_indicators_init(&hid_indicators_widget, screen); - lv_obj_align_to(zmk_widget_hid_indicators_obj(&hid_indicators_widget), zmk_widget_modifiers_obj(&modifiers_widget), LV_ALIGN_OUT_TOP_LEFT, 0, -2); - #endif - - zmk_widget_layer_status_init(&layer_status_widget, screen); - // lv_obj_align(zmk_widget_layer_status_obj(&layer_status_widget), LV_ALIGN_BOTTOM_LEFT, 2, -18); - lv_obj_align_to(zmk_widget_layer_status_obj(&layer_status_widget), zmk_widget_bongo_cat_obj(&bongo_cat_widget), LV_ALIGN_BOTTOM_LEFT, 0, 5); - - zmk_widget_peripheral_battery_status_init(&peripheral_battery_status_widget, screen); - lv_obj_align(zmk_widget_peripheral_battery_status_obj(&peripheral_battery_status_widget), LV_ALIGN_TOP_RIGHT, 0, 0); - - return screen; -} \ No newline at end of file diff --git a/boards/shields/dongle_display/custom_status_screen.h b/boards/shields/dongle_display/custom_status_screen.h deleted file mode 100644 index 3a01be1..0000000 --- a/boards/shields/dongle_display/custom_status_screen.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * - * Copyright (c) 2024 The ZMK Contributors - * SPDX-License-Identifier: MIT - * - */ - -#pragma once - -#include - -lv_obj_t *zmk_display_status_screen(); \ No newline at end of file diff --git a/boards/shields/dongle_display/dongle_display.conf b/boards/shields/dongle_display/dongle_display.conf deleted file mode 100644 index b22c7b1..0000000 --- a/boards/shields/dongle_display/dongle_display.conf +++ /dev/null @@ -1,17 +0,0 @@ -CONFIG_ZMK_DISPLAY=y -CONFIG_BT_BAS=n -CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING=y -# The battery power report interval unit is seconds -CONFIG_ZMK_BATTERY_REPORT_INTERVAL=60 -CONFIG_ZMK_SLEEP=n -# 1800000 milliseconds = 30 minutes * 60 seconds * 1000 -# CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=3600000 -# number of milliseconds of inactivity before entering idle state -CONFIG_ZMK_IDLE_TIMEOUT=60000 -# add keyboard bounce -# CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS=5 -# CONFIG_ZMK_KSCAN_DEBOUNCE_RELEASE_MS=5 -# Increase the transmission power of the keyboard ble radio to solve -# the problem of left and right delay and poor communication. -CONFIG_BT_CTLR_TX_PWR_PLUS_8=y -CONFIG_ZMK_MOUSE=y diff --git a/boards/shields/dongle_display/dongle_display.overlay b/boards/shields/dongle_display/dongle_display.overlay deleted file mode 100644 index 3385843..0000000 --- a/boards/shields/dongle_display/dongle_display.overlay +++ /dev/null @@ -1,5 +0,0 @@ -/* - * Copyright (c) 2024 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ \ No newline at end of file diff --git a/boards/shields/dongle_display/dongle_display.zmk.yml b/boards/shields/dongle_display/dongle_display.zmk.yml deleted file mode 100644 index d241369..0000000 --- a/boards/shields/dongle_display/dongle_display.zmk.yml +++ /dev/null @@ -1,7 +0,0 @@ -file_format: "1" -id: dongle_display -name: dongle_display -type: shield -url: https://github.com/englmaxi/zmk-config -requires: - - i2c_oled diff --git a/boards/shields/dongle_display/widgets/battery_status.c b/boards/shields/dongle_display/widgets/battery_status.c deleted file mode 100644 index 10d1212..0000000 --- a/boards/shields/dongle_display/widgets/battery_status.c +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2024 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#include -#include - -#include -LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); - -#include -#include -#include -#include -#include -#include -#include - -#include "battery_status.h" - -static sys_slist_t widgets = SYS_SLIST_STATIC_INIT(&widgets); - -struct peripheral_battery_state { - uint8_t source; - uint8_t level; -}; - -static lv_color_t battery_image_buffer[ZMK_SPLIT_BLE_PERIPHERAL_COUNT][5 * 8]; - -static void draw_battery(lv_obj_t *canvas, uint8_t level) { - lv_canvas_fill_bg(canvas, lv_color_black(), LV_OPA_COVER); - - lv_draw_rect_dsc_t rect_fill_dsc; - lv_draw_rect_dsc_init(&rect_fill_dsc); - rect_fill_dsc.bg_color = lv_color_white(); - - lv_canvas_set_px(canvas, 0, 0, lv_color_white()); - lv_canvas_set_px(canvas, 4, 0, lv_color_white()); - - if (level > 90) { - // full - } else if (level > 70) { - lv_canvas_draw_rect(canvas, 1, 2, 3, 1, &rect_fill_dsc); - } else if (level > 50) { - lv_canvas_draw_rect(canvas, 1, 2, 3, 2, &rect_fill_dsc); - } else if (level > 30) { - lv_canvas_draw_rect(canvas, 1, 2, 3, 3, &rect_fill_dsc); - } else if (level > 10) { - lv_canvas_draw_rect(canvas, 1, 2, 3, 4, &rect_fill_dsc); - } else { - lv_canvas_draw_rect(canvas, 1, 2, 3, 5, &rect_fill_dsc); - } -} - -static void set_battery_symbol(lv_obj_t *widget, struct peripheral_battery_state state) { - lv_obj_t *symbol = lv_obj_get_child(widget, state.source * 2); - lv_obj_t *label = lv_obj_get_child(widget, state.source * 2 + 1); - - draw_battery(symbol, state.level); - lv_label_set_text_fmt(label, "%3u%%", state.level); - - if (state.level > 0) { - lv_obj_clear_flag(symbol, LV_OBJ_FLAG_HIDDEN); - lv_obj_clear_flag(label, LV_OBJ_FLAG_HIDDEN); - } else { - lv_obj_add_flag(symbol, LV_OBJ_FLAG_HIDDEN); - lv_obj_add_flag(label, LV_OBJ_FLAG_HIDDEN); - } -} - -void battery_status_update_cb(struct peripheral_battery_state state) { - struct zmk_widget_battery_status *widget; - SYS_SLIST_FOR_EACH_CONTAINER(&widgets, widget, node) { set_battery_symbol(widget->obj, state); } -} - -static struct peripheral_battery_state battery_status_get_state(const zmk_event_t *eh) { - const struct zmk_peripheral_battery_state_changed *ev = as_zmk_peripheral_battery_state_changed(eh); - return (struct peripheral_battery_state){ - .source = ev->source, - .level = ev->state_of_charge, - }; -} - -ZMK_DISPLAY_WIDGET_LISTENER(widget_battery_status, struct peripheral_battery_state, - battery_status_update_cb, battery_status_get_state) - -ZMK_SUBSCRIPTION(widget_battery_status, zmk_peripheral_battery_state_changed); - -int zmk_widget_peripheral_battery_status_init(struct zmk_widget_peripheral_battery_status *widget, lv_obj_t *parent) { - widget->obj = lv_obj_create(parent); - - lv_obj_set_size(widget->obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); - - for (int i = 0; i < ZMK_SPLIT_BLE_PERIPHERAL_COUNT; i++) { - lv_obj_t *image_canvas = lv_canvas_create(widget->obj); - lv_obj_t *battery_label = lv_label_create(widget->obj); - - lv_canvas_set_buffer(image_canvas, battery_image_buffer[i], 5, 8, LV_IMG_CF_TRUE_COLOR); - - lv_obj_align(image_canvas, LV_ALIGN_TOP_RIGHT, 0, i * 10); - lv_obj_align(battery_label, LV_ALIGN_TOP_RIGHT, -7, i * 10); - } - - sys_slist_append(&widgets, &widget->node); - - widget_battery_status_init(); - - return 0; -} - -lv_obj_t *zmk_widget_peripheral_battery_status_obj(struct zmk_widget_peripheral_battery_status *widget) { - return widget->obj; -} diff --git a/boards/shields/dongle_display/widgets/battery_status.h b/boards/shields/dongle_display/widgets/battery_status.h deleted file mode 100644 index 1affb8d..0000000 --- a/boards/shields/dongle_display/widgets/battery_status.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2024 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#pragma once - -#include -#include - -struct zmk_widget_peripheral_battery_status { - sys_snode_t node; - lv_obj_t *obj; -}; - -int zmk_widget_peripheral_battery_status_init(struct zmk_widget_peripheral_battery_status *widget, lv_obj_t *parent); -lv_obj_t *zmk_widget_peripheral_battery_status_obj(struct zmk_widget_peripheral_battery_status *widget); \ No newline at end of file diff --git a/boards/shields/dongle_display/widgets/bongo_cat.c b/boards/shields/dongle_display/widgets/bongo_cat.c deleted file mode 100644 index acfd033..0000000 --- a/boards/shields/dongle_display/widgets/bongo_cat.c +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (c) 2024 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#include -#include - -#include -LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); - -#include -#include -#include -#include - -#include "bongo_cat.h" - -#define SRC(array) (const void **)array, sizeof(array) / sizeof(lv_img_dsc_t *) - -static sys_slist_t widgets = SYS_SLIST_STATIC_INIT(&widgets); - -LV_IMG_DECLARE(bongo_cat_none); -LV_IMG_DECLARE(bongo_cat_left1); -LV_IMG_DECLARE(bongo_cat_left2); -LV_IMG_DECLARE(bongo_cat_right1); -LV_IMG_DECLARE(bongo_cat_right2); -LV_IMG_DECLARE(bongo_cat_both1); -LV_IMG_DECLARE(bongo_cat_both1_open); -LV_IMG_DECLARE(bongo_cat_both2); - -#define ANIMATION_SPEED_IDLE 10000 -const lv_img_dsc_t *idle_imgs[] = { - &bongo_cat_both1_open, - &bongo_cat_both1_open, - &bongo_cat_both1_open, - &bongo_cat_both1, -}; - -#define ANIMATION_SPEED_SLOW 2000 -const lv_img_dsc_t *slow_imgs[] = { - &bongo_cat_left1, - &bongo_cat_both1, - &bongo_cat_both1, - &bongo_cat_right1, - &bongo_cat_both1, - &bongo_cat_both1, - &bongo_cat_left1, - &bongo_cat_both1, - &bongo_cat_both1, -}; - -#define ANIMATION_SPEED_MID 500 -const lv_img_dsc_t *mid_imgs[] = { - &bongo_cat_left2, - &bongo_cat_left1, - &bongo_cat_none, - &bongo_cat_right2, - &bongo_cat_right1, - &bongo_cat_none, -}; - -#define ANIMATION_SPEED_FAST 200 -const lv_img_dsc_t *fast_imgs[] = { - &bongo_cat_both2, - &bongo_cat_both1, - &bongo_cat_none, - &bongo_cat_none, -}; - -struct bongo_cat_wpm_status_state { - uint8_t wpm; -}; - -enum anim_state { - anim_state_none, - anim_state_idle, - anim_state_slow, - anim_state_mid, - anim_state_fast -} current_anim_state; - -static void set_animation(lv_obj_t *animing, struct bongo_cat_wpm_status_state state) { - if (state.wpm < 5) { - if (current_anim_state != anim_state_idle) { - lv_animimg_set_src(animing, SRC(idle_imgs)); - lv_animimg_set_duration(animing, ANIMATION_SPEED_IDLE); - lv_animimg_set_repeat_count(animing, LV_ANIM_REPEAT_INFINITE); - lv_animimg_start(animing); - current_anim_state = anim_state_idle; - } - } else if (state.wpm < 30) { - if (current_anim_state != anim_state_slow) { - lv_animimg_set_src(animing, SRC(slow_imgs)); - lv_animimg_set_duration(animing, ANIMATION_SPEED_SLOW); - lv_animimg_set_repeat_count(animing, LV_ANIM_REPEAT_INFINITE); - lv_animimg_start(animing); - current_anim_state = anim_state_slow; - } - } else if (state.wpm < 70) { - if (current_anim_state != anim_state_mid) { - lv_animimg_set_src(animing, SRC(mid_imgs)); - lv_animimg_set_duration(animing, ANIMATION_SPEED_MID); - lv_animimg_set_repeat_count(animing, LV_ANIM_REPEAT_INFINITE); - lv_animimg_start(animing); - current_anim_state = anim_state_mid; - } - } else { - if (current_anim_state != anim_state_fast) { - lv_animimg_set_src(animing, SRC(fast_imgs)); - lv_animimg_set_duration(animing, ANIMATION_SPEED_FAST); - lv_animimg_set_repeat_count(animing, LV_ANIM_REPEAT_INFINITE); - lv_animimg_start(animing); - current_anim_state = anim_state_fast; - } - } -} - -struct bongo_cat_wpm_status_state bongo_cat_wpm_status_get_state(const zmk_event_t *eh) { - struct zmk_wpm_state_changed *ev = as_zmk_wpm_state_changed(eh); - return (struct bongo_cat_wpm_status_state) { .wpm = ev->state }; -}; - -void bongo_cat_wpm_status_update_cb(struct bongo_cat_wpm_status_state state) { - struct zmk_widget_bongo_cat *widget; - SYS_SLIST_FOR_EACH_CONTAINER(&widgets, widget, node) { set_animation(widget->obj, state); } -} - -ZMK_DISPLAY_WIDGET_LISTENER(widget_bongo_cat, struct bongo_cat_wpm_status_state, - bongo_cat_wpm_status_update_cb, bongo_cat_wpm_status_get_state) - -ZMK_SUBSCRIPTION(widget_bongo_cat, zmk_wpm_state_changed); - -int zmk_widget_bongo_cat_init(struct zmk_widget_bongo_cat *widget, lv_obj_t *parent) { - widget->obj = lv_animimg_create(parent); - lv_obj_center(widget->obj); - - sys_slist_append(&widgets, &widget->node); - - widget_bongo_cat_init(); - - return 0; -} - -lv_obj_t *zmk_widget_bongo_cat_obj(struct zmk_widget_bongo_cat *widget) { - return widget->obj; -} \ No newline at end of file diff --git a/boards/shields/dongle_display/widgets/bongo_cat.h b/boards/shields/dongle_display/widgets/bongo_cat.h deleted file mode 100644 index a174495..0000000 --- a/boards/shields/dongle_display/widgets/bongo_cat.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2024 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - - #pragma once - -#include -#include -#include - -struct zmk_widget_bongo_cat { - sys_snode_t node; - lv_obj_t *obj; -}; - -int zmk_widget_bongo_cat_init(struct zmk_widget_bongo_cat *widget, lv_obj_t *parent); -lv_obj_t *zmk_widget_bongo_cat_obj(struct zmk_widget_bongo_cat *widget); \ No newline at end of file diff --git a/boards/shields/dongle_display/widgets/bongo_cat_images.c b/boards/shields/dongle_display/widgets/bongo_cat_images.c deleted file mode 100644 index ea5d472..0000000 --- a/boards/shields/dongle_display/widgets/bongo_cat_images.c +++ /dev/null @@ -1,383 +0,0 @@ -/* - * Copyright (c) 2024 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - - #include - - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_BONGO_CAT_NONE -#define LV_ATTRIBUTE_IMG_BONGO_CAT_NONE -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_BONGO_CAT_NONE uint8_t bongo_cat_none_map[] = { - 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ - 0x00, 0x00, 0x00, 0xff, /*Color of index 1*/ - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x40, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x7c, 0x02, 0x00, 0x00, - 0x00, 0x00, 0x20, 0x07, 0xc5, 0x00, 0x00, - 0x00, 0x00, 0x40, 0x00, 0x79, 0x00, 0x00, - 0x00, 0x18, 0x80, 0x00, 0x11, 0x00, 0x00, - 0x00, 0x24, 0x80, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x43, 0x00, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x40, 0x08, 0x00, 0x02, 0x00, 0x00, - 0x00, 0x40, 0x14, 0x10, 0x02, 0x00, 0x00, - 0xe0, 0x20, 0x00, 0x29, 0x82, 0x00, 0x00, - 0x1f, 0x10, 0x01, 0x02, 0x41, 0x00, 0x00, - 0x00, 0xfc, 0x03, 0x84, 0x21, 0x80, 0x00, - 0x00, 0x03, 0xe0, 0x04, 0x10, 0x80, 0x00, - 0x00, 0x00, 0x1f, 0x84, 0x00, 0x80, 0x00, - 0x00, 0x00, 0x00, 0x7e, 0x00, 0xc0, 0x00, - 0x00, 0x00, 0x00, 0x03, 0xf0, 0x40, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x0f, 0xe0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xc0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -const lv_img_dsc_t bongo_cat_none = { - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .header.always_zero = 0, - .header.reserved = 0, - .header.w = 50, - .header.h = 26, - .data_size = 190, - .data = bongo_cat_none_map, -}; - -#ifndef LV_ATTRIBUTE_IMG_BONGO_CAT_LEFT1 -#define LV_ATTRIBUTE_IMG_BONGO_CAT_LEFT1 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_BONGO_CAT_LEFT1 uint8_t bongo_cat_left1_map[] = { - 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ - 0x00, 0x00, 0x00, 0xff, /*Color of index 1*/ - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x40, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x7c, 0x02, 0x00, 0x00, - 0x00, 0x00, 0x20, 0x07, 0xc5, 0x00, 0x00, - 0x00, 0x00, 0x40, 0x00, 0x79, 0x00, 0x00, - 0x00, 0x00, 0x80, 0x00, 0x11, 0x00, 0x00, - 0x00, 0x00, 0x80, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x01, 0x08, 0x00, 0x02, 0x00, 0x00, - 0x00, 0x02, 0x14, 0x10, 0x02, 0x00, 0x00, - 0xe0, 0x04, 0x00, 0x29, 0x82, 0x00, 0x00, - 0x1f, 0x08, 0x01, 0x02, 0x41, 0x00, 0x00, - 0x00, 0xf0, 0x03, 0x84, 0x21, 0x80, 0x00, - 0x00, 0x10, 0x20, 0x04, 0x10, 0x80, 0x00, - 0x00, 0x10, 0x7f, 0x84, 0x00, 0x80, 0x00, - 0x00, 0x09, 0x80, 0x7e, 0x00, 0xc0, 0x00, - 0x00, 0x06, 0x00, 0x03, 0xf0, 0x40, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x0f, 0xe0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xc0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -const lv_img_dsc_t bongo_cat_left1 = { - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .header.always_zero = 0, - .header.reserved = 0, - .header.w = 50, - .header.h = 26, - .data_size = 190, - .data = bongo_cat_left1_map, -}; - -#ifndef LV_ATTRIBUTE_IMG_BONGO_CAT_LEFT2 -#define LV_ATTRIBUTE_IMG_BONGO_CAT_LEFT2 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_BONGO_CAT_LEFT2 uint8_t bongo_cat_left2_map[] = { - 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ - 0x00, 0x00, 0x00, 0xff, /*Color of index 1*/ - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x40, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x7c, 0x02, 0x00, 0x00, - 0x00, 0x00, 0x20, 0x07, 0xc5, 0x00, 0x00, - 0x00, 0x00, 0x40, 0x00, 0x79, 0x00, 0x00, - 0x00, 0x00, 0x80, 0x00, 0x11, 0x00, 0x00, - 0x00, 0x00, 0x80, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x01, 0x08, 0x00, 0x02, 0x00, 0x00, - 0x00, 0x02, 0x14, 0x10, 0x02, 0x00, 0x00, - 0xe0, 0x04, 0x00, 0x29, 0x82, 0x00, 0x00, - 0x1f, 0x08, 0x01, 0x02, 0x41, 0x00, 0x00, - 0x00, 0xf0, 0x03, 0x84, 0x21, 0x80, 0x00, - 0x00, 0x10, 0x20, 0x04, 0x10, 0x80, 0x00, - 0x00, 0x10, 0x7f, 0x84, 0x00, 0x80, 0x00, - 0x00, 0x09, 0x80, 0x7e, 0x00, 0xc0, 0x00, - 0x00, 0x66, 0x00, 0x03, 0xf0, 0x40, 0x00, - 0x00, 0x40, 0x80, 0x00, 0x0f, 0xe0, 0x00, - 0x00, 0x04, 0x80, 0x00, 0x00, 0x3e, 0x00, - 0x00, 0x0c, 0x00, 0x00, 0x00, 0x01, 0xc0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -const lv_img_dsc_t bongo_cat_left2 = { - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .header.always_zero = 0, - .header.reserved = 0, - .header.w = 50, - .header.h = 26, - .data_size = 190, - .data = bongo_cat_left2_map, -}; - -#ifndef LV_ATTRIBUTE_IMG_BONGO_CAT_RIGHT1 -#define LV_ATTRIBUTE_IMG_BONGO_CAT_RIGHT1 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_BONGO_CAT_RIGHT1 uint8_t bongo_cat_right1_map[] = { - 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ - 0x00, 0x00, 0x00, 0xff, /*Color of index 1*/ - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x40, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x7c, 0x02, 0x00, 0x00, - 0x00, 0x00, 0x20, 0x07, 0xc5, 0x00, 0x00, - 0x00, 0x00, 0x40, 0x00, 0x79, 0x00, 0x00, - 0x00, 0x18, 0x80, 0x00, 0x11, 0x00, 0x00, - 0x00, 0x24, 0x80, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x43, 0x00, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x40, 0x08, 0x00, 0x02, 0x00, 0x00, - 0x00, 0x40, 0x14, 0x10, 0x02, 0x00, 0x00, - 0xe0, 0x20, 0x00, 0x28, 0x02, 0x00, 0x00, - 0x1f, 0x10, 0x01, 0x00, 0x01, 0x00, 0x00, - 0x00, 0xfc, 0x03, 0x80, 0x01, 0x80, 0x00, - 0x00, 0x03, 0xe0, 0x00, 0x00, 0x80, 0x00, - 0x00, 0x00, 0x1f, 0x82, 0x00, 0x80, 0x00, - 0x00, 0x00, 0x00, 0x7c, 0x00, 0xc0, 0x00, - 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00, - 0x00, 0x00, 0x00, 0x08, 0x2f, 0xe0, 0x00, - 0x00, 0x00, 0x00, 0x04, 0x40, 0x3e, 0x00, - 0x00, 0x00, 0x00, 0x03, 0x80, 0x01, 0xc0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -const lv_img_dsc_t bongo_cat_right1 = { - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .header.always_zero = 0, - .header.reserved = 0, - .header.w = 50, - .header.h = 26, - .data_size = 190, - .data = bongo_cat_right1_map, -}; - -#ifndef LV_ATTRIBUTE_IMG_BONGO_CAT_RIGHT2 -#define LV_ATTRIBUTE_IMG_BONGO_CAT_RIGHT2 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_BONGO_CAT_RIGHT2 uint8_t bongo_cat_right2_map[] = { - 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ - 0x00, 0x00, 0x00, 0xff, /*Color of index 1*/ - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x40, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x7c, 0x02, 0x00, 0x00, - 0x00, 0x00, 0x20, 0x07, 0xc5, 0x00, 0x00, - 0x00, 0x00, 0x40, 0x00, 0x79, 0x00, 0x00, - 0x00, 0x18, 0x80, 0x00, 0x11, 0x00, 0x00, - 0x00, 0x24, 0x80, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x43, 0x00, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x40, 0x08, 0x00, 0x02, 0x00, 0x00, - 0x00, 0x40, 0x14, 0x10, 0x02, 0x00, 0x00, - 0xe0, 0x20, 0x00, 0x28, 0x02, 0x00, 0x00, - 0x1f, 0x10, 0x01, 0x00, 0x01, 0x00, 0x00, - 0x00, 0xfc, 0x03, 0x80, 0x01, 0x80, 0x00, - 0x00, 0x03, 0xe0, 0x00, 0x00, 0x80, 0x00, - 0x00, 0x00, 0x1f, 0x82, 0x00, 0x80, 0x00, - 0x00, 0x00, 0x00, 0x7c, 0x00, 0xc0, 0x00, - 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00, - 0x00, 0x00, 0x00, 0x08, 0x2f, 0xe0, 0x00, - 0x00, 0x00, 0x00, 0x04, 0x40, 0x3e, 0x00, - 0x00, 0x00, 0x00, 0x33, 0x80, 0x01, 0xc0, - 0x00, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -const lv_img_dsc_t bongo_cat_right2 = { - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .header.always_zero = 0, - .header.reserved = 0, - .header.w = 50, - .header.h = 26, - .data_size = 190, - .data = bongo_cat_right2_map, -}; - -#ifndef LV_ATTRIBUTE_IMG_BONGO_CAT_BOTH1 -#define LV_ATTRIBUTE_IMG_BONGO_CAT_BOTH1 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_BONGO_CAT_BOTH1 uint8_t bongo_cat_both1_map[] = { - 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ - 0x00, 0x00, 0x00, 0xff, /*Color of index 1*/ - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x40, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x7c, 0x02, 0x00, 0x00, - 0x00, 0x00, 0x20, 0x07, 0xc5, 0x00, 0x00, - 0x00, 0x00, 0x40, 0x00, 0x79, 0x00, 0x00, - 0x00, 0x00, 0x80, 0x00, 0x11, 0x00, 0x00, - 0x00, 0x00, 0x80, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x01, 0x08, 0x00, 0x02, 0x00, 0x00, - 0x00, 0x02, 0x14, 0x10, 0x02, 0x00, 0x00, - 0xe0, 0x04, 0x00, 0x28, 0x02, 0x00, 0x00, - 0x1f, 0x08, 0x01, 0x00, 0x01, 0x00, 0x00, - 0x00, 0xf0, 0x03, 0x80, 0x01, 0x80, 0x00, - 0x00, 0x10, 0x20, 0x00, 0x00, 0x80, 0x00, - 0x00, 0x10, 0x7f, 0x82, 0x00, 0x80, 0x00, - 0x00, 0x09, 0x80, 0x7c, 0x00, 0xc0, 0x00, - 0x00, 0x06, 0x00, 0x08, 0x10, 0x40, 0x00, - 0x00, 0x00, 0x00, 0x08, 0x2f, 0xe0, 0x00, - 0x00, 0x00, 0x00, 0x04, 0x40, 0x3e, 0x00, - 0x00, 0x00, 0x00, 0x03, 0x80, 0x01, 0xc0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -const lv_img_dsc_t bongo_cat_both1 = { - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .header.always_zero = 0, - .header.reserved = 0, - .header.w = 50, - .header.h = 26, - .data_size = 190, - .data = bongo_cat_both1_map, -}; - -#ifndef LV_ATTRIBUTE_IMG_BONGO_CAT_BOTH1_OPEN -#define LV_ATTRIBUTE_IMG_BONGO_CAT_BOTH1_OPEN -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_BONGO_CAT_BOTH1_OPEN uint8_t bongo_cat_both1_open_map[] = { - 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ - 0x00, 0x00, 0x00, 0xff, /*Color of index 1*/ - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x40, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x7c, 0x02, 0x00, 0x00, - 0x00, 0x00, 0x20, 0x07, 0xc5, 0x00, 0x00, - 0x00, 0x00, 0x40, 0x00, 0x79, 0x00, 0x00, - 0x00, 0x00, 0x80, 0x00, 0x11, 0x00, 0x00, - 0x00, 0x00, 0x80, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, - 0x00, 0x02, 0x08, 0x00, 0x02, 0x00, 0x00, - 0xe0, 0x04, 0x00, 0x10, 0x02, 0x00, 0x00, - 0x1f, 0x08, 0x01, 0x00, 0x01, 0x00, 0x00, - 0x00, 0xf0, 0x03, 0x80, 0x01, 0x80, 0x00, - 0x00, 0x10, 0x20, 0x00, 0x00, 0x80, 0x00, - 0x00, 0x10, 0x7f, 0x82, 0x00, 0x80, 0x00, - 0x00, 0x09, 0x80, 0x7c, 0x00, 0xc0, 0x00, - 0x00, 0x06, 0x00, 0x08, 0x10, 0x40, 0x00, - 0x00, 0x00, 0x00, 0x08, 0x2f, 0xe0, 0x00, - 0x00, 0x00, 0x00, 0x04, 0x40, 0x3e, 0x00, - 0x00, 0x00, 0x00, 0x03, 0x80, 0x01, 0xc0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -const lv_img_dsc_t bongo_cat_both1_open = { - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .header.always_zero = 0, - .header.reserved = 0, - .header.w = 50, - .header.h = 26, - .data_size = 190, - .data = bongo_cat_both1_open_map, -}; - -#ifndef LV_ATTRIBUTE_IMG_BONGO_CAT_BOTH2 -#define LV_ATTRIBUTE_IMG_BONGO_CAT_BOTH2 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_BONGO_CAT_BOTH2 uint8_t bongo_cat_both2_map[] = { - 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ - 0x00, 0x00, 0x00, 0xff, /*Color of index 1*/ - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x40, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x7c, 0x02, 0x00, 0x00, - 0x00, 0x00, 0x20, 0x07, 0xc5, 0x00, 0x00, - 0x00, 0x00, 0x40, 0x00, 0x79, 0x00, 0x00, - 0x00, 0x00, 0x80, 0x00, 0x11, 0x00, 0x00, - 0x00, 0x00, 0x80, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x01, 0x08, 0x00, 0x02, 0x00, 0x00, - 0x00, 0x02, 0x14, 0x10, 0x02, 0x00, 0x00, - 0xe0, 0x04, 0x00, 0x28, 0x02, 0x00, 0x00, - 0x1f, 0x08, 0x01, 0x00, 0x01, 0x00, 0x00, - 0x00, 0xf0, 0x03, 0x80, 0x01, 0x80, 0x00, - 0x00, 0x10, 0x20, 0x00, 0x00, 0x80, 0x00, - 0x00, 0x10, 0x7f, 0x82, 0x00, 0x80, 0x00, - 0x00, 0x09, 0x80, 0x7c, 0x00, 0xc0, 0x00, - 0x00, 0x66, 0x00, 0x08, 0x10, 0x40, 0x00, - 0x00, 0x40, 0x80, 0x08, 0x2f, 0xe0, 0x00, - 0x00, 0x04, 0x80, 0x04, 0x40, 0x3e, 0x00, - 0x00, 0x0c, 0x00, 0x33, 0x80, 0x01, 0xc0, - 0x00, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -const lv_img_dsc_t bongo_cat_both2 = { - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .header.always_zero = 0, - .header.reserved = 0, - .header.w = 50, - .header.h = 26, - .data_size = 190, - .data = bongo_cat_both2_map, -}; - - - diff --git a/boards/shields/dongle_display/widgets/hid_indicators.c b/boards/shields/dongle_display/widgets/hid_indicators.c deleted file mode 100644 index cdee8d7..0000000 --- a/boards/shields/dongle_display/widgets/hid_indicators.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2024 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#include -#include - -#include -LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); - -#include -#include -#include - -#include "hid_indicators.h" - -#define LED_NLCK 0x01 -#define LED_CLCK 0x02 -#define LED_SLCK 0x04 - -struct hid_indicators_state { - uint8_t hid_indicators; -}; - -static sys_slist_t widgets = SYS_SLIST_STATIC_INIT(&widgets); - -static void set_hid_indicators(lv_obj_t *label, struct hid_indicators_state state) { - char text[7] = {}; - bool lock = false; - - if (state.hid_indicators & LED_CLCK) { - strncat(text, "C", 1); - lock = true; - } - if (state.hid_indicators & LED_NLCK) { - strncat(text, "N", 1); - lock = true; - } - if (state.hid_indicators & LED_SLCK) { - strncat(text, "S", 1); - lock = true; - } - if (lock) { - strncat(text, "LCK", 3); - } - - lv_label_set_text(label, text); -} - -void hid_indicators_update_cb(struct hid_indicators_state state) { - struct zmk_widget_hid_indicators *widget; - SYS_SLIST_FOR_EACH_CONTAINER(&widgets, widget, node) { set_hid_indicators(widget->obj, state); } -} - -static struct hid_indicators_state hid_indicators_get_state(const zmk_event_t *eh) { - struct zmk_hid_indicators_changed *ev = as_zmk_hid_indicators_changed(eh); - return (struct hid_indicators_state) { - .hid_indicators = ev->indicators, - }; -} - -ZMK_DISPLAY_WIDGET_LISTENER(widget_hid_indicators, struct hid_indicators_state, - hid_indicators_update_cb, hid_indicators_get_state) - -ZMK_SUBSCRIPTION(widget_hid_indicators, zmk_hid_indicators_changed); - -int zmk_widget_hid_indicators_init(struct zmk_widget_hid_indicators *widget, lv_obj_t *parent) { - widget->obj = lv_label_create(parent); - - sys_slist_append(&widgets, &widget->node); - - widget_hid_indicators_init(); - - return 0; -} - -lv_obj_t *zmk_widget_hid_indicators_obj(struct zmk_widget_hid_indicators *widget) { - return widget->obj; -} diff --git a/boards/shields/dongle_display/widgets/hid_indicators.h b/boards/shields/dongle_display/widgets/hid_indicators.h deleted file mode 100644 index cf26c53..0000000 --- a/boards/shields/dongle_display/widgets/hid_indicators.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2024 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - - #pragma once - -#include -#include - -struct zmk_widget_hid_indicators { - sys_snode_t node; - lv_obj_t *obj; -}; - -int zmk_widget_hid_indicators_init(struct zmk_widget_hid_indicators *widget, lv_obj_t *parent); -lv_obj_t *zmk_widget_hid_indicators_obj(struct zmk_widget_hid_indicators *widget); diff --git a/boards/shields/dongle_display/widgets/layer_status.c b/boards/shields/dongle_display/widgets/layer_status.c deleted file mode 100644 index 7f7afec..0000000 --- a/boards/shields/dongle_display/widgets/layer_status.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#include -#include -LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); - -#include -#include -#include -#include -#include -#include - -static sys_slist_t widgets = SYS_SLIST_STATIC_INIT(&widgets); - -struct layer_status_state { - uint8_t index; - const char *label; -}; - -static void set_layer_symbol(lv_obj_t *label, struct layer_status_state state) { - if (state.label == NULL) { - char text[7] = {}; - - sprintf(text, "%i", state.index); - - lv_label_set_text(label, text); - } else { - char text[13] = {}; - - snprintf(text, sizeof(text), "%s", state.label); - - lv_label_set_text(label, text); - } -} - -static void layer_status_update_cb(struct layer_status_state state) { - struct zmk_widget_layer_status *widget; - SYS_SLIST_FOR_EACH_CONTAINER(&widgets, widget, node) { set_layer_symbol(widget->obj, state); } -} - -static struct layer_status_state layer_status_get_state(const zmk_event_t *eh) { - uint8_t index = zmk_keymap_highest_layer_active(); - return (struct layer_status_state) { - .index = index, - .label = zmk_keymap_layer_name(index) - }; -} - -ZMK_DISPLAY_WIDGET_LISTENER(widget_layer_status, struct layer_status_state, layer_status_update_cb, - layer_status_get_state) - -ZMK_SUBSCRIPTION(widget_layer_status, zmk_layer_state_changed); - -int zmk_widget_layer_status_init(struct zmk_widget_layer_status *widget, lv_obj_t *parent) { - widget->obj = lv_label_create(parent); - - sys_slist_append(&widgets, &widget->node); - - widget_layer_status_init(); - return 0; -} - -lv_obj_t *zmk_widget_layer_status_obj(struct zmk_widget_layer_status *widget) { - return widget->obj; -} \ No newline at end of file diff --git a/boards/shields/dongle_display/widgets/layer_status.h b/boards/shields/dongle_display/widgets/layer_status.h deleted file mode 100644 index 3bc592c..0000000 --- a/boards/shields/dongle_display/widgets/layer_status.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#pragma once - -#include -#include - -struct zmk_widget_layer_status { - sys_snode_t node; - lv_obj_t *obj; -}; - -int zmk_widget_layer_status_init(struct zmk_widget_layer_status *widget, lv_obj_t *parent); -lv_obj_t *zmk_widget_layer_status_obj(struct zmk_widget_layer_status *widget); \ No newline at end of file diff --git a/boards/shields/dongle_display/widgets/modifiers.c b/boards/shields/dongle_display/widgets/modifiers.c deleted file mode 100644 index c72f2a6..0000000 --- a/boards/shields/dongle_display/widgets/modifiers.c +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2024 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#include -#include - -#include -LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); - -#include -#include -#include -#include -#include - -#include "modifiers.h" - -struct modifiers_state { - uint8_t modifiers; -}; - -struct modifier_symbol { - uint8_t modifier; - const lv_img_dsc_t *symbol_dsc; - lv_obj_t *symbol; - lv_obj_t *selection_line; - bool is_active; -}; - -LV_IMG_DECLARE(control_icon); -struct modifier_symbol ms_control = { - .modifier = MOD_LCTL | MOD_RCTL, - .symbol_dsc = &control_icon, -}; - -LV_IMG_DECLARE(shift_icon); -struct modifier_symbol ms_shift = { - .modifier = MOD_LSFT | MOD_RSFT, - .symbol_dsc = &shift_icon, -}; - -LV_IMG_DECLARE(alt_icon); -struct modifier_symbol ms_alt = { - .modifier = MOD_LALT | MOD_RALT, - .symbol_dsc = &alt_icon, -}; - -LV_IMG_DECLARE(win_icon); -struct modifier_symbol ms_gui = { - .modifier = MOD_LGUI | MOD_RGUI, - .symbol_dsc = &win_icon, -}; - -LV_IMG_DECLARE(opt_icon); -struct modifier_symbol ms_opt = { - .modifier = MOD_LALT | MOD_RALT, - .symbol_dsc = &opt_icon, -}; - -LV_IMG_DECLARE(cmd_icon); -struct modifier_symbol ms_cmd = { - .modifier = MOD_LGUI | MOD_RGUI, - .symbol_dsc = &cmd_icon, -}; - -struct modifier_symbol *modifier_symbols[] = { - // this order determines the order of the symbols - &ms_cmd, - &ms_opt, - &ms_control, - &ms_shift -}; - -#define NUM_SYMBOLS (sizeof(modifier_symbols) / sizeof(struct modifier_symbol *)) - -static sys_slist_t widgets = SYS_SLIST_STATIC_INIT(&widgets); - -static void anim_y_cb(void *var, int32_t v) { - lv_obj_set_y(var, v); -} - -static void move_object_y(void *obj, int32_t from, int32_t to) { - lv_anim_t a; - lv_anim_init(&a); - lv_anim_set_var(&a, obj); - lv_anim_set_time(&a, 200); // will be replaced with lv_anim_set_duration - lv_anim_set_exec_cb(&a, anim_y_cb); - lv_anim_set_path_cb(&a, lv_anim_path_overshoot); - lv_anim_set_values(&a, from, to); - lv_anim_start(&a); -} - -static void set_modifiers(lv_obj_t *widget, struct modifiers_state state) { - for (int i = 0; i < NUM_SYMBOLS; i++) { - bool mod_is_active = (state.modifiers & modifier_symbols[i]->modifier) > 0; - - if (mod_is_active && !modifier_symbols[i]->is_active) { - move_object_y(modifier_symbols[i]->symbol, 1, 0); - move_object_y(modifier_symbols[i]->selection_line, SIZE_SYMBOLS + 4, SIZE_SYMBOLS + 2); - modifier_symbols[i]->is_active = true; - } else if (!mod_is_active && modifier_symbols[i]->is_active) { - move_object_y(modifier_symbols[i]->symbol, 0, 1); - move_object_y(modifier_symbols[i]->selection_line, SIZE_SYMBOLS + 2, SIZE_SYMBOLS + 4); - modifier_symbols[i]->is_active = false; - } - } -} - -void modifiers_update_cb(struct modifiers_state state) { - struct zmk_widget_modifiers *widget; - SYS_SLIST_FOR_EACH_CONTAINER(&widgets, widget, node) { set_modifiers(widget->obj, state); } -} - -static struct modifiers_state modifiers_get_state(const zmk_event_t *eh) { - return (struct modifiers_state) { - .modifiers = zmk_hid_get_explicit_mods() - }; -} - -ZMK_DISPLAY_WIDGET_LISTENER(widget_modifiers, struct modifiers_state, - modifiers_update_cb, modifiers_get_state) - -ZMK_SUBSCRIPTION(widget_modifiers, zmk_keycode_state_changed); - -int zmk_widget_modifiers_init(struct zmk_widget_modifiers *widget, lv_obj_t *parent) { - widget->obj = lv_obj_create(parent); - - lv_obj_set_size(widget->obj, NUM_SYMBOLS * (SIZE_SYMBOLS + 1) + 1, SIZE_SYMBOLS + 3); - - static lv_style_t style_line; - lv_style_init(&style_line); - lv_style_set_line_width(&style_line, 2); - - static const lv_point_t selection_line_points[] = { {0, 0}, {SIZE_SYMBOLS, 0} }; - - for (int i = 0; i < NUM_SYMBOLS; i++) { - modifier_symbols[i]->symbol = lv_img_create(widget->obj); - lv_obj_align(modifier_symbols[i]->symbol, LV_ALIGN_TOP_LEFT, 1 + (SIZE_SYMBOLS + 1) * i, 1); - lv_img_set_src(modifier_symbols[i]->symbol, modifier_symbols[i]->symbol_dsc); - - modifier_symbols[i]->selection_line = lv_line_create(widget->obj); - lv_line_set_points(modifier_symbols[i]->selection_line, selection_line_points, 2); - lv_obj_add_style(modifier_symbols[i]->selection_line, &style_line, 0); - lv_obj_align_to(modifier_symbols[i]->selection_line, modifier_symbols[i]->symbol, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 3); - } - - sys_slist_append(&widgets, &widget->node); - - widget_modifiers_init(); - - return 0; -} - -lv_obj_t *zmk_widget_modifiers_obj(struct zmk_widget_modifiers *widget) { - return widget->obj; -} \ No newline at end of file diff --git a/boards/shields/dongle_display/widgets/modifiers.h b/boards/shields/dongle_display/widgets/modifiers.h deleted file mode 100644 index 5dc4dde..0000000 --- a/boards/shields/dongle_display/widgets/modifiers.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2024 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - - #pragma once - -#include -#include -#include - -#define SIZE_SYMBOLS 14 // 14 x 14 pixel - -struct zmk_widget_modifiers { - sys_snode_t node; - lv_obj_t *obj; -}; - -int zmk_widget_modifiers_init(struct zmk_widget_modifiers *widget, lv_obj_t *parent); -lv_obj_t *zmk_widget_modifiers_obj(struct zmk_widget_modifiers *widget); \ No newline at end of file diff --git a/boards/shields/dongle_display/widgets/modifiers_sym.c b/boards/shields/dongle_display/widgets/modifiers_sym.c deleted file mode 100644 index f28ae6a..0000000 --- a/boards/shields/dongle_display/widgets/modifiers_sym.c +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Copyright (c) 2024 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - - #include - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_CONTROL -#define LV_ATTRIBUTE_IMG_CONTROL -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_CONTROL uint8_t control_map[] = { - 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ - 0x00, 0x00, 0x00, 0xff, /*Color of index 1*/ - - 0x00, 0x00, - 0x00, 0x00, - 0x03, 0x00, - 0x07, 0x80, - 0x0c, 0xc0, - 0x18, 0x60, - 0x30, 0x30, - 0x20, 0x10, - 0x00, 0x00, - 0x00, 0x00, - 0x00, 0x00, - 0x00, 0x00, - 0x00, 0x00, - 0x00, 0x00, -}; - -const lv_img_dsc_t control_icon = { - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .header.always_zero = 0, - .header.reserved = 0, - .header.w = 14, - .header.h = 14, - .data_size = 36, - .data = control_map, -}; - -#ifndef LV_ATTRIBUTE_IMG_SHIFT -#define LV_ATTRIBUTE_IMG_SHIFT -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_SHIFT uint8_t shift_map[] = { - 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ - 0x00, 0x00, 0x00, 0xff, /*Color of index 1*/ - - 0x00, 0x00, - 0x00, 0x00, - 0x03, 0x00, - 0x07, 0x80, - 0x0c, 0xc0, - 0x18, 0x60, - 0x30, 0x30, - 0x78, 0x78, - 0x08, 0x40, - 0x08, 0x40, - 0x08, 0x40, - 0x0f, 0xc0, - 0x00, 0x00, - 0x00, 0x00, -}; - -const lv_img_dsc_t shift_icon = { - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .header.always_zero = 0, - .header.reserved = 0, - .header.w = 14, - .header.h = 14, - .data_size = 36, - .data = shift_map, -}; - -#ifndef LV_ATTRIBUTE_IMG_ALT -#define LV_ATTRIBUTE_IMG_ALT -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_ALT uint8_t alt_map[] = { - 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ - 0x00, 0x00, 0x00, 0xff, /*Color of index 1*/ - - 0x00, 0x00, - 0x00, 0x00, - 0x00, 0x00, - 0x00, 0x00, - 0x32, 0xf8, - 0x4a, 0x20, - 0x4a, 0x20, - 0x7a, 0x20, - 0x4a, 0x20, - 0x4b, 0xa0, - 0x00, 0x00, - 0x00, 0x00, - 0x00, 0x00, - 0x00, 0x00, -}; - -const lv_img_dsc_t alt_icon = { - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .header.always_zero = 0, - .header.reserved = 0, - .header.w = 14, - .header.h = 14, - .data_size = 36, - .data = alt_map, -}; - -#ifndef LV_ATTRIBUTE_IMG_GUI -#define LV_ATTRIBUTE_IMG_GUI -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_GUI uint8_t win_map[] = { - 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ - 0x00, 0x00, 0x00, 0xff, /*Color of index 1*/ - - 0x00, 0x00, - 0x00, 0x00, - 0x00, 0xf0, - 0x0b, 0xf0, - 0x3b, 0xf0, - 0x3b, 0xf0, - 0x3b, 0xf0, - 0x00, 0x00, - 0x3b, 0xf0, - 0x3b, 0xf0, - 0x3b, 0xf0, - 0x03, 0xf0, - 0x00, 0x30, - 0x00, 0x00, -}; - -const lv_img_dsc_t win_icon = { - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .header.always_zero = 0, - .header.reserved = 0, - .header.w = 14, - .header.h = 14, - .data_size = 36, - .data = win_map, -}; - -#ifndef LV_ATTRIBUTE_IMG_CMD -#define LV_ATTRIBUTE_IMG_CMD -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_CMD uint8_t cmd_map[] = { - 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ - 0x00, 0x00, 0x00, 0xff, /*Color of index 1*/ - - 0x00, 0x00, - 0x00, 0x00, - 0x18, 0x60, - 0x24, 0x90, - 0x24, 0x90, - 0x1f, 0xe0, - 0x04, 0x80, - 0x04, 0x80, - 0x1f, 0xe0, - 0x24, 0x90, - 0x24, 0x90, - 0x18, 0x60, - 0x00, 0x00, - 0x00, 0x00, -}; - -const lv_img_dsc_t cmd_icon = { - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .header.always_zero = 0, - .header.reserved = 0, - .header.w = 14, - .header.h = 14, - .data_size = 36, - .data = cmd_map, -}; - -#ifndef LV_ATTRIBUTE_IMG_OPT -#define LV_ATTRIBUTE_IMG_OPT -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_OPT uint8_t opt_map[] = { - 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ - 0x00, 0x00, 0x00, 0xff, /*Color of index 1*/ - - 0x00, 0x00, - 0x00, 0x00, - 0x3c, 0xe0, - 0x3c, 0xe0, - 0x06, 0x00, - 0x06, 0x00, - 0x06, 0x00, - 0x03, 0x00, - 0x03, 0x00, - 0x03, 0x00, - 0x01, 0xe0, - 0x01, 0xe0, - 0x00, 0x00, - 0x00, 0x00, -}; - -const lv_img_dsc_t opt_icon = { - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .header.always_zero = 0, - .header.reserved = 0, - .header.w = 14, - .header.h = 14, - .data_size = 36, - .data = opt_map, -}; \ No newline at end of file diff --git a/boards/shields/dongle_display/widgets/output_status.c b/boards/shields/dongle_display/widgets/output_status.c deleted file mode 100644 index f3ef6bf..0000000 --- a/boards/shields/dongle_display/widgets/output_status.c +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (c) 2024 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#include - -#include -LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "output_status.h" - -static sys_slist_t widgets = SYS_SLIST_STATIC_INIT(&widgets); - -LV_IMG_DECLARE(sym_usb); -LV_IMG_DECLARE(sym_bt); -LV_IMG_DECLARE(sym_ok); -LV_IMG_DECLARE(sym_nok); -LV_IMG_DECLARE(sym_open); -LV_IMG_DECLARE(sym_1); -LV_IMG_DECLARE(sym_2); -LV_IMG_DECLARE(sym_3); -LV_IMG_DECLARE(sym_4); -LV_IMG_DECLARE(sym_5); - -const lv_img_dsc_t *sym_num[] = { - &sym_1, - &sym_2, - &sym_3, - &sym_4, - &sym_5, -}; - -enum output_symbol { - output_symbol_usb, - output_symbol_usb_hid_status, - output_symbol_bt, - output_symbol_bt_number, - output_symbol_bt_status, - output_symbol_selection_line -}; - -enum selection_line_state { - selection_line_state_usb, - selection_line_state_bt -} current_selection_line_state; - -lv_point_t selection_line_points[] = { {-1, 0}, {12, 0} }; // will be replaced with lv_point_precise_t - -struct output_status_state { - struct zmk_endpoint_instance selected_endpoint; - int active_profile_index; - bool active_profile_connected; - bool active_profile_bonded; - bool usb_is_hid_ready; -}; - -static struct output_status_state get_state(const zmk_event_t *_eh) { - return (struct output_status_state){ - .selected_endpoint = zmk_endpoints_selected(), - .active_profile_index = zmk_ble_active_profile_index(), - .active_profile_connected = zmk_ble_active_profile_is_connected(), - .active_profile_bonded = !zmk_ble_active_profile_is_open(), - .usb_is_hid_ready = zmk_usb_is_hid_ready() - }; -} - -static void anim_x_cb(void * var, int32_t v) { - lv_obj_set_x(var, v); -} - -static void anim_size_cb(void * var, int32_t v) { - selection_line_points[1].x = v; -} - -static void move_object_x(void *obj, int32_t from, int32_t to) { - lv_anim_t a; - lv_anim_init(&a); - lv_anim_set_var(&a, obj); - lv_anim_set_time(&a, 200); // will be replaced with lv_anim_set_duration - lv_anim_set_exec_cb(&a, anim_x_cb); - lv_anim_set_path_cb(&a, lv_anim_path_overshoot); - lv_anim_set_values(&a, from, to); - lv_anim_start(&a); -} - -static void change_size_object(void *obj, int32_t from, int32_t to) { - lv_anim_t a; - lv_anim_init(&a); - lv_anim_set_var(&a, obj); - lv_anim_set_time(&a, 200); // will be replaced with lv_anim_set_duration - lv_anim_set_exec_cb(&a, anim_size_cb); - lv_anim_set_path_cb(&a, lv_anim_path_ease_in_out); - lv_anim_set_values(&a, from, to); - lv_anim_start(&a); -} - -static void set_status_symbol(lv_obj_t *widget, struct output_status_state state) { - lv_obj_t *usb = lv_obj_get_child(widget, output_symbol_usb); - lv_obj_t *usb_hid_status = lv_obj_get_child(widget, output_symbol_usb_hid_status); - lv_obj_t *bt = lv_obj_get_child(widget, output_symbol_bt); - lv_obj_t *bt_number = lv_obj_get_child(widget, output_symbol_bt_number); - lv_obj_t *bt_status = lv_obj_get_child(widget, output_symbol_bt_status); - lv_obj_t *selection_line = lv_obj_get_child(widget, output_symbol_selection_line); - - switch (state.selected_endpoint.transport) { - case ZMK_TRANSPORT_USB: - if (current_selection_line_state != selection_line_state_usb) { - move_object_x(selection_line, lv_obj_get_x(bt) - 1, lv_obj_get_x(usb) - 1); - change_size_object(selection_line, 18, 11); - current_selection_line_state = selection_line_state_usb; - } - break; - case ZMK_TRANSPORT_BLE: - if (current_selection_line_state != selection_line_state_bt) { - move_object_x(selection_line, lv_obj_get_x(usb) - 1, lv_obj_get_x(bt) - 1); - change_size_object(selection_line, 11, 18); - current_selection_line_state = selection_line_state_bt; - } - break; - } - - if (state.usb_is_hid_ready) { - lv_img_set_src(usb_hid_status, &sym_ok); - } else { - lv_img_set_src(usb_hid_status, &sym_nok); - } - - if (state.active_profile_index < (sizeof(sym_num) / sizeof(lv_img_dsc_t *))) { - lv_img_set_src(bt_number, sym_num[state.active_profile_index]); - } else { - lv_img_set_src(bt_number, &sym_nok); - } - - if (state.active_profile_bonded) { - if (state.active_profile_connected) { - lv_img_set_src(bt_status, &sym_ok); - } else { - lv_img_set_src(bt_status, &sym_nok); - } - } else { - lv_img_set_src(bt_status, &sym_open); - } -} - -static void output_status_update_cb(struct output_status_state state) { - struct zmk_widget_output_status *widget; - SYS_SLIST_FOR_EACH_CONTAINER(&widgets, widget, node) { set_status_symbol(widget->obj, state); } -} - -ZMK_DISPLAY_WIDGET_LISTENER(widget_output_status, struct output_status_state, - output_status_update_cb, get_state) -ZMK_SUBSCRIPTION(widget_output_status, zmk_endpoint_changed); -ZMK_SUBSCRIPTION(widget_output_status, zmk_ble_active_profile_changed); -ZMK_SUBSCRIPTION(widget_output_status, zmk_usb_conn_state_changed); - -int zmk_widget_output_status_init(struct zmk_widget_output_status *widget, lv_obj_t *parent) { - widget->obj = lv_obj_create(parent); - - lv_obj_set_size(widget->obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); - - lv_obj_t *usb = lv_img_create(widget->obj); - lv_obj_align(usb, LV_ALIGN_TOP_LEFT, 1, 4); - lv_img_set_src(usb, &sym_usb); - - lv_obj_t *usb_hid_status = lv_img_create(widget->obj); - lv_obj_align_to(usb_hid_status, usb, LV_ALIGN_BOTTOM_LEFT, 2, -7); - - lv_obj_t *bt = lv_img_create(widget->obj); - lv_obj_align_to(bt, usb, LV_ALIGN_OUT_RIGHT_TOP, 6, 0); - lv_img_set_src(bt, &sym_bt); - - lv_obj_t *bt_number = lv_img_create(widget->obj); - lv_obj_align_to(bt_number, bt, LV_ALIGN_OUT_RIGHT_TOP, 2, 7); - - lv_obj_t *bt_status = lv_img_create(widget->obj); - lv_obj_align_to(bt_status, bt, LV_ALIGN_OUT_RIGHT_TOP, 2, 1); - - static lv_style_t style_line; - lv_style_init(&style_line); - lv_style_set_line_width(&style_line, 2); - - lv_obj_t *selection_line; - selection_line = lv_line_create(widget->obj); - lv_line_set_points(selection_line, selection_line_points, 2); - lv_obj_add_style(selection_line, &style_line, 0); - lv_obj_align_to(selection_line, usb, LV_ALIGN_OUT_TOP_LEFT, 3, -1); - - sys_slist_append(&widgets, &widget->node); - - widget_output_status_init(); - return 0; -} - -lv_obj_t *zmk_widget_output_status_obj(struct zmk_widget_output_status *widget) { - return widget->obj; -} diff --git a/boards/shields/dongle_display/widgets/output_status.h b/boards/shields/dongle_display/widgets/output_status.h deleted file mode 100644 index dfd37bf..0000000 --- a/boards/shields/dongle_display/widgets/output_status.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2024 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - - #pragma once - -#include -#include - -struct zmk_widget_output_status { - sys_snode_t node; - lv_obj_t *obj; -}; - -int zmk_widget_output_status_init(struct zmk_widget_output_status *widget, lv_obj_t *parent); -lv_obj_t *zmk_widget_output_status_obj(struct zmk_widget_output_status *widget); \ No newline at end of file diff --git a/boards/shields/dongle_display/widgets/output_status_sym.c b/boards/shields/dongle_display/widgets/output_status_sym.c deleted file mode 100644 index bc333a8..0000000 --- a/boards/shields/dongle_display/widgets/output_status_sym.c +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (c) 2024 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - - #include - - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_SYM_1 -#define LV_ATTRIBUTE_IMG_SYM_1 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_SYM_1 uint8_t sym_1_map[] = { - 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ - 0x00, 0x00, 0x00, 0xff, /*Color of index 1*/ - - 0x30, 0x70, 0x70, 0x30, 0x30, 0x30, -}; - -const lv_img_dsc_t sym_1 = { - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .header.always_zero = 0, - .header.reserved = 0, - .header.w = 5, - .header.h = 6, - .data_size = 14, - .data = sym_1_map, -}; - -#ifndef LV_ATTRIBUTE_IMG_SYM_2 -#define LV_ATTRIBUTE_IMG_SYM_2 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_SYM_2 uint8_t sym_2_map[] = { - 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ - 0x00, 0x00, 0x00, 0xff, /*Color of index 1*/ - - 0x70, 0xd8, 0x18, 0x30, 0x60, 0xf8, -}; - -const lv_img_dsc_t sym_2 = { - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .header.always_zero = 0, - .header.reserved = 0, - .header.w = 5, - .header.h = 6, - .data_size = 14, - .data = sym_2_map, -}; - -#ifndef LV_ATTRIBUTE_IMG_SYM_3 -#define LV_ATTRIBUTE_IMG_SYM_3 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_SYM_3 uint8_t sym_3_map[] = { - 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ - 0x00, 0x00, 0x00, 0xff, /*Color of index 1*/ - - 0x70, 0x98, 0x30, 0x18, 0xd8, 0x70, -}; - -const lv_img_dsc_t sym_3 = { - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .header.always_zero = 0, - .header.reserved = 0, - .header.w = 5, - .header.h = 6, - .data_size = 14, - .data = sym_3_map, -}; - -#ifndef LV_ATTRIBUTE_IMG_SYM_4 -#define LV_ATTRIBUTE_IMG_SYM_4 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_SYM_4 uint8_t sym_4_map[] = { - 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ - 0x00, 0x00, 0x00, 0xff, /*Color of index 1*/ - - 0x10, 0x30, 0x70, 0xd0, 0xf8, 0x10, -}; - -const lv_img_dsc_t sym_4 = { - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .header.always_zero = 0, - .header.reserved = 0, - .header.w = 5, - .header.h = 6, - .data_size = 14, - .data = sym_4_map, -}; - -#ifndef LV_ATTRIBUTE_IMG_SYM_5 -#define LV_ATTRIBUTE_IMG_SYM_5 -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_SYM_5 uint8_t sym_5_map[] = { - 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ - 0x00, 0x00, 0x00, 0xff, /*Color of index 1*/ - - 0x78, 0x40, 0x70, 0x18, 0xd8, 0x70, -}; - -const lv_img_dsc_t sym_5 = { - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .header.always_zero = 0, - .header.reserved = 0, - .header.w = 5, - .header.h = 6, - .data_size = 14, - .data = sym_5_map, -}; - -#ifndef LV_ATTRIBUTE_IMG_SYM_OK -#define LV_ATTRIBUTE_IMG_SYM_OK -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_SYM_OK uint8_t sym_ok_map[] = { - 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ - 0x00, 0x00, 0x00, 0xff, /*Color of index 1*/ - - 0x08, 0x18, 0xb0, 0xe0, 0x40, -}; - -const lv_img_dsc_t sym_ok = { - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .header.always_zero = 0, - .header.reserved = 0, - .header.w = 5, - .header.h = 5, - .data_size = 13, - .data = sym_ok_map, -}; - -#ifndef LV_ATTRIBUTE_IMG_SYM_NOK -#define LV_ATTRIBUTE_IMG_SYM_NOK -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_SYM_NOK uint8_t sym_nok_map[] = { - 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ - 0x00, 0x00, 0x00, 0xff, /*Color of index 1*/ - - 0x88, 0xd8, 0x70, 0xd8, 0x88, -}; - -const lv_img_dsc_t sym_nok = { - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .header.always_zero = 0, - .header.reserved = 0, - .header.w = 5, - .header.h = 5, - .data_size = 13, - .data = sym_nok_map, -}; - -#ifndef LV_ATTRIBUTE_IMG_SYM_OPEN -#define LV_ATTRIBUTE_IMG_SYM_OPEN -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_SYM_OPEN uint8_t sym_open_map[] = { - 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ - 0x00, 0x00, 0x00, 0xff, /*Color of index 1*/ - - 0x20, 0x70, 0xd8, 0x70, 0x20, -}; - -const lv_img_dsc_t sym_open = { - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .header.always_zero = 0, - .header.reserved = 0, - .header.w = 5, - .header.h = 5, - .data_size = 13, - .data = sym_open_map, -}; - -#ifndef LV_ATTRIBUTE_IMG_SYM_BT -#define LV_ATTRIBUTE_IMG_SYM_BT -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_SYM_BT uint8_t sym_bt_map[] = { - 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ - 0x00, 0x00, 0x00, 0xff, /*Color of index 1*/ - - 0x3e, 0x00, 0x67, 0x00, 0xe3, 0x80, 0xe9, - 0x80, 0x8c, 0x80, 0xc9, 0x80, 0xe3, 0x80, - 0xe3, 0x80, 0xc9, 0x80, 0x8c, 0x80, 0xe9, - 0x80, 0xe3, 0x80, 0x67, 0x00, 0x3e, 0x00, -}; - -const lv_img_dsc_t sym_bt = { - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .header.always_zero = 0, - .header.reserved = 0, - .header.w = 9, - .header.h = 14, - .data_size = 36, - .data = sym_bt_map, -}; - -#ifndef LV_ATTRIBUTE_IMG_SYM_USB -#define LV_ATTRIBUTE_IMG_SYM_USB -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_SYM_USB uint8_t sym_usb_map[] = { - 0xff, 0xff, 0xff, 0xff, /*Color of index 0*/ - 0x00, 0x00, 0x00, 0xff, /*Color of index 1*/ - - 0x7f, 0x00, 0x41, 0x00, 0x55, 0x00, 0x41, - 0x00, 0xff, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0xff, 0x80, -}; - -const lv_img_dsc_t sym_usb = { - .header.cf = LV_IMG_CF_INDEXED_1BIT, - .header.always_zero = 0, - .header.reserved = 0, - .header.w = 9, - .header.h = 14, - .data_size = 36, - .data = sym_usb_map, -}; - - - diff --git a/build.yaml b/build.yaml index 3c832c7..98e2c98 100644 --- a/build.yaml +++ b/build.yaml @@ -54,61 +54,90 @@ --- include: - # nice + ### nice_view START ### + # nice_nano_v2 + nice_view_gem - board: nice_nano_v2 - # required: https://github.com/M165437/nice-view-gem - # shield: corne_left nice_view_adapter nice_view shield: corne_left nice_view_adapter nice_view_gem cmake-args: -DCONFIG_ZMK_KEYBOARD_NAME=\"Nice_Corne_View\" - artifact-name: nice_corne_left + artifact-name: nice_corne_left_view snippet: studio-rpc-usb-uart - # shield: corne_left # for OLED no nice_view - board: nice_nano_v2 - # required: https://github.com/M165437/nice-view-gem - # shield: corne_right nice_view_adapter nice_view shield: corne_right nice_view_adapter nice_view_gem - cmake-args: -DCONFIG_NICE_VIEW_GEM_ANIMATION=n - artifact-name: nice_corne_right - # shield: corne_right # for OLED no nice_view + cmake-args: -DCONFIG_NICE_VIEW_GEM_ANIMATION=y + artifact-name: nice_corne_right_view - # puchi + # puchi_ble_v1 + nice_view_gem - board: puchi_ble_v1 - shield: corne_left nice_view_adapter nice_view + shield: corne_left nice_view_adapter nice_view_gem cmake-args: -DCONFIG_ZMK_KEYBOARD_NAME=\"Puchi_Corne_View\" - artifact-name: puchi_corne_left + artifact-name: puchi_corne_left_view snippet: studio-rpc-usb-uart - # shield: corne_left # for OLED no nice_view - board: puchi_ble_v1 shield: corne_right nice_view_adapter nice_view - artifact-name: puchi_corne_right - # shield: corne_right # for OLED no nice_view + artifact-name: puchi_corne_right_view - # peripheral_left + # peripheral_left + nice_nano_v2 + nice_view_gem - board: nice_nano_v2 - # required: https://github.com/M165437/nice-view-gem shield: corne_left_peripheral nice_view_adapter nice_view_gem - # shield: corne_left_peripheral nice_view_adapter nice_view - cmake-args: -DCONFIG_NICE_VIEW_GEM_ANIMATION=n - artifact-name: nice_corne_left_peripheral + cmake-args: -DCONFIG_NICE_VIEW_GEM_ANIMATION=y + artifact-name: nice_corne_left_peripheral_view + + # peripheral_left + puchi_ble_v1 + nice_view_gem + - board: puchi_ble_v1 + shield: corne_left_peripheral nice_view_adapter nice_view_gem + cmake-args: -DCONFIG_NICE_VIEW_GEM_ANIMATION=y + artifact-name: puchi_corne_left_peripheral_view + ### nice_view END ### + + ### nice_oled START ### + # nice_nano_v2 + nice_oled + - board: nice_nano_v2 + shield: corne_left nice_oled + cmake-args: -DCONFIG_ZMK_KEYBOARD_NAME=\"Nice_Corne_Oled\" + artifact-name: nice_corne_left_oled + snippet: studio-rpc-usb-uart + - board: nice_nano_v2 + shield: corne_right nice_oled + artifact-name: nice_corne_right_oled + + # puchi_ble_v1 + nice_oled + - board: puchi_ble_v1 + shield: corne_left nice_oled + cmake-args: -DCONFIG_ZMK_KEYBOARD_NAME=\"Puchi_Corne_Oled\" + artifact-name: puchi_corne_left_oled + snippet: studio-rpc-usb-uart + - board: puchi_ble_v1 + shield: corne_right nice_oled + artifact-name: puchi_corne_right_oled + + # peripheral_left + nice_nano_v2 + nice_oled + - board: nice_nano_v2 + shield: corne_left_peripheral nice_oled + artifact-name: nice_corne_left_peripheral_oled + + # peripheral_left + puchi_ble_v1 + nice_oled - board: puchi_ble_v1 - shield: corne_left_peripheral nice_view_adapter nice_view - artifact-name: puchi_corne_left_peripheral + shield: corne_left_peripheral nice_oled + artifact-name: puchi_corne_left_peripheral_oled + ### nice_oled END ### - # Xiao_Dongle + ### Xiao_Dongle START ### - board: seeeduino_xiao_ble shield: corne_dongle_xiao # -DCONFIG_ZMK_USB=y -DCONFIG_ZMK_BLE=y cmake-args: -DCONFIG_ZMK_KEYBOARD_NAME=\"Xiao_Dongle\" -DCONFIG_ZMK_STUDIO=y - artifact-name: xiao_corne_dongle_xiao + artifact-name: xiao_corne_dongle snippet: studio-rpc-usb-uart - board: seeeduino_xiao_ble shield: corne_dongle_xiao dongle_display cmake-args: -DCONFIG_ZMK_KEYBOARD_NAME=\"Xiao_Dongle_O\" - artifact-name: xiao_corne_dongle_xiao_dongle_display + artifact-name: xiao_corne_dongle_oled snippet: studio-rpc-usb-uart # snippet: zmk-usb-logging + ### Xiao_Dongle END ### - # ProMicro_Dongle + ### ProMicro_Dongle START ### + # nice_nano_v2 dongle - board: nice_nano_v2 shield: corne_dongle_pro_micro cmake-args: -DCONFIG_ZMK_KEYBOARD_NAME=\"Nice_Dongle\" @@ -118,26 +147,25 @@ include: - board: nice_nano_v2 shield: corne_dongle_pro_micro dongle_display cmake-args: -DCONFIG_ZMK_KEYBOARD_NAME=\"Nice_Dongle_O\" - artifact-name: nice_corne_dongle_pro_micro_dongle_display + artifact-name: nice_corne_dongle_oled snippet: studio-rpc-usb-uart # snippet: zmk-usb-logging - board: puchi_ble_v1 shield: corne_dongle_pro_micro cmake-args: -DCONFIG_ZMK_KEYBOARD_NAME=\"Puchi_Dongle\" - artifact-name: puchi_corne_dongle_pro_micro + artifact-name: puchi_corne_dongle snippet: studio-rpc-usb-uart # snippet: zmk-usb-logging - board: puchi_ble_v1 - # required: https://github.com/M165437/nice-view-gem - # shield: corne_dongle_pro_micro nice_view_adapter dongle_display_view_pro_micro shield: corne_dongle_pro_micro nice_view_adapter nice_view_gem # -DCONFIG_ZMK_USB=y -DCONFIG_ZMK_BLE=y cmake-args: -DCONFIG_ZMK_KEYBOARD_NAME=\"Puchi_Dongle_V\" -DCONFIG_ZMK_STUDIO=y snippet: studio-rpc-usb-uart - artifact-name: puchi_corne_dongle_pro_micro_dongle_display_view + artifact-name: puchi_corne_dongle_view # snippet: zmk-usb-logging + ### Pro Micro END ### - # settings_reset + ### settings_reset START ### - board: nice_nano_v2 shield: settings_reset artifact-name: nice_settings_reset @@ -147,3 +175,4 @@ include: - board: puchi_ble_v1 shield: settings_reset artifact-name: puchi_settings_reset + ### settings_reset END ### diff --git a/config/west.yml b/config/west.yml index 66beba5..d4e1bf7 100644 --- a/config/west.yml +++ b/config/west.yml @@ -1,18 +1,32 @@ manifest: remotes: - # - name: urob - # url-base: https://github.com/urob - name: zmkfirmware url-base: https://github.com/zmkfirmware - - name: m165437 #new entry - url-base: https://github.com/M165437 #new entry + # nice_view_gem + - name: m165437 + url-base: https://github.com/M165437 + # dongle_display + - name: englmaxi + url-base: https://github.com/englmaxi + # nice_oled + - name: mctechnology17 + url-base: https://github.com/mctechnology17 projects: - name: zmk remote: zmkfirmware revision: main import: app/west.yml - - name: nice-view-gem #new entry - remote: m165437 #new entry - revision: main #new entry + # nice_view_gem + - name: nice-view-gem + remote: m165437 + revision: main + # dongle_display + - name: zmk-dongle-display + remote: englmaxi + revision: main + # nice_oled + - name: zmk-nice-oled + remote: mctechnology17 + revision: main self: path: config