Library to support temperature sensor conversions and lookups
ntc_10k_44031.h@1:f65f6fadda5d, 2021-02-22 (annotated)
- Committer:
- mahphalke
- Date:
- Mon Feb 22 05:08:54 2021 +0000
- Revision:
- 1:f65f6fadda5d
- Child:
- 2:bcfa5a2f21c9
Added library files
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mahphalke | 1:f65f6fadda5d | 1 | /*! |
mahphalke | 1:f65f6fadda5d | 2 | ***************************************************************************** |
mahphalke | 1:f65f6fadda5d | 3 | @file: ntc_10k_44031.h |
mahphalke | 1:f65f6fadda5d | 4 | |
mahphalke | 1:f65f6fadda5d | 5 | @brief: |
mahphalke | 1:f65f6fadda5d | 6 | |
mahphalke | 1:f65f6fadda5d | 7 | @details: |
mahphalke | 1:f65f6fadda5d | 8 | ----------------------------------------------------------------------------- |
mahphalke | 1:f65f6fadda5d | 9 | Copyright (c) 2021 Analog Devices, Inc. All rights reserved. |
mahphalke | 1:f65f6fadda5d | 10 | |
mahphalke | 1:f65f6fadda5d | 11 | This software is proprietary to Analog Devices, Inc. and its licensors. |
mahphalke | 1:f65f6fadda5d | 12 | By using this software you agree to the terms of the associated |
mahphalke | 1:f65f6fadda5d | 13 | Analog Devices Software License Agreement. |
mahphalke | 1:f65f6fadda5d | 14 | |
mahphalke | 1:f65f6fadda5d | 15 | *****************************************************************************/ |
mahphalke | 1:f65f6fadda5d | 16 | |
mahphalke | 1:f65f6fadda5d | 17 | #include <stdint.h> |
mahphalke | 1:f65f6fadda5d | 18 | |
mahphalke | 1:f65f6fadda5d | 19 | #ifndef _NTC_10K_44031_H_ |
mahphalke | 1:f65f6fadda5d | 20 | #define _NTC_10K_44031_H_ |
mahphalke | 1:f65f6fadda5d | 21 | |
mahphalke | 1:f65f6fadda5d | 22 | /******************************************************************************/ |
mahphalke | 1:f65f6fadda5d | 23 | /***************************** Include Files **********************************/ |
mahphalke | 1:f65f6fadda5d | 24 | /******************************************************************************/ |
mahphalke | 1:f65f6fadda5d | 25 | |
mahphalke | 1:f65f6fadda5d | 26 | #include "thermistor.h" |
mahphalke | 1:f65f6fadda5d | 27 | |
mahphalke | 1:f65f6fadda5d | 28 | /* This is a child class of thermistor parent class and contains |
mahphalke | 1:f65f6fadda5d | 29 | * attributes specific to 10K 44031 NTC sensor */ |
mahphalke | 1:f65f6fadda5d | 30 | class ntc_10k_44031rc : thermistor |
mahphalke | 1:f65f6fadda5d | 31 | { |
mahphalke | 1:f65f6fadda5d | 32 | private: |
mahphalke | 1:f65f6fadda5d | 33 | /* NTC coefficients for Steinhart-Hart equation */ |
mahphalke | 1:f65f6fadda5d | 34 | float coeff_A; |
mahphalke | 1:f65f6fadda5d | 35 | float coeff_B; |
mahphalke | 1:f65f6fadda5d | 36 | float coeff_C; |
mahphalke | 1:f65f6fadda5d | 37 | #ifdef DEFINE_LOOKUP_TABLES |
mahphalke | 1:f65f6fadda5d | 38 | int16_t lut_offset; |
mahphalke | 1:f65f6fadda5d | 39 | int16_t lut_size; |
mahphalke | 1:f65f6fadda5d | 40 | static const uint32_t lut[]; |
mahphalke | 1:f65f6fadda5d | 41 | #endif |
mahphalke | 1:f65f6fadda5d | 42 | |
mahphalke | 1:f65f6fadda5d | 43 | public: |
mahphalke | 1:f65f6fadda5d | 44 | ntc_10k_44031rc(); |
mahphalke | 1:f65f6fadda5d | 45 | float convert(const float resistance); |
mahphalke | 1:f65f6fadda5d | 46 | #ifdef DEFINE_LOOKUP_TABLES |
mahphalke | 1:f65f6fadda5d | 47 | float lookup(const float resistance); |
mahphalke | 1:f65f6fadda5d | 48 | #endif |
mahphalke | 1:f65f6fadda5d | 49 | }; |
mahphalke | 1:f65f6fadda5d | 50 | |
mahphalke | 1:f65f6fadda5d | 51 | #endif /* _NTC_10K_44031_H_ */ |
mahphalke | 1:f65f6fadda5d | 52 |