forked from Eloy98/zmk-for-cygnus
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
2,088 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,50 @@ | ||
# Copyright (c) 2020 The ZMK Contributors | ||
# SPDX-License-Identifier: MIT | ||
|
||
if SHIELD_CYGNUS_LEFT | ||
if SHIELD_CYGNUS_CENTRAL_DONGLE || SHIELD_CYGNUS_CENTRAL_LEFT | ||
|
||
config ZMK_KEYBOARD_NAME | ||
default "Cygnus" | ||
default "Cygnus" | ||
|
||
config ZMK_SPLIT_BLE_ROLE_CENTRAL | ||
default y | ||
config ZMK_SPLIT_ROLE_CENTRAL | ||
default y | ||
|
||
endif | ||
|
||
if SHIELD_CYGNUS_LEFT || SHIELD_CYGNUS_RIGHT | ||
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 LVGL | ||
|
||
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 | ||
|
||
if SHIELD_CYGNUS_CENTRAL_DONGLE || SHIELD_CYGNUS_CENTRAL_LEFT || SHIELD_CYGNUS_PERIPHERAL_LEFT || SHIELD_CYGNUS_PERIPHERAL_RIGHT | ||
|
||
config ZMK_SPLIT | ||
default y | ||
default y | ||
|
||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
# Copyright (c) 2020 The ZMK Contributors | ||
# SPDX-License-Identifier: MIT | ||
|
||
config SHIELD_CYGNUS_LEFT | ||
def_bool $(shields_list_contains,cygnus_left) | ||
config SHIELD_CYGNUS_CENTRAL_DONGLE | ||
def_bool $(shields_list_contains,cygnus_central_dongle) | ||
|
||
config SHIELD_CYGNUS_RIGHT | ||
def_bool $(shields_list_contains,cygnus_right) | ||
config SHIELD_CYGNUS_CENTRAL_LEFT | ||
def_bool $(shields_list_contains,cygnus_central_left) | ||
|
||
config SHIELD_CYGNUS_PERIPHERAL_LEFT | ||
def_bool $(shields_list_contains,cygnus_peripheral_left) | ||
|
||
config SHIELD_CYGNUS_PERIPHERAL_RIGHT | ||
def_bool $(shields_list_contains,cygnus_peripheral_right) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# better range | ||
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y | ||
|
||
# 3 profiles (n+2) | ||
CONFIG_BT_MAX_CONN=5 | ||
CONFIG_BT_MAX_PAIRED=5 | ||
|
||
# dongle mode | ||
CONFIG_ZMK_SPLIT_BLE_CENTRAL_PERIPHERALS=2 | ||
|
||
# display | ||
CONFIG_ZMK_DISPLAY=y | ||
CONFIG_ZMK_IDLE_TIMEOUT=60000 | ||
CONFIG_BT_BAS=n | ||
CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING=y | ||
|
||
# Turn on logging, and set ZMK logging to debug output | ||
# CONFIG_ZMK_USB_LOGGING=y | ||
CONFIG_LOG_PROCESS_THREAD_STARTUP_DELAY_MS=8000 | ||
|
||
# 电池电量报告间隔时间单位是秒 | ||
CONFIG_ZMK_BATTERY_REPORT_INTERVAL=60 | ||
# 不活动 15 分钟后进入深度睡眠,深度睡眠纯在屏幕无法唤醒问题,是zmk固件本身问题已经在解决了 | ||
CONFIG_ZMK_SLEEP=y | ||
# 1800000 毫秒 = 30 分钟 * 60 秒 * 1000 | ||
CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=3600000 | ||
# 进入空闲状态前的不活动毫秒数 | ||
CONFIG_ZMK_IDLE_TIMEOUT=15000 | ||
# 增加键盘消抖 | ||
CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS=5 | ||
CONFIG_ZMK_KSCAN_DEBOUNCE_RELEASE_MS=5 | ||
# 增加键盘的 BLE 无线电的发射功率,用解决延迟和左右通讯不佳的问题 | ||
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y | ||
# 更改键盘默认显示名称 | ||
CONFIG_ZMK_KEYBOARD_NAME="Cygenus" | ||
CONFIG_ZMK_MOUSE=y |
52 changes: 52 additions & 0 deletions
52
config/boards/shields/cygnus/cygnus_central_dongle.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright (c) 2020 The ZMK Contributors | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
#include <dt-bindings/zmk/matrix_transform.h> | ||
|
||
/ { | ||
chosen { | ||
zmk,kscan = &mock_kscan; | ||
zmk,matrix-transform = &default_transform; | ||
zephyr,display = &oled; | ||
}; | ||
|
||
default_transform: keymap_transform_0 { | ||
compatible = "zmk,matrix-transform"; | ||
columns = <10>; | ||
rows = <4>; | ||
map = < | ||
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) | ||
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) | ||
RC(2,0) 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(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) | ||
>; | ||
}; | ||
|
||
mock_kscan: kscan_0 { | ||
compatible = "zmk,kscan-mock"; | ||
columns = <0>; | ||
rows = <0>; | ||
events = <0>; | ||
}; | ||
}; | ||
|
||
&pro_micro_i2c { | ||
status = "okay"; | ||
|
||
oled: ssd1306@3c { | ||
compatible = "solomon,ssd1306fb"; | ||
reg = <0x3c>; | ||
width = <128>; | ||
height = <64>; | ||
segment-offset = <0>; | ||
page-offset = <0>; | ||
display-offset = <0>; | ||
multiplex-ratio = <63>; | ||
segment-remap; | ||
com-invdir; | ||
inversion-on; | ||
prechargep = <0x22>; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# better range | ||
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y | ||
|
||
# 3 profiles (n+1) | ||
CONFIG_BT_MAX_CONN=4 | ||
CONFIG_BT_MAX_PAIRED=4 | ||
|
||
# combo config | ||
CONFIG_ZMK_COMBO_MAX_COMBOS_PER_KEY=7 | ||
|
||
# battery reporting | ||
CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING=y | ||
CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_PROXY=y | ||
|
||
# Turn on logging, and set ZMK logging to debug output | ||
# CONFIG_ZMK_USB_LOGGING=y | ||
CONFIG_LOG_PROCESS_THREAD_STARTUP_DELAY_MS=8000 | ||
|
||
# 电池电量报告间隔时间单位是秒 | ||
CONFIG_ZMK_BATTERY_REPORT_INTERVAL=60 | ||
# 不活动 15 分钟后进入深度睡眠,深度睡眠纯在屏幕无法唤醒问题,是zmk固件本身问题已经在解决了 | ||
CONFIG_ZMK_SLEEP=y | ||
# 1800000 毫秒 = 30 分钟 * 60 秒 * 1000 | ||
CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=3600000 | ||
# 进入空闲状态前的不活动毫秒数 | ||
CONFIG_ZMK_IDLE_TIMEOUT=15000 | ||
# 增加键盘消抖 | ||
CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS=5 | ||
CONFIG_ZMK_KSCAN_DEBOUNCE_RELEASE_MS=5 | ||
# 增加键盘的 BLE 无线电的发射功率,用解决延迟和左右通讯不佳的问题 | ||
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y | ||
# 更改键盘默认显示名称 | ||
CONFIG_ZMK_KEYBOARD_NAME="Cygnus" | ||
CONFIG_ZMK_MOUSE=y |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y |
16 changes: 16 additions & 0 deletions
16
config/boards/shields/cygnus/cygnus_peripheral_left.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* Copyright (c) 2020 The ZMK Contributors | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
#include "cygnus.dtsi" | ||
&kscan0 { | ||
col-gpios | ||
= <&pro_micro 21 GPIO_ACTIVE_HIGH> | ||
, <&pro_micro 20 GPIO_ACTIVE_HIGH> | ||
, <&pro_micro 19 GPIO_ACTIVE_HIGH> | ||
, <&pro_micro 18 GPIO_ACTIVE_HIGH> | ||
, <&pro_micro 15 GPIO_ACTIVE_HIGH> | ||
; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright (c) 2024 The ZMK Contributors | ||
# SPDX-License-Identifier: MIT | ||
|
||
config SHIELD_DONGLE_DISPLAY | ||
def_bool $(shields_list_contains,dongle_display) |
63 changes: 63 additions & 0 deletions
63
config/boards/shields/dongle_display/custom_status_screen.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* 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 <zephyr/logging/log.h> | ||
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; | ||
} |
Oops, something went wrong.