From 4faf6eba97d91e8d9ec5fdbfb7b3a637228cc32d Mon Sep 17 00:00:00 2001 From: hyx0329 Date: Wed, 14 Dec 2022 17:02:04 +0800 Subject: [PATCH] feat(boards): Add battery sensor for Makerdiary M60 keyboard Signed-off-by: hyx0329 --- app/boards/arm/nrf52840_m2/nrf52840_m2.dts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/boards/arm/nrf52840_m2/nrf52840_m2.dts b/app/boards/arm/nrf52840_m2/nrf52840_m2.dts index 5ea852e9..dc22c40b 100644 --- a/app/boards/arm/nrf52840_m2/nrf52840_m2.dts +++ b/app/boards/arm/nrf52840_m2/nrf52840_m2.dts @@ -16,6 +16,7 @@ zephyr,sram = &sram0; zephyr,flash = &flash0; zephyr,console = &cdc_acm_uart; + zmk,battery = &vbatt; }; leds { @@ -34,6 +35,14 @@ }; }; + vbatt: vbatt { + compatible = "zmk,battery-voltage-divider"; + label = "BATTERY"; + io-channels = <&adc 0>; + output-ohms = <1000000>; + full-ohms = <(1000000 + 1000000)>; + }; + }; &adc {