From 2e825908dc385d23f0a7831033aa4d7cce5af6c3 Mon Sep 17 00:00:00 2001 From: KemoNine Date: Mon, 1 Feb 2021 23:00:20 +0000 Subject: [PATCH] feat(nrf52840 m.2): add battery definitions --- app/boards/arm/nrf52840_m2/Kconfig.defconfig | 3 +++ app/boards/arm/nrf52840_m2/nrf52840_m2.dts | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/boards/arm/nrf52840_m2/Kconfig.defconfig b/app/boards/arm/nrf52840_m2/Kconfig.defconfig index f3e1f0eb..9bc53b31 100644 --- a/app/boards/arm/nrf52840_m2/Kconfig.defconfig +++ b/app/boards/arm/nrf52840_m2/Kconfig.defconfig @@ -25,4 +25,7 @@ config ZMK_BLE config ZMK_USB default y +config ZMK_BATTERY_VOLTAGE_DIVIDER + default y + endif # BOARD_NRF52840_M2 diff --git a/app/boards/arm/nrf52840_m2/nrf52840_m2.dts b/app/boards/arm/nrf52840_m2/nrf52840_m2.dts index a2497152..1cb9337b 100644 --- a/app/boards/arm/nrf52840_m2/nrf52840_m2.dts +++ b/app/boards/arm/nrf52840_m2/nrf52840_m2.dts @@ -17,6 +17,14 @@ zephyr,flash = &flash0; }; + vbatt { + compatible = "zmk,battery-voltage-divider"; + label = "BATTERY"; + io-channels = <&adc 0>; + output-ohms = <1000000>; + full-ohms = <(1000000 + 1000000)>; + }; + leds { compatible = "gpio-leds"; red_led: led_1 { @@ -119,7 +127,6 @@ }; }; - &flash0 { /* * For more information, see: