Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
ptc_ky81_110.h@0:854742598c2c, 2021-02-19 (annotated)
- Committer:
- mahphalke
- Date:
- Fri Feb 19 16:05:58 2021 +0530
- Revision:
- 0:854742598c2c
- Child:
- 1:851dbb04c1e5
Added temperature sensor library source files
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| mahphalke |
0:854742598c2c | 1 | /*! |
| mahphalke |
0:854742598c2c | 2 | ***************************************************************************** |
| mahphalke |
0:854742598c2c | 3 | @file: ptc_ky81_110.h |
| mahphalke |
0:854742598c2c | 4 | |
| mahphalke |
0:854742598c2c | 5 | @brief: This file contains the global parameters for ptc_ky81_110 module |
| mahphalke |
0:854742598c2c | 6 | |
| mahphalke |
0:854742598c2c | 7 | @details: |
| mahphalke |
0:854742598c2c | 8 | ----------------------------------------------------------------------------- |
| mahphalke |
0:854742598c2c | 9 | Copyright (c) 2020 Analog Devices, Inc. All rights reserved. |
| mahphalke |
0:854742598c2c | 10 | |
| mahphalke |
0:854742598c2c | 11 | This software is proprietary to Analog Devices, Inc. and its licensors. |
| mahphalke |
0:854742598c2c | 12 | By using this software you agree to the terms of the associated |
| mahphalke |
0:854742598c2c | 13 | Analog Devices Software License Agreement. |
| mahphalke |
0:854742598c2c | 14 | |
| mahphalke |
0:854742598c2c | 15 | *****************************************************************************/ |
| mahphalke |
0:854742598c2c | 16 | |
| mahphalke |
0:854742598c2c | 17 | #include <stdint.h> |
| mahphalke |
0:854742598c2c | 18 | |
| mahphalke |
0:854742598c2c | 19 | #ifndef _PTC_KY81_110_H_ |
| mahphalke |
0:854742598c2c | 20 | #define _PTC_KY81_110_H_ |
| mahphalke |
0:854742598c2c | 21 | |
| mahphalke |
0:854742598c2c | 22 | /******************************************************************************/ |
| mahphalke |
0:854742598c2c | 23 | /***************************** Include Files **********************************/ |
| mahphalke |
0:854742598c2c | 24 | /******************************************************************************/ |
| mahphalke |
0:854742598c2c | 25 | |
| mahphalke |
0:854742598c2c | 26 | #include "thermistor.h" |
| mahphalke |
0:854742598c2c | 27 | |
| mahphalke |
0:854742598c2c | 28 | /* This is a child class of thermistor parent class and contains |
| mahphalke |
0:854742598c2c | 29 | * attributes specific to KY81/110 PTC sensor */ |
| mahphalke |
0:854742598c2c | 30 | class ptc_ky81_110 : thermistor |
| mahphalke |
0:854742598c2c | 31 | { |
| mahphalke |
0:854742598c2c | 32 | private: |
| mahphalke |
0:854742598c2c | 33 | /* KY81/110 PTC temperature coefficient */ |
| mahphalke |
0:854742598c2c | 34 | float temperature_coeff; |
| mahphalke |
0:854742598c2c | 35 | #ifdef DEFINE_LOOKUP_TABLES |
| mahphalke |
0:854742598c2c | 36 | int16_t lut_offset; |
| mahphalke |
0:854742598c2c | 37 | int16_t lut_size; |
| mahphalke |
0:854742598c2c | 38 | static const uint32_t lut[]; |
| mahphalke |
0:854742598c2c | 39 | #endif |
| mahphalke |
0:854742598c2c | 40 | |
| mahphalke |
0:854742598c2c | 41 | public: |
| mahphalke |
0:854742598c2c | 42 | ptc_ky81_110(); |
| mahphalke |
0:854742598c2c | 43 | float convert(const float resistance); |
| mahphalke |
0:854742598c2c | 44 | #ifdef DEFINE_LOOKUP_TABLES |
| mahphalke |
0:854742598c2c | 45 | float lookup(const float resistance); |
| mahphalke |
0:854742598c2c | 46 | #endif |
| mahphalke |
0:854742598c2c | 47 | }; |
| mahphalke |
0:854742598c2c | 48 | |
| mahphalke |
0:854742598c2c | 49 | #endif /* _PTC_KY81_110_H_ */ |