refactor(boards): Move mikoto to ZMK variant by default

Make the standard mikoto board ID be `mikoto/nrf52840/zmk` or
`mikoto//zmk` by shorthand.
This commit is contained in:
Peter Johanson 2026-01-14 23:39:37 -07:00
parent 5d5900fa5c
commit b589dd60d6
28 changed files with 145 additions and 35 deletions

View File

@ -3,7 +3,7 @@
config BOARD_MIKOTO
select SOC_NRF52840_QIAA
imply RETAINED_MEM
imply RETENTION
imply RETENTION_BOOT_MODE
imply RETAINED_MEM if BOARD_MIKOTO_NRF52840_ZMK
imply RETENTION if BOARD_MIKOTO_NRF52840_ZMK
imply RETENTION_BOOT_MODE if BOARD_MIKOTO_NRF52840_ZMK
imply I2C if BOARD_REVISION="7.2.0"

View File

@ -1,14 +1,5 @@
board:
name: mikoto
vendor: zhiayang
revision:
format: major.minor.patch
default: 5.20.0
exact: false
revisions:
- name: 5.20.0
- name: 6.1.0
- name: 6.3.0
- name: 7.2.0
socs:
- name: nrf52840
extend: mikoto
variants:
- name: zmk
qualifier: nrf52840

View File

@ -1,5 +1,5 @@
file_format: "1"
id: mikoto
id: mikoto//zmk
name: Mikoto
type: board
arch: arm

View File

@ -0,0 +1,28 @@
/*
* Copyright (c) 2026 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <../boards/zhiayang/mikoto/mikoto.dts>
#include <common/nordic/nrf52840_uf2_boot_mode.dtsi>
/ {
chosen {
zmk,battery = &vbatt;
};
// Node name must match original "EXT_POWER" label to preserve user settings.
EXT_POWER {
compatible = "zmk,ext-power-generic";
control-gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
init-delay-ms = <50>;
};
vbatt: vbatt {
compatible = "zmk,battery-voltage-divider";
io-channels = <&adc 1>;
output-ohms = <10000000>;
full-ohms = <(10000000 + 4000000)>;
};
};

View File

@ -0,0 +1,8 @@
/*
* Copyright (c) 2026 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <../boards/zhiayang/mikoto/mikoto-pinctrl.dtsi>
#include <../boards/zhiayang/mikoto/arduino_pro_micro_pins_v5.dtsi>

View File

@ -0,0 +1,8 @@
/*
* Copyright (c) 2026 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <../boards/zhiayang/mikoto/mikoto-pinctrl.dtsi>
#include <../boards/zhiayang/mikoto/arduino_pro_micro_pins_v5.dtsi>

View File

@ -0,0 +1,47 @@
/*
* Copyright (c) 2026 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <../boards/zhiayang/mikoto/mikoto-pinctrl.dtsi>
#include <../boards/zhiayang/mikoto/arduino_pro_micro_pins_v6.dtsi>
&pinctrl {
i2c1_default: i2c1_default {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 23)>,
<NRF_PSEL(TWIM_SCL, 0, 19)>;
bias-pull-up;
};
};
i2c1_sleep: i2c1_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 23)>,
<NRF_PSEL(TWIM_SCL, 0, 19)>;
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;
};
};

View File

@ -15,9 +15,6 @@ config USB_DEVICE_STACK
endif # USB
config BT_CTLR
default BT
choice BOARD_MIKOTO_CHARGER_CURRENT
default BOARD_MIKOTO_CHARGER_CURRENT_100MA
endchoice

View File

@ -0,0 +1,5 @@
# Copyright (c) 2026 The ZMK Contributors
# SPDX-License-Identifier: Apache-2.0
config BOARD_MIKOTO
select SOC_NRF52840_QIAA

View File

@ -0,0 +1,5 @@
# SPDX-License-Identifier: MIT
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)

View File

@ -0,0 +1,14 @@
board:
name: mikoto
vendor: zhiayang
revision:
format: major.minor.patch
default: 5.20.0
exact: false
revisions:
- name: 5.20.0
- name: 6.1.0
- name: 6.3.0
- name: 7.2.0
socs:
- name: nrf52840

View File

@ -16,7 +16,6 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zmk,battery = &vbatt;
};
leds {
@ -25,20 +24,6 @@
gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
};
};
// Node name must match original "EXT_POWER" label to preserve user settings.
EXT_POWER {
compatible = "zmk,ext-power-generic";
control-gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
init-delay-ms = <50>;
};
vbatt: vbatt {
compatible = "zmk,battery-voltage-divider";
io-channels = <&adc 1>;
output-ohms = <10000000>;
full-ohms = <(10000000 + 4000000)>;
};
};
&reg1 {

View File

@ -0,0 +1,2 @@
CONFIG_I2C=y
CONFIG_ZMK_MAX17048=y

View File

@ -0,0 +1,12 @@
# SPDX-License-Identifier: MIT
# Enable MPU
CONFIG_ARM_MPU=y
CONFIG_PINCTRL=y
# enable GPIO
CONFIG_GPIO=y
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_BUILD_OUTPUT_UF2=y

View File

@ -0,0 +1,8 @@
# Copyright (c) 2026 The ZMK Contributors
# SPDX-License-Identifier: MIT
#
# Suppresses duplicate unit-address warning at build time for power, clock, acl and flash-controller
# https://docs.zephyrproject.org/latest/build/dts/intro-input-output.html
list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")