PER Firmware
Loading...
Searching...
No Matches
thermistor.h
Go to the documentation of this file.
1
9#ifndef THERMISTOR_H
10#define THERMISTOR_H
11
12#include "lerp_lut/lerp_lut.h"
13
16
17// Convert a cell thermistor resistance to temperature (Celsius)
18[[gnu::always_inline]]
19static inline float cell_thermistor_R_to_T(float resistance) {
20 return lut_lookup(&cell_thermistor_lut, resistance);
21}
22
23// Convert an onboard thermistor resistance to temperature (Celsius)
24[[gnu::always_inline]]
25static inline float board_thermistor_R_to_T(float resistance) {
26 return lut_lookup(&board_thermistor_lut, resistance);
27}
28
29#endif // THERMISTOR_H
float lut_lookup(const lerp_lut_t *lut, float key)
Lookup a value in a linear interpolation lookup table (LUT).
Definition lerp_lut.c:20
Linear interpolation lookup table (LUT).
Definition lerp_lut.h:18
static float board_thermistor_R_to_T(float resistance)
Definition thermistor.h:25
const lerp_lut_t board_thermistor_lut
static float cell_thermistor_R_to_T(float resistance)
Definition thermistor.h:19
const lerp_lut_t cell_thermistor_lut