Mahesh Phalke / tempsensors_prv
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers thermistor.h Source File

thermistor.h

Go to the documentation of this file.
00001 /*!
00002  *****************************************************************************
00003   @file:  thermistor.h
00004 
00005   @brief:
00006 
00007   @details:
00008  -----------------------------------------------------------------------------
00009  Copyright (c) 2021 Analog Devices, Inc.  All rights reserved.
00010 
00011  This software is proprietary to Analog Devices, Inc. and its licensors.
00012  By using this software you agree to the terms of the associated
00013  Analog Devices Software License Agreement.
00014 
00015 *****************************************************************************/
00016 
00017 #include <stdint.h>
00018 
00019 #ifndef _THERMISTOR_H_
00020 #define _THERMISTOR_H_
00021 
00022 /* Enable this macro to use look-up tables for temperature conversion */
00023 #define DEFINE_LOOKUP_TABLES
00024 
00025 class thermistor
00026 {
00027 public:
00028     thermistor();
00029     ~thermistor();
00030     static float lookup(const uint32_t *lut,
00031                 uint32_t resistance,
00032                 uint16_t size,
00033                 int16_t offset);
00034     static float convert(const float resistance, float coeff_A, float coeff_B,
00035                  float coeff_C);
00036     virtual float convert(const float resistance) = 0;
00037     virtual float lookup(const float resistance) = 0;
00038 };
00039 
00040 #endif  /* _THERMISTOR_H_ */