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

Make the standard Pillbug board ID be `pillbug/nrf52840/zmk` or
`pillbug//zmk` by shorthand.
This commit is contained in:
Peter Johanson 2026-01-13 18:57:37 -07:00
parent 10c252fee5
commit ebf099fd0f
16 changed files with 129 additions and 24 deletions

View File

@ -3,6 +3,6 @@
config BOARD_PILLBUG
select SOC_NRF52840_QIAA
imply RETAINED_MEM
imply RETENTION
imply RETENTION_BOOT_MODE
imply RETAINED_MEM if BOARD_PILLBUG_NRF52840_ZMK
imply RETENTION if BOARD_PILLBUG_NRF52840_ZMK
imply RETENTION_BOOT_MODE if BOARD_PILLBUG_NRF52840_ZMK

View File

@ -1,5 +1,5 @@
board:
name: pillbug
vendor: mechwild
socs:
- name: nrf52840
variants:
- name: zmk
qualifier: nrf52840

View File

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

View File

@ -0,0 +1,32 @@
/*
* Copyright (c) 2026 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
/dts-v1/;
#include <../boards/mechwild/pillbug/pillbug.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 = <&gpio1 7 GPIO_ACTIVE_LOW>;
init-delay-ms = <50>;
};
vbatt: vbatt {
compatible = "zmk,battery-voltage-divider";
io-channels = <&adc 2>;
output-ohms = <2000000>;
full-ohms = <(2000000 + 820000)>;
};
};

View File

@ -0,0 +1,8 @@
# Copyright (c) 2026 The ZMK Contributors
# SPDX-License-Identifier: Apache-2.0
config BOARD_PILLBUG
select SOC_NRF52840_QIAA
imply RETAINED_MEM
imply RETENTION
imply RETENTION_BOOT_MODE

View File

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

View File

@ -0,0 +1,5 @@
board:
name: pillbug
vendor: mechwild
socs:
- name: nrf52840

View File

@ -0,0 +1,56 @@
/*
* Copyright (c) 2026 The ZMK Contributors
* SPDX-License-Identifier: MIT
*/
&pinctrl {
uart0_default: uart0_default {
group1 {
psels = <NRF_PSEL(UART_RX, 0, 8)>;
bias-pull-up;
};
group2 {
psels = <NRF_PSEL(UART_TX, 0, 6)>;
};
};
uart0_sleep: uart0_sleep {
group1 {
psels = <NRF_PSEL(UART_RX, 0, 8)>,
<NRF_PSEL(UART_TX, 0, 6)>;
low-power-enable;
};
};
i2c0_default: i2c0_default {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 15)>,
<NRF_PSEL(TWIM_SCL, 0, 13)>;
};
};
i2c0_sleep: i2c0_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 15)>,
<NRF_PSEL(TWIM_SCL, 0, 13)>;
low-power-enable;
};
};
spi1_default: spi1_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 40)>,
<NRF_PSEL(SPIM_MOSI, 0, 11)>,
<NRF_PSEL(SPIM_MISO, 1, 26)>;
};
};
spi1_sleep: spi1_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 40)>,
<NRF_PSEL(SPIM_MOSI, 0, 11)>,
<NRF_PSEL(SPIM_MISO, 1, 26)>;
low-power-enable;
};
};
};

View File

@ -7,7 +7,6 @@
/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include <common/nordic/nrf52840_uf2_boot_mode.dtsi>
#include "pillbug-pinctrl.dtsi"
#include "blackpill_pins.dtsi"
@ -20,7 +19,6 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zmk,battery = &vbatt;
};
leds {
@ -29,20 +27,6 @@
gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
};
};
// Node name must match original "EXT_POWER" label to preserve user settings.
EXT_POWER {
compatible = "zmk,ext-power-generic";
control-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
init-delay-ms = <50>;
};
vbatt: vbatt {
compatible = "zmk,battery-voltage-divider";
io-channels = <&adc 2>;
output-ohms = <2000000>;
full-ohms = <(2000000 + 820000)>;
};
};
&adc {
@ -88,7 +72,6 @@ zephyr_udc0: &usbd {
status = "okay";
};
&flash0 {
/*
* For more information, see:

View File

@ -0,0 +1,14 @@
# Copyright (c) 2026 The ZMK Contributors
# SPDX-License-Identifier: MIT
# Enable MPU
CONFIG_ARM_MPU=y
# Use pinctrl
CONFIG_PINCTRL=y
# enable GPIO
CONFIG_GPIO=y
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_BUILD_OUTPUT_UF2=y