Refactor driver to use Sensor API

This commit is contained in:
Nick
2020-10-23 00:45:59 -05:00
parent f5909f9c26
commit 3082455aec
5 changed files with 162 additions and 47 deletions

View File

@@ -29,6 +29,14 @@
};
};
vbatt {
compatible = "zmk,battery-voltage-divider";
label = "VOLTAGE_DIVIDER";
io-channels = <&adc 7>;
output-ohms = <2000000>;
full-ohms = <(2000000 + 806000)>;
};
};
&gpio0 {

View File

@@ -31,6 +31,7 @@
vbatt {
compatible = "zmk,battery-voltage-divider";
label = "VOLTAGE_DIVIDER";
io-channels = <&adc 2>;
output-ohms = <2000000>;
full-ohms = <(2000000 + 806000)>;

View File

@@ -26,6 +26,14 @@
};
};
vbatt {
compatible = "zmk,battery-voltage-divider";
label = "VOLTAGE_DIVIDER";
io-channels = <&adc 2>;
output-ohms = <2000000>;
full-ohms = <(2000000 + 820000)>;
};
};
&gpio0 {