/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. #ifndef THERMISTOR_TABLE
  18. #define THERMISTOR_TABLE
  19. #include <stdint.h>
  20. /// Translate a thermistor reading into degrees Celcius, using the provided lookup table.
  21. /// @param[in] reading Thermistor voltage reading, in ADC counts
  22. /// @param[in] table_idx Index of the thermocouple lookup table
  23. /// @return Temperature reading, in degrees Celcius
  24. int16_t thermistorToCelsius(int16_t reading, int8_t table_idx);
  25. /// Initialize the thermocouple lookup tables. This needs to be called at boot, before calling
  26. /// #thermistorToCelcius()
  27. void initThermistorTables();
  28. #endif // THERMISTOR_TABLE