From a9ff3a78a1aa3a1a64c063ec1960c680e9738eb3 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Wed, 4 Dec 2024 12:26:12 -0700 Subject: [PATCH 1/3] chore(main): release 0.1.0 (#2657) --- .release-please-manifest.json | 2 +- CHANGELOG.md | 22 ++++++++++++++++++++++ app/VERSION | 4 ++-- 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0967ef424bc..b881a39bc53 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{} +{".":"0.1.0"} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000000..e519cc56d07 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,22 @@ +# Changelog + +## 0.1.0 (2024-11-29) + + +### Features + +* **boards:** Add glove80 nexus node for extension GPIO. ([#2594](https://github.com/zmkfirmware/zmk/issues/2594)) ([fb359f5](https://github.com/zmkfirmware/zmk/commit/fb359f576619940164ca2e770b49b7b34f13428e)) +* **boards:** add nrf52833-nosd snippet ([63af296](https://github.com/zmkfirmware/zmk/commit/63af296b6efd8d677d584f372c9da9a4fedaa496)) +* **boards:** add nrf52840-nosd snippet ([4438b7b](https://github.com/zmkfirmware/zmk/commit/4438b7b835bfd1d4e89cdd955a4ab0fd2e2ae3bf)) +* **ci:** Add release-please automation with VERSION ([#2622](https://github.com/zmkfirmware/zmk/issues/2622)) ([ffa485c](https://github.com/zmkfirmware/zmk/commit/ffa485c11b48444acf3adf1e3c1cb3eed16fad94)) +* **drivers:** Support init high/low in 595 driver ([888c0d9](https://github.com/zmkfirmware/zmk/commit/888c0d966cd52f3ab5145992f61b14d6262c1951)) + + +### Bug Fixes + +* **boards:** Disable uart serial node in Xiao BLE by default ([#2672](https://github.com/zmkfirmware/zmk/issues/2672)) ([230b860](https://github.com/zmkfirmware/zmk/commit/230b860f31063774c3bcc19afb6f92479462de24)) +* **boards:** Fix typo in BT75 metadata ([c9553c3](https://github.com/zmkfirmware/zmk/commit/c9553c31e3a3f39964391b006492995b5bb09c39)) +* Disable display feature for settings_reset ([b0f5789](https://github.com/zmkfirmware/zmk/commit/b0f5789b128f0f5599341398898fdb0e0407b2d3)) +* Fix inconsistent column offset property ([c7473fc](https://github.com/zmkfirmware/zmk/commit/c7473fc32557d2d384ab78d3acf51a05488f0214)) +* include a header file for RC macros ([#2649](https://github.com/zmkfirmware/zmk/issues/2649)) ([f8eff2f](https://github.com/zmkfirmware/zmk/commit/f8eff2fe34609c91211c25113f9d7db09f7d1689)) +* **studio:** Improved error message when keyboard is missing a physical layout. ([fed66a9](https://github.com/zmkfirmware/zmk/commit/fed66a92d000f4c8e0019d9ccdd167271324e8e9)) diff --git a/app/VERSION b/app/VERSION index bce9f90bd5a..c63a64616fd 100644 --- a/app/VERSION +++ b/app/VERSION @@ -3,11 +3,11 @@ VERSION_MAJOR = 0 # x-release-please-end # x-release-please-start-minor -VERSION_MINOR = 0 +VERSION_MINOR = 1 # x-release-please-end # x-release-please-start-patch -PATCHLEVEL = 1 +PATCHLEVEL = 0 # x-release-please-end VERSION_TWEAK = 0 \ No newline at end of file From 40925d48e67b3eeaeb3e848a2287ed628de9f674 Mon Sep 17 00:00:00 2001 From: Nicolas Munnich <98408764+Nick-Munnich@users.noreply.github.com> Date: Wed, 4 Dec 2024 22:19:35 +0100 Subject: [PATCH 2/3] refactor(Kconfig): Extracted designer defaults out into new files (#2537) docs: Fix incorrect kconfig default values fix(Kconfig): Added a name to EC11's trigger mode choice, allowing it to be set in device Kconfig.defconfig refactor(Kconfig): Moved designer defaults out into new files --- app/Kconfig | 113 +++++++---------------- app/Kconfig.defaults | 83 +++++++++++++++++ app/module/drivers/sensor/ec11/Kconfig | 2 +- app/src/split/Kconfig | 3 +- app/src/split/Kconfig.defaults | 4 + app/src/split/bluetooth/Kconfig | 38 +------- app/src/split/bluetooth/Kconfig.defaults | 33 +++++++ docs/docs/config/system.md | 4 +- 8 files changed, 160 insertions(+), 120 deletions(-) create mode 100644 app/Kconfig.defaults create mode 100644 app/src/split/Kconfig.defaults create mode 100644 app/src/split/bluetooth/Kconfig.defaults diff --git a/app/Kconfig b/app/Kconfig index b0ffc72ac02..47ae73b25d1 100644 --- a/app/Kconfig +++ b/app/Kconfig @@ -46,7 +46,7 @@ config NRF_STORE_REBOOT_TYPE_GPREGRET bool default y -endif +endif # SOC_SERIES_NRF52X menu "HID" @@ -81,14 +81,11 @@ if ZMK_HID_REPORT_TYPE_HKRO config ZMK_HID_KEYBOARD_REPORT_SIZE int "# Keyboard Keys Reportable" - default 6 -endif +endif # ZMK_HID_REPORT_TYPE_HKRO config ZMK_HID_CONSUMER_REPORT_SIZE int "# Consumer Keys Reportable" - default 6 - choice ZMK_HID_CONSUMER_REPORT_USAGES prompt "HID Report Type" @@ -142,8 +139,7 @@ config USB_NUMOF_EP_WRITE_RETRIES config USB_HID_POLL_INTERVAL_MS default 1 -#ZMK_USB -endif +endif # ZMK_USB menuconfig ZMK_BLE bool "BLE (HID over GATT)" @@ -163,17 +159,14 @@ if ZMK_BLE config ZMK_BLE_EXPERIMENTAL_CONN bool "Experimental BLE connection changes" help - Enables a combination of settings that are planned to be default in future versions of ZMK - to improve connection stability. This includes changes to timing on BLE pairing initiation, - restores use of the updated/new LLCP implementation, and disables 2M PHY support. + Enables settings that are planned to be default in future versions of ZMK + to improve connection stability. config ZMK_BLE_EXPERIMENTAL_SEC bool "Experimental BLE security changes" imply BT_SMP_ALLOW_UNAUTH_OVERWRITE help - Enables a combination of settings that are planned to be officially supported in the future. - This includes enabling BT Secure Connection passkey entry, and allows overwrite of keys from - previously paired hosts. + Enables security settings that are planned to be officially supported in the future. config ZMK_BLE_EXPERIMENTAL_FEATURES bool "Experimental BLE connection and security settings/features" @@ -245,19 +238,15 @@ config BT_PERIPHERAL_PREF_LATENCY config BT_PERIPHERAL_PREF_TIMEOUT default 400 -#ZMK_BLE -endif +endif # ZMK_BLE -#Output Types -endmenu +endmenu # Output Types -# HID -endmenu +endmenu # HID rsource "src/split/Kconfig" -#Basic Keyboard Setup -endmenu +endmenu # Basic Keyboard Setup menu "Keymaps" @@ -275,7 +264,7 @@ config ZMK_KEYMAP_LAYER_NAME_MAX_LEN int "Max Layer Name Length" default 20 -endif +endif # ZMK_KEYMAP_SETTINGS_STORAGE endmenu # Keymaps @@ -292,67 +281,51 @@ menuconfig ZMK_RGB_UNDERGLOW if ZMK_RGB_UNDERGLOW -# This default value cuts down on tons of excess .conf files, if you're using GPIO, manually disable this -config SPI - default y - config ZMK_RGB_UNDERGLOW_EXT_POWER bool "RGB underglow toggling also controls external power" - default y config ZMK_RGB_UNDERGLOW_BRT_MIN int "RGB underglow minimum brightness in percent" range 0 100 - default 0 config ZMK_RGB_UNDERGLOW_BRT_MAX int "RGB underglow maximum brightness in percent" range ZMK_RGB_UNDERGLOW_BRT_MIN 100 - default 100 config ZMK_RGB_UNDERGLOW_HUE_STEP int "RGB underglow hue step in degrees" range 0 359 - default 10 config ZMK_RGB_UNDERGLOW_SAT_STEP int "RGB underglow saturation step in percent" range 0 100 - default 10 config ZMK_RGB_UNDERGLOW_BRT_STEP int "RGB underglow brightness step in percent" range 0 100 - default 10 config ZMK_RGB_UNDERGLOW_HUE_START int "RGB underglow start hue value in degrees" range 0 359 - default 0 config ZMK_RGB_UNDERGLOW_SAT_START int "RGB underglow start saturations value in percent" range 0 100 - default 100 config ZMK_RGB_UNDERGLOW_BRT_START int "RGB underglow start brightness value in percent" range ZMK_RGB_UNDERGLOW_BRT_MIN ZMK_RGB_UNDERGLOW_BRT_MAX - default ZMK_RGB_UNDERGLOW_BRT_MAX config ZMK_RGB_UNDERGLOW_SPD_START int "RGB underglow start animation speed value" range 1 5 - default 3 config ZMK_RGB_UNDERGLOW_EFF_START int "RGB underglow start effect int value related to the effect enum list" range 0 3 - default 0 config ZMK_RGB_UNDERGLOW_ON_START bool "RGB underglow starts on by default" - default y config ZMK_RGB_UNDERGLOW_AUTO_OFF_IDLE bool "Turn off RGB underglow when keyboard goes into idle state" @@ -361,8 +334,7 @@ config ZMK_RGB_UNDERGLOW_AUTO_OFF_USB bool "Turn off RGB underglow when USB is disconnected" depends on USB_DEVICE_STACK -#ZMK_RGB_UNDERGLOW -endif +endif # ZMK_RGB_UNDERGLOW menuconfig ZMK_BACKLIGHT bool "LED backlight" @@ -373,16 +345,13 @@ if ZMK_BACKLIGHT config ZMK_BACKLIGHT_BRT_STEP int "Brightness step in percent" range 1 100 - default 20 config ZMK_BACKLIGHT_BRT_START int "Default brightness in percent" range 1 100 - default 40 config ZMK_BACKLIGHT_ON_START bool "Default backlight state" - default y config ZMK_BACKLIGHT_AUTO_OFF_IDLE bool "Turn off backlight when keyboard goes into idle state" @@ -390,19 +359,16 @@ config ZMK_BACKLIGHT_AUTO_OFF_IDLE config ZMK_BACKLIGHT_AUTO_OFF_USB bool "Turn off backlight when USB is disconnected" -#ZMK_BACKLIGHT -endif +endif # ZMK_BACKLIGHT -#Display/LED Options -endmenu +endmenu # Display/LED Options menu "Mouse Options" config ZMK_MOUSE bool "Enable ZMK mouse emulation" -#Mouse Options -endmenu +endmenu # Mouse Options menu "Power Management" @@ -424,7 +390,8 @@ config ZMK_BATTERY_REPORTING_FETCH_MODE_LITHIUM_VOLTAGE bool "Lithium Voltage" endchoice -endif + +endif # ZMK_BATTERY_REPORTING config ZMK_IDLE_TIMEOUT int "Milliseconds of inactivity before entering idle state (OLED shutoff, etc)" @@ -446,12 +413,10 @@ config ZMK_IDLE_SLEEP_TIMEOUT int "Milliseconds of inactivity before entering deep sleep" default 900000 -#ZMK_SLEEP -endif +endif # ZMK_SLEEP config ZMK_EXT_POWER bool "Enable support to control external power output" - default y config ZMK_PM bool @@ -473,7 +438,7 @@ config ZMK_GPIO_KEY_WAKEUP_TRIGGER default y depends on DT_HAS_ZMK_GPIO_KEY_WAKEUP_TRIGGER_ENABLED && ZMK_PM_SOFT_OFF -#Power Management +# Power Management endmenu menu "Combo options" @@ -490,7 +455,7 @@ config ZMK_COMBO_MAX_KEYS_PER_COMBO int "Maximum number of keys per combo" default 4 -#Combo options +# Combo options endmenu menu "Behavior Options" @@ -525,8 +490,7 @@ config ZMK_USB_HID_INIT_PRIORITY int "USB HID Init Priority" default 95 -#USB -endif +endif # USB if ZMK_BLE || ZMK_SPLIT_BLE @@ -534,11 +498,9 @@ config ZMK_BLE_INIT_PRIORITY int "BLE Init Priority" default 50 -#ZMK_BLE || ZMK_SPLIT_BLE -endif +endif # ZMK_BLE || ZMK_SPLIT_BLE -#Initialization Priorities -endmenu +endmenu # Initialization Priorities menuconfig ZMK_KSCAN bool "ZMK KScan Integration" @@ -612,8 +574,7 @@ config USB_CDC_ACM_RINGBUF_SIZE config LOG_PROCESS_THREAD_STARTUP_DELAY_MS default 1000 -#ZMK_USB_LOGGING -endif +endif # ZMK_USB_LOGGING config ZMK_RTT_LOGGING bool "Enable RTT logging to help debug" @@ -629,8 +590,7 @@ if ZMK_RTT_LOGGING config SEGGER_RTT_BUFFER_SIZE_UP default 8192 -#ZMK_RTT_LOGGING -endif +endif # ZMK_RTT_LOGGING if ZMK_USB_LOGGING || ZMK_RTT_LOGGING @@ -640,11 +600,9 @@ config LOG_BUFFER_SIZE config LOG_PROCESS_THREAD_SLEEP_MS default 100 -#ZMK_USB_LOGGING || ZMK_RTT_LOGGING -endif +endif # ZMK_USB_LOGGING || ZMK_RTT_LOGGING -#Logging -endmenu +endmenu # Logging if SETTINGS @@ -660,21 +618,17 @@ config ZMK_SETTINGS_RESET_ON_START_INIT_PRIORITY Initialization priority for the settings reset on start. Must be lower priority/ higher value than FLASH_INIT_PRIORITY if using the NVS/Flash settings backend. - -endif - +endif # ZMK_SETTINGS_RESET_ON_START config ZMK_SETTINGS_SAVE_DEBOUNCE int "Milliseconds to debounce settings saves" default 60000 -#SETTINGS -endif +endif # SETTINGS config ZMK_BATTERY_REPORT_INTERVAL depends on ZMK_BATTERY_REPORTING int "Battery level report interval in seconds" - default 60 config ZMK_LOW_PRIORITY_WORK_QUEUE bool "Work queue for low priority items" @@ -689,13 +643,11 @@ config ZMK_LOW_PRIORITY_THREAD_PRIORITY int "Low priority thread priority" default 10 -endif +endif # ZMK_LOW_PRIORITY_WORK_QUEUE -#Advanced -endmenu +endmenu # Advanced -#ZMK -endmenu +endmenu # ZMK config KERNEL_BIN_NAME default "zmk" @@ -747,5 +699,6 @@ rsource "boards/shields/*/Kconfig.shield" osource "$(ZMK_CONFIG)/boards/shields/*/Kconfig.defconfig" osource "$(ZMK_CONFIG)/boards/shields/*/Kconfig.shield" +rsource "Kconfig.defaults" source "Kconfig.zephyr" diff --git a/app/Kconfig.defaults b/app/Kconfig.defaults new file mode 100644 index 00000000000..02d845f1ba4 --- /dev/null +++ b/app/Kconfig.defaults @@ -0,0 +1,83 @@ +# Copyright (c) 2024 The ZMK Contributors +# SPDX-License-Identifier: MIT + +# HID +if ZMK_HID_REPORT_TYPE_HKRO + +config ZMK_HID_KEYBOARD_REPORT_SIZE + default 6 + +endif + +config ZMK_HID_CONSUMER_REPORT_SIZE + default 6 + +# Underglow +if ZMK_RGB_UNDERGLOW + +# This default value cuts down on tons of excess .conf files, if you're using GPIO, manually disable this +config SPI + default y + +config ZMK_RGB_UNDERGLOW_EXT_POWER + default y + +config ZMK_RGB_UNDERGLOW_BRT_MIN + default 0 + +config ZMK_RGB_UNDERGLOW_BRT_MAX + default 100 + +config ZMK_RGB_UNDERGLOW_HUE_STEP + default 10 + +config ZMK_RGB_UNDERGLOW_SAT_STEP + default 10 + +config ZMK_RGB_UNDERGLOW_BRT_STEP + default 10 + +config ZMK_RGB_UNDERGLOW_HUE_START + default 0 + +config ZMK_RGB_UNDERGLOW_SAT_START + default 100 + +config ZMK_RGB_UNDERGLOW_BRT_START + default ZMK_RGB_UNDERGLOW_BRT_MAX + +config ZMK_RGB_UNDERGLOW_SPD_START + default 3 + +config ZMK_RGB_UNDERGLOW_EFF_START + default 0 + +config ZMK_RGB_UNDERGLOW_ON_START + default y + +endif # ZMK_RGB_UNDERGLOW + +# Backlight +if ZMK_BACKLIGHT + +config ZMK_BACKLIGHT_BRT_STEP + default 20 + +config ZMK_BACKLIGHT_BRT_START + default 40 + +config ZMK_BACKLIGHT_ON_START + default y + +endif # ZMK_BACKLIGHT + +# Ext_power +config ZMK_EXT_POWER + default y + +# Battery +config ZMK_BATTERY_REPORT_INTERVAL + default 60 + +# Imports +rsource "src/split/Kconfig.defaults" \ No newline at end of file diff --git a/app/module/drivers/sensor/ec11/Kconfig b/app/module/drivers/sensor/ec11/Kconfig index 5da327280a8..7c10eaa9bd7 100644 --- a/app/module/drivers/sensor/ec11/Kconfig +++ b/app/module/drivers/sensor/ec11/Kconfig @@ -11,7 +11,7 @@ menuconfig EC11 if EC11 -choice +choice EC11_TRIGGER_MODE prompt "Trigger mode" default EC11_TRIGGER_NONE help diff --git a/app/src/split/Kconfig b/app/src/split/Kconfig index ce90037b1ea..a076aa580de 100644 --- a/app/src/split/Kconfig +++ b/app/src/split/Kconfig @@ -26,7 +26,6 @@ config ZMK_SPLIT_PERIPHERAL_HID_INDICATORS help Enable propagating the HID (LED) Indicator state to the split peripheral(s). -#ZMK_SPLIT -endif +endif # ZMK_SPLIT rsource "bluetooth/Kconfig" diff --git a/app/src/split/Kconfig.defaults b/app/src/split/Kconfig.defaults new file mode 100644 index 00000000000..eb23168b921 --- /dev/null +++ b/app/src/split/Kconfig.defaults @@ -0,0 +1,4 @@ +# Copyright (c) 2024 The ZMK Contributors +# SPDX-License-Identifier: MIT + +rsource "bluetooth/Kconfig.defaults" diff --git a/app/src/split/bluetooth/Kconfig b/app/src/split/bluetooth/Kconfig index 7f362fdedc1..dec192247d4 100644 --- a/app/src/split/bluetooth/Kconfig +++ b/app/src/split/bluetooth/Kconfig @@ -5,7 +5,7 @@ if ZMK_SPLIT && ZMK_SPLIT_BLE menu "BLE Transport" -# Added for backwards compatibility. New shields/board should set `ZMK_SPLIT_ROLE_CENTRAL` only. +# Added for backwards compatibility. New shields / board should set `ZMK_SPLIT_ROLE_CENTRAL` only. config ZMK_SPLIT_BLE_ROLE_CENTRAL bool select ZMK_SPLIT_ROLE_CENTRAL @@ -24,7 +24,6 @@ if ZMK_SPLIT_ROLE_CENTRAL config ZMK_SPLIT_BLE_CENTRAL_PERIPHERALS int "Number of peripherals that will connect to the central." - default 1 menuconfig ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING bool "Fetch Peripheral Battery Level Info" @@ -96,39 +95,8 @@ config BT_MAX_CONN config BT_GAP_AUTO_UPDATE_CONN_PARAMS default n -#!ZMK_SPLIT_ROLE_CENTRAL -endif +endif # !ZMK_SPLIT_ROLE_CENTRAL endmenu -#ZMK_SPLIT_BLE -endif - - -if ZMK_BLE - -if ZMK_SPLIT_BLE && ZMK_SPLIT_ROLE_CENTRAL - -config BT_MAX_CONN - default 6 - -config BT_MAX_PAIRED - default 6 - -#ZMK_SPLIT_BLE && ZMK_SPLIT_ROLE_CENTRAL -endif - -if !ZMK_SPLIT_BLE - -config BT_MAX_CONN - default 5 - -config BT_MAX_PAIRED - default 5 - -#!ZMK_SPLIT_BLE -endif - -#ZMK_BLE -endif - +endif # ZMK_SPLIT_BLE diff --git a/app/src/split/bluetooth/Kconfig.defaults b/app/src/split/bluetooth/Kconfig.defaults new file mode 100644 index 00000000000..bf6fa1c1c20 --- /dev/null +++ b/app/src/split/bluetooth/Kconfig.defaults @@ -0,0 +1,33 @@ +# Copyright (c) 2024 The ZMK Contributors +# SPDX-License-Identifier: MIT + +if ZMK_BLE + +if ZMK_SPLIT_BLE && ZMK_SPLIT_ROLE_CENTRAL + +config ZMK_SPLIT_BLE_CENTRAL_PERIPHERALS + default 1 + +config BT_MAX_CONN + default 6 + +config BT_MAX_PAIRED + default 6 + +#ZMK_SPLIT_BLE && ZMK_SPLIT_ROLE_CENTRAL +endif + +if !ZMK_SPLIT_BLE + +config BT_MAX_CONN + default 5 + +config BT_MAX_PAIRED + default 5 + +#!ZMK_SPLIT_BLE +endif + +#ZMK_BLE +endif + diff --git a/docs/docs/config/system.md b/docs/docs/config/system.md index ad719541a39..2b6e8f0c8c8 100644 --- a/docs/docs/config/system.md +++ b/docs/docs/config/system.md @@ -103,7 +103,7 @@ for more information on configuring Bluetooth. | `CONFIG_ZMK_BLE_KEYBOARD_REPORT_QUEUE_SIZE` | int | Max number of keyboard HID reports to queue for sending over BLE | 20 | | `CONFIG_ZMK_BLE_INIT_PRIORITY` | int | BLE init priority | 50 | | `CONFIG_ZMK_BLE_THREAD_PRIORITY` | int | Priority of the BLE notify thread | 5 | -| `CONFIG_ZMK_BLE_THREAD_STACK_SIZE` | int | Stack size of the BLE notify thread | 512 | +| `CONFIG_ZMK_BLE_THREAD_STACK_SIZE` | int | Stack size of the BLE notify thread | 768 | | `CONFIG_ZMK_BLE_PASSKEY_ENTRY` | bool | Experimental: require typing passkey from host to pair BLE connection | n | Note that `CONFIG_BT_MAX_CONN` and `CONFIG_BT_MAX_PAIRED` should be set to the same value. On a split keyboard they should only be set for the central and must be set to one greater than the desired number of bluetooth profiles. @@ -132,7 +132,7 @@ Following [split keyboard](../features/split-keyboards.md) settings are defined | `CONFIG_ZMK_SPLIT_BLE_CENTRAL_POSITION_QUEUE_SIZE` | int | Max number of key state events to queue when received from peripherals | 5 | | `CONFIG_ZMK_SPLIT_BLE_CENTRAL_SPLIT_RUN_STACK_SIZE` | int | Stack size of the BLE split central write thread | 512 | | `CONFIG_ZMK_SPLIT_BLE_CENTRAL_SPLIT_RUN_QUEUE_SIZE` | int | Max number of behavior run events to queue to send to the peripheral(s) | 5 | -| `CONFIG_ZMK_SPLIT_BLE_PERIPHERAL_STACK_SIZE` | int | Stack size of the BLE split peripheral notify thread | 650 | +| `CONFIG_ZMK_SPLIT_BLE_PERIPHERAL_STACK_SIZE` | int | Stack size of the BLE split peripheral notify thread | 756 | | `CONFIG_ZMK_SPLIT_BLE_PERIPHERAL_PRIORITY` | int | Priority of the BLE split peripheral notify thread | 5 | | `CONFIG_ZMK_SPLIT_BLE_PERIPHERAL_POSITION_QUEUE_SIZE` | int | Max number of key state events to queue to send to the central | 10 | From b26058b6c7c83f8d1f095d2f9c6c3998b391a61b Mon Sep 17 00:00:00 2001 From: yuki <500236+zhiayang@users.noreply.github.com> Date: Thu, 5 Dec 2024 15:02:58 +0800 Subject: [PATCH 3/3] feat(boards): Update for mikoto board definition (#1946) * Set default revision to 5.20 * update mikoto board defs * add revision info to mikoto.zmk.yml * use zephyr aliases to handle mikoto_520 * enable pull-ups for on-board i2c --- app/CMakeLists.txt | 1 + app/boards/aliases.cmake | 2 + app/boards/arm/mikoto/Kconfig | 8 +-- app/boards/arm/mikoto/Kconfig.board | 4 +- app/boards/arm/mikoto/Kconfig.defconfig | 4 +- ...ns.dtsi => arduino_pro_micro_pins_v5.dtsi} | 0 .../arm/mikoto/arduino_pro_micro_pins_v6.dtsi | 59 +++++++++++++++++++ ...o_520-pinctrl.dtsi => mikoto-pinctrl.dtsi} | 6 +- .../arm/mikoto/{mikoto_520.dts => mikoto.dts} | 2 - .../mikoto/{mikoto_520.yaml => mikoto.yaml} | 4 +- .../{mikoto_520.zmk.yml => mikoto.zmk.yml} | 10 +++- app/boards/arm/mikoto/mikoto_5_20_0.overlay | 8 +++ app/boards/arm/mikoto/mikoto_6_1_0.overlay | 8 +++ app/boards/arm/mikoto/mikoto_7_2_0.conf | 2 + app/boards/arm/mikoto/mikoto_7_2_0.overlay | 47 +++++++++++++++ ...{mikoto_520_defconfig => mikoto_defconfig} | 3 +- app/boards/arm/mikoto/pinmux.c | 2 +- app/boards/arm/mikoto/revision.cmake | 7 +++ .../{mikoto_520.overlay => mikoto.overlay} | 0 19 files changed, 157 insertions(+), 20 deletions(-) create mode 100644 app/boards/aliases.cmake rename app/boards/arm/mikoto/{arduino_pro_micro_pins.dtsi => arduino_pro_micro_pins_v5.dtsi} (100%) create mode 100644 app/boards/arm/mikoto/arduino_pro_micro_pins_v6.dtsi rename app/boards/arm/mikoto/{mikoto_520-pinctrl.dtsi => mikoto-pinctrl.dtsi} (88%) rename app/boards/arm/mikoto/{mikoto_520.dts => mikoto.dts} (97%) rename app/boards/arm/mikoto/{mikoto_520.yaml => mikoto.yaml} (78%) rename app/boards/arm/mikoto/{mikoto_520.zmk.yml => mikoto.zmk.yml} (55%) create mode 100644 app/boards/arm/mikoto/mikoto_5_20_0.overlay create mode 100644 app/boards/arm/mikoto/mikoto_6_1_0.overlay create mode 100644 app/boards/arm/mikoto/mikoto_7_2_0.conf create mode 100644 app/boards/arm/mikoto/mikoto_7_2_0.overlay rename app/boards/arm/mikoto/{mikoto_520_defconfig => mikoto_defconfig} (93%) create mode 100644 app/boards/arm/mikoto/revision.cmake rename app/boards/shields/nice_view_adapter/boards/{mikoto_520.overlay => mikoto.overlay} (100%) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index fd4b7ab5519..75925b7e0d3 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.13.1) set(CONFIG_APPLICATION_DEFINED_SYSCALL true) +set(ZEPHYR_BOARD_ALIASES "boards/aliases.cmake") set(ZEPHYR_EXTRA_MODULES "${ZMK_EXTRA_MODULES};${CMAKE_CURRENT_SOURCE_DIR}/module;${CMAKE_CURRENT_SOURCE_DIR}/keymap-module") # Find Zephyr. This also loads Zephyr's build system. diff --git a/app/boards/aliases.cmake b/app/boards/aliases.cmake new file mode 100644 index 00000000000..d0a4d81d88e --- /dev/null +++ b/app/boards/aliases.cmake @@ -0,0 +1,2 @@ +# defines board aliases for shorter names (or for renaming boards) +set(mikoto_520_BOARD_ALIAS "mikoto") diff --git a/app/boards/arm/mikoto/Kconfig b/app/boards/arm/mikoto/Kconfig index fab2218c049..616d63a5dd4 100644 --- a/app/boards/arm/mikoto/Kconfig +++ b/app/boards/arm/mikoto/Kconfig @@ -2,17 +2,17 @@ config BOARD_ENABLE_DCDC bool "Enable DCDC mode" select SOC_DCDC_NRF52X default y - depends on (BOARD_MIKOTO_520) + depends on (BOARD_MIKOTO) config BOARD_ENABLE_DCDC_HV bool "High voltage DCDC converter" select SOC_DCDC_NRF52X_HV default y - depends on (BOARD_MIKOTO_520) + depends on (BOARD_MIKOTO) choice BOARD_MIKOTO_CHARGER_CURRENT prompt "Charge current to supply to attached batteries" - depends on (BOARD_MIKOTO_520) + depends on (BOARD_MIKOTO) config BOARD_MIKOTO_CHARGER_CURRENT_40MA bool "40mA charge current, for battery capacity 40mAh or higher" @@ -32,4 +32,4 @@ config BOARD_MIKOTO_CHARGER_CURRENT_350MA config BOARD_MIKOTO_CHARGER_CURRENT_NONE bool "Disable charge current" -endchoice \ No newline at end of file +endchoice diff --git a/app/boards/arm/mikoto/Kconfig.board b/app/boards/arm/mikoto/Kconfig.board index a872fa1fa01..b51dce8adb2 100644 --- a/app/boards/arm/mikoto/Kconfig.board +++ b/app/boards/arm/mikoto/Kconfig.board @@ -3,6 +3,6 @@ # Copyright (c) 2020 The ZMK Contributors # SPDX-License-Identifier: MIT -config BOARD_MIKOTO_520 - bool "mikoto_520" +config BOARD_MIKOTO + bool "mikoto" depends on SOC_NRF52840_QIAA diff --git a/app/boards/arm/mikoto/Kconfig.defconfig b/app/boards/arm/mikoto/Kconfig.defconfig index 5702c6de347..0710f6fde84 100644 --- a/app/boards/arm/mikoto/Kconfig.defconfig +++ b/app/boards/arm/mikoto/Kconfig.defconfig @@ -3,7 +3,7 @@ # Copyright (c) 2020 The ZMK Contributors # SPDX-License-Identifier: MIT -if BOARD_MIKOTO_520 +if BOARD_MIKOTO config BOARD default "mikoto" @@ -25,4 +25,4 @@ choice BOARD_MIKOTO_CHARGER_CURRENT default BOARD_MIKOTO_CHARGER_CURRENT_100MA endchoice -endif # BOARD_MIKOTO_520 +endif # BOARD_MIKOTO diff --git a/app/boards/arm/mikoto/arduino_pro_micro_pins.dtsi b/app/boards/arm/mikoto/arduino_pro_micro_pins_v5.dtsi similarity index 100% rename from app/boards/arm/mikoto/arduino_pro_micro_pins.dtsi rename to app/boards/arm/mikoto/arduino_pro_micro_pins_v5.dtsi diff --git a/app/boards/arm/mikoto/arduino_pro_micro_pins_v6.dtsi b/app/boards/arm/mikoto/arduino_pro_micro_pins_v6.dtsi new file mode 100644 index 00000000000..79d8b1558b9 --- /dev/null +++ b/app/boards/arm/mikoto/arduino_pro_micro_pins_v6.dtsi @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + + +/ { + pro_micro: connector { + compatible = "arduino-pro-micro"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map + = <0 0 &gpio0 4 0> /* D0 */ + , <1 0 &gpio0 8 0> /* D1 */ + , <2 0 &gpio0 17 0> /* D2 */ + , <3 0 &gpio0 20 0> /* D3 */ + , <4 0 &gpio0 22 0> /* D4/A6 */ + , <5 0 &gpio0 24 0> /* D5 */ + , <6 0 &gpio1 8 0> /* D6/A7 */ + , <7 0 &gpio1 2 0> /* D7 */ + , <8 0 &gpio1 4 0> /* D8/A8 */ + , <9 0 &gpio1 6 0> /* D9/A9 */ + , <10 0 &gpio0 9 0> /* D10/A10 */ + , <16 0 &gpio0 10 0> /* D16 */ + , <14 0 &gpio1 13 0> /* D14 */ + , <15 0 &gpio0 2 0> /* D15 */ + , <18 0 &gpio0 29 0> /* D18/A0 */ + , <19 0 &gpio0 31 0> /* D19/A1 */ + , <20 0 &gpio0 25 0> /* D20/A2 */ + , <21 0 &gpio0 11 0> /* D21/A3 */ + ; + }; + + pro_micro_a: connector_a { + compatible = "arduino-pro-micro"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map + = <0 0 &gpio0 29 0> /* D18/A0 */ + , <1 0 &gpio0 31 0> /* D19/A1 */ + , <2 0 &gpio0 25 0> /* D20/A2 */ + , <3 0 &gpio0 11 0> /* D21/A3 */ + , <6 0 &gpio0 22 0> /* D4/A6 */ + , <7 0 &gpio1 8 0> /* D6/A7 */ + , <8 0 &gpio1 4 0> /* D8/A8 */ + , <9 0 &gpio1 6 0> /* D9/A9 */ + , <10 0 &gpio0 9 0> /* D10/A10 */ + ; + }; +}; + + +pro_micro_d: &pro_micro {}; +pro_micro_i2c: &i2c0 {}; +pro_micro_spi: &spi0 {}; +pro_micro_serial: &uart0 {}; diff --git a/app/boards/arm/mikoto/mikoto_520-pinctrl.dtsi b/app/boards/arm/mikoto/mikoto-pinctrl.dtsi similarity index 88% rename from app/boards/arm/mikoto/mikoto_520-pinctrl.dtsi rename to app/boards/arm/mikoto/mikoto-pinctrl.dtsi index 8cd1e0afc13..1c85c203ad7 100644 --- a/app/boards/arm/mikoto/mikoto_520-pinctrl.dtsi +++ b/app/boards/arm/mikoto/mikoto-pinctrl.dtsi @@ -17,7 +17,7 @@ uart0_sleep: uart0_sleep { group1 { psels = , - ; + ; low-power-enable; }; }; @@ -25,14 +25,14 @@ i2c0_default: i2c0_default { group1 { psels = , - ; + ; }; }; i2c0_sleep: i2c0_sleep { group1 { psels = , - ; + ; low-power-enable; }; }; diff --git a/app/boards/arm/mikoto/mikoto_520.dts b/app/boards/arm/mikoto/mikoto.dts similarity index 97% rename from app/boards/arm/mikoto/mikoto_520.dts rename to app/boards/arm/mikoto/mikoto.dts index 3ea48cd9911..b8dca950308 100644 --- a/app/boards/arm/mikoto/mikoto_520.dts +++ b/app/boards/arm/mikoto/mikoto.dts @@ -6,8 +6,6 @@ /dts-v1/; #include -#include "arduino_pro_micro_pins.dtsi" -#include "mikoto_520-pinctrl.dtsi" / { model = "mikoto"; diff --git a/app/boards/arm/mikoto/mikoto_520.yaml b/app/boards/arm/mikoto/mikoto.yaml similarity index 78% rename from app/boards/arm/mikoto/mikoto_520.yaml rename to app/boards/arm/mikoto/mikoto.yaml index 8d9f49ae855..7410471eb57 100644 --- a/app/boards/arm/mikoto/mikoto_520.yaml +++ b/app/boards/arm/mikoto/mikoto.yaml @@ -1,5 +1,5 @@ -identifier: mikoto_520 -name: mikoto_520 +identifier: mikoto +name: mikoto type: mcu arch: arm toolchain: diff --git a/app/boards/arm/mikoto/mikoto_520.zmk.yml b/app/boards/arm/mikoto/mikoto.zmk.yml similarity index 55% rename from app/boards/arm/mikoto/mikoto_520.zmk.yml rename to app/boards/arm/mikoto/mikoto.zmk.yml index 91dcc9e09a6..6e073410fa6 100644 --- a/app/boards/arm/mikoto/mikoto_520.zmk.yml +++ b/app/boards/arm/mikoto/mikoto.zmk.yml @@ -1,6 +1,6 @@ file_format: "1" -id: mikoto_520 -name: Mikoto 5.20 +id: mikoto +name: Mikoto type: board arch: arm outputs: @@ -8,3 +8,9 @@ outputs: - ble url: https://github.com/zhiayang/mikoto exposes: [pro_micro] +revisions: + - "5.20" + - "6.1" + - "6.3" + - "7.2" +default_revision: "5.20" diff --git a/app/boards/arm/mikoto/mikoto_5_20_0.overlay b/app/boards/arm/mikoto/mikoto_5_20_0.overlay new file mode 100644 index 00000000000..f9e744ea372 --- /dev/null +++ b/app/boards/arm/mikoto/mikoto_5_20_0.overlay @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2023 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include "mikoto-pinctrl.dtsi" +#include "arduino_pro_micro_pins_v5.dtsi" diff --git a/app/boards/arm/mikoto/mikoto_6_1_0.overlay b/app/boards/arm/mikoto/mikoto_6_1_0.overlay new file mode 100644 index 00000000000..80466fd2589 --- /dev/null +++ b/app/boards/arm/mikoto/mikoto_6_1_0.overlay @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2023 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include "mikoto-pinctrl.dtsi" +#include "arduino_pro_micro_pins_v6.dtsi" diff --git a/app/boards/arm/mikoto/mikoto_7_2_0.conf b/app/boards/arm/mikoto/mikoto_7_2_0.conf new file mode 100644 index 00000000000..8bf928868c5 --- /dev/null +++ b/app/boards/arm/mikoto/mikoto_7_2_0.conf @@ -0,0 +1,2 @@ +CONFIG_I2C=y +CONFIG_ZMK_MAX17048=y diff --git a/app/boards/arm/mikoto/mikoto_7_2_0.overlay b/app/boards/arm/mikoto/mikoto_7_2_0.overlay new file mode 100644 index 00000000000..30c05510a82 --- /dev/null +++ b/app/boards/arm/mikoto/mikoto_7_2_0.overlay @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2023 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include "mikoto-pinctrl.dtsi" +#include "arduino_pro_micro_pins_v6.dtsi" + +&pinctrl { + i2c1_default: i2c1_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c1_sleep: i2c1_sleep { + group1 { + psels = , + ; + low-power-enable; + bias-pull-up; + }; + }; +}; + +&i2c1 { + status = "okay"; + compatible = "nordic,nrf-twi"; + pinctrl-0 = <&i2c1_default>; + pinctrl-1 = <&i2c1_sleep>; + pinctrl-names = "default", "sleep"; + + builtin_fuel_gauge: max17048@36 { + compatible = "zmk,maxim-max17048"; + status = "okay"; + reg = <0x36>; + }; +}; + +/ { + chosen { + zmk,battery = &builtin_fuel_gauge; + }; +}; diff --git a/app/boards/arm/mikoto/mikoto_520_defconfig b/app/boards/arm/mikoto/mikoto_defconfig similarity index 93% rename from app/boards/arm/mikoto/mikoto_520_defconfig rename to app/boards/arm/mikoto/mikoto_defconfig index 354fa56aa34..4b3bc7d9758 100644 --- a/app/boards/arm/mikoto/mikoto_520_defconfig +++ b/app/boards/arm/mikoto/mikoto_defconfig @@ -2,11 +2,10 @@ CONFIG_SOC_SERIES_NRF52X=y CONFIG_SOC_NRF52840_QIAA=y -CONFIG_BOARD_MIKOTO_520=y +CONFIG_BOARD_MIKOTO=y # Enable MPU CONFIG_ARM_MPU=y - CONFIG_PINCTRL=y # enable GPIO diff --git a/app/boards/arm/mikoto/pinmux.c b/app/boards/arm/mikoto/pinmux.c index c34c2dc85b1..a39014247c5 100644 --- a/app/boards/arm/mikoto/pinmux.c +++ b/app/boards/arm/mikoto/pinmux.c @@ -13,7 +13,7 @@ static int pinmux_mikoto_init(void) { -#if CONFIG_BOARD_MIKOTO_520 +#if CONFIG_BOARD_MIKOTO const struct device *p0 = DEVICE_DT_GET(DT_NODELABEL(gpio0)); const struct device *p1 = DEVICE_DT_GET(DT_NODELABEL(gpio1)); #if CONFIG_BOARD_MIKOTO_CHARGER_CURRENT_40MA diff --git a/app/boards/arm/mikoto/revision.cmake b/app/boards/arm/mikoto/revision.cmake new file mode 100644 index 00000000000..12fd4bd4da0 --- /dev/null +++ b/app/boards/arm/mikoto/revision.cmake @@ -0,0 +1,7 @@ +board_check_revision(FORMAT MAJOR.MINOR.PATCH + DEFAULT_REVISION 5.20.0 + VALID_REVISIONS + 5.20.0 # first public release + 6.1.0 6.3.0 # incompatible pinout change from v5+ + 7.2.0 # addition of MAX17048; compatible pinout with v6+ +) diff --git a/app/boards/shields/nice_view_adapter/boards/mikoto_520.overlay b/app/boards/shields/nice_view_adapter/boards/mikoto.overlay similarity index 100% rename from app/boards/shields/nice_view_adapter/boards/mikoto_520.overlay rename to app/boards/shields/nice_view_adapter/boards/mikoto.overlay