mirror of https://github.com/zmkfirmware/zmk.git
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:
parent
10c252fee5
commit
ebf099fd0f
|
|
@ -3,6 +3,6 @@
|
||||||
|
|
||||||
config BOARD_PILLBUG
|
config BOARD_PILLBUG
|
||||||
select SOC_NRF52840_QIAA
|
select SOC_NRF52840_QIAA
|
||||||
imply RETAINED_MEM
|
imply RETAINED_MEM if BOARD_PILLBUG_NRF52840_ZMK
|
||||||
imply RETENTION
|
imply RETENTION if BOARD_PILLBUG_NRF52840_ZMK
|
||||||
imply RETENTION_BOOT_MODE
|
imply RETENTION_BOOT_MODE if BOARD_PILLBUG_NRF52840_ZMK
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
board:
|
board:
|
||||||
name: pillbug
|
name: pillbug
|
||||||
vendor: mechwild
|
variants:
|
||||||
socs:
|
- name: zmk
|
||||||
- name: nrf52840
|
qualifier: nrf52840
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
file_format: "1"
|
file_format: "1"
|
||||||
id: pillbug
|
id: pillbug//zmk
|
||||||
name: PillBug
|
name: PillBug
|
||||||
type: board
|
type: board
|
||||||
arch: arm
|
arch: arm
|
||||||
|
|
|
||||||
|
|
@ -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)>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
@ -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
|
||||||
|
|
@ -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)
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
board:
|
||||||
|
name: pillbug
|
||||||
|
vendor: mechwild
|
||||||
|
socs:
|
||||||
|
- name: nrf52840
|
||||||
|
|
@ -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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
/dts-v1/;
|
/dts-v1/;
|
||||||
|
|
||||||
#include <nordic/nrf52840_qiaa.dtsi>
|
#include <nordic/nrf52840_qiaa.dtsi>
|
||||||
#include <common/nordic/nrf52840_uf2_boot_mode.dtsi>
|
|
||||||
|
|
||||||
#include "pillbug-pinctrl.dtsi"
|
#include "pillbug-pinctrl.dtsi"
|
||||||
#include "blackpill_pins.dtsi"
|
#include "blackpill_pins.dtsi"
|
||||||
|
|
@ -20,7 +19,6 @@
|
||||||
zephyr,code-partition = &code_partition;
|
zephyr,code-partition = &code_partition;
|
||||||
zephyr,sram = &sram0;
|
zephyr,sram = &sram0;
|
||||||
zephyr,flash = &flash0;
|
zephyr,flash = &flash0;
|
||||||
zmk,battery = &vbatt;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
leds {
|
leds {
|
||||||
|
|
@ -29,20 +27,6 @@
|
||||||
gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
|
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 {
|
&adc {
|
||||||
|
|
@ -88,7 +72,6 @@ zephyr_udc0: &usbd {
|
||||||
status = "okay";
|
status = "okay";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
&flash0 {
|
&flash0 {
|
||||||
/*
|
/*
|
||||||
* For more information, see:
|
* For more information, see:
|
||||||
|
|
@ -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
|
||||||
Loading…
Reference in New Issue