PageRenderTime 69ms CodeModel.GetById 65ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/firmware/src/shared/ThermistorTable.hh

http://github.com/makerbot/G3Firmware
C++ Header | 33 lines | 6 code | 5 blank | 22 comment | 0 complexity | 0475ba55d3ca149f48219b5fb985981a MD5 | raw file
 1/*
 2 * Copyright 2010 by Adam Mayer	 <adam@makerbot.com>
 3 *
 4 * This program is free software: you can redistribute it and/or modify
 5 * it under the terms of the GNU General Public License as published by
 6 * the Free Software Foundation, either version 3 of the License, or
 7 * (at your option) any later version.
 8 *
 9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program.  If not, see <http://www.gnu.org/licenses/>
16 */
17
18#ifndef THERMISTOR_TABLE
19#define THERMISTOR_TABLE
20
21#include <stdint.h>
22
23/// Translate a thermistor reading into degrees Celcius, using the provided lookup table.
24/// @param[in] reading Thermistor voltage reading, in ADC counts
25/// @param[in] table_idx Index of the thermocouple lookup table
26/// @return Temperature reading, in degrees Celcius
27int16_t thermistorToCelsius(int16_t reading, int8_t table_idx);
28
29/// Initialize the thermocouple lookup tables. This needs to be called at boot, before calling
30/// #thermistorToCelcius()
31void initThermistorTables();
32
33#endif // THERMISTOR_TABLE