Changelog¶
What changed in each release of the driver. Entries under Breaking need source changes in code that used the affected API.
[Unreleased]¶
Added¶
- First version: a generic driver for NTC thermistors read through a resistor divider into an ADC port.
NtcThermistor<Port>withEnsureInitialized(),Read(),ReadResistance(),ReadRawCode(),GetLastCode(),SetConfig()andGetConfig(); the port needsEnsureInitialized()andReadRaw(), and may addDelayUs()andSetBias().- Pure conversion functions with no port:
Convert(),ConvertResistance(),ToMilliKelvin(),ToMilliFahrenheit(),SelfHeatingMicrowatts()andValidate(). All arithmetic is integer: no floating point, no libm. - A part is data: a
Curvethat is a table of 2 to 256 rows (interpolated linearly in ln R), Steinhart-Hart coefficients (sh_a_e15,sh_b_e15,sh_c_e15, Q16 integer maths, with a mandatory valid window) or R25 and B (beta mode, likewise).tools/ntc_table.pymakes and checks a table from coefficients, R25 and B, or a vendor list. Two presets: a generic 10 kOhm / B 3950 class and a TDK table (R25, B and tolerances checked against the vendor's Rev.3 datasheet; the rows are not, as the sheet prints no table). - The bound
uncertainty_mcis a bound on the declared tolerances: R, the series resistor, B (beta and table modes),curve_error_mcand one converter step. - Both divider topologies, ratiometric or with separate supply and reference, open and short margins, averaging with a
spread check, an optional bias switch (waits are capped at 1 s), and
uncertainty_mcon every reading. With a reference above the supply the fault margins count from the highest code the supply can produce. - Errors
OpenCircuit,ShortCircuit,BelowRange,AboveRange,UnstableandCodeOutOfScale. - Host tests against an independent seven-part model, a fuzz target, compile-fail tests, a host example and an ESP-IDF example.