app: read NTC temperatures via sensor API
Replace the temperature calculation in daq.cpp by the DAQ NTC sensor driver. Temperatures below -50 °C are still considered as a missing sensor. A missing MOSFET temperature sensor keeps the previous value instead of setting an implausible temperature. The series resistor of the NTCs was specified as multiplier of the DAQ channels before. It is moved to the pullup-ohm property of the new ntc-fets and ntc-bat nodes and the gain of the DAQ channels is set to 1. Note for out-of-tree boards: The temp-fets and temp-bat DAQ channels need the labels daq_temp_fets and daq_temp_bat and a corresponding libresolar,daq-ntc-thermistor node with the labels ntc_fets and ntc_bat. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
6ec3c6f312
commit
b90be36dbc
@@ -62,6 +62,12 @@
|
||||
#io-channel-cells = <1>;
|
||||
};
|
||||
|
||||
ntc_fets: ntc-fets {
|
||||
compatible = "libresolar,daq-ntc-thermistor";
|
||||
daq-channel = <&daq_temp_fets>;
|
||||
pullup-ohm = <10000>;
|
||||
};
|
||||
|
||||
adc-inputs {
|
||||
compatible = "libresolar,daq-emul";
|
||||
|
||||
@@ -84,9 +90,9 @@
|
||||
offset = <37414>; // 65536 / (1 + 8.2/120 + 8.2/12)
|
||||
};
|
||||
|
||||
temp-fets {
|
||||
daq_temp_fets: temp-fets {
|
||||
io-channels = <&adc1 11>;
|
||||
multiplier = <10000>; // 10k NTC series resistor
|
||||
multiplier = <1>;
|
||||
divider = <1>;
|
||||
};
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ CONFIG_REBOOT=y
|
||||
|
||||
CONFIG_HWINFO=y
|
||||
|
||||
CONFIG_SENSOR=y
|
||||
|
||||
CONFIG_CONSOLE_SUBSYS=y
|
||||
|
||||
CONFIG_LOG=y
|
||||
|
||||
Reference in New Issue
Block a user