summaryrefslogtreecommitdiff
path: root/app/boards/arm
diff options
context:
space:
mode:
authorNick <nick.win999@gmail.com>2020-09-19 19:14:59 -0500
committerNick <nick.win999@gmail.com>2020-09-19 19:14:59 -0500
commit844f2c76749cbc5ff611d8e69819af82b698089a (patch)
tree9e235ea8156772c61c0c7438051011e25c1fa3d4 /app/boards/arm
parentceda57ddfd7b49dd61e8795c37cd678b69a4a76f (diff)
Voltage divider driver initial implementation
Diffstat (limited to 'app/boards/arm')
-rw-r--r--app/boards/arm/nice_nano/nice_nano.dts10
-rw-r--r--app/boards/arm/nice_nano/nice_nano_defconfig4
2 files changed, 14 insertions, 0 deletions
diff --git a/app/boards/arm/nice_nano/nice_nano.dts b/app/boards/arm/nice_nano/nice_nano.dts
index 2e9556b..18312ec 100644
--- a/app/boards/arm/nice_nano/nice_nano.dts
+++ b/app/boards/arm/nice_nano/nice_nano.dts
@@ -29,6 +29,16 @@
};
};
+ vbatt {
+ compatible = "zmk,battery-voltage-divider";
+ io-channels = <&adc 2>;
+ output-ohms = <2000000>;
+ full-ohms = <(2000000 + 806000)>;
+ };
+};
+
+&adc {
+ status = "okay";
};
&gpio0 {
diff --git a/app/boards/arm/nice_nano/nice_nano_defconfig b/app/boards/arm/nice_nano/nice_nano_defconfig
index 393d61f..b727fe0 100644
--- a/app/boards/arm/nice_nano/nice_nano_defconfig
+++ b/app/boards/arm/nice_nano/nice_nano_defconfig
@@ -10,6 +10,10 @@ CONFIG_ARM_MPU=y
# enable GPIO
CONFIG_GPIO=y
+CONFIG_ADC=y
+
+CONFIG_NEWLIB_LIBC=y
+
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y