Voltage divider driver initial implementation

This commit is contained in:
Nick
2020-09-19 19:14:59 -05:00
parent ceda57ddfd
commit 844f2c7674
5 changed files with 139 additions and 0 deletions

View File

@@ -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 {

View File

@@ -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