ntc.h

Go to the documentation of this file.
00001 
00041 /*#*
00042  *#* $Log$
00043  *#* Revision 1.2  2006/07/19 12:56:26  bernie
00044  *#* Convert to new Doxygen style.
00045  *#*
00046  *#* Revision 1.1  2005/11/04 17:59:47  bernie
00047  *#* Import into DevLib.
00048  *#*
00049  *#* Revision 1.3  2005/06/10 08:56:47  batt
00050  *#* Avoid calling DEG_T_TO_DEG().
00051  *#*
00052  *#* Revision 1.2  2005/06/10 08:54:58  batt
00053  *#* Rename deg_t conversion macros to accomplish coding standard.
00054  *#*
00055  *#* Revision 1.1  2005/05/24 09:17:58  batt
00056  *#* Move drivers to top-level.
00057  *#*/
00058 
00059 #ifndef DRV_NTC_H
00060 #define DRV_NTC_H
00061 
00062 #include <ntc_map.h>
00063 #include <cfg/debug.h>
00064 #include <cfg/compiler.h>
00065 
00066 #define NTC_OPEN_CIRCUIT  -32768
00067 #define NTC_SHORT_CIRCUIT 32767
00068 
00069 typedef int16_t  deg_t; 
00072 #define DEG_TO_DEG_T(x)         ((deg_t)((x) * 10))
00073 
00075 #define DEG_T_TO_INTDEG(x)      ((x) / 10)
00076 
00078 #define DEG_T_TO_DECIMALDEG(x)  ((x) % 10)
00079 
00081 #define DEG_T_TO_FLOATDEG(x)    ((x) / 10.0)
00082 
00083 
00084 typedef uint32_t res_t; 
00085 typedef float    amp_t; 
00087 DB(extern bool ntc_initialized;)
00088 
00089 
00091 typedef struct NtcHwInfo
00092 {
00093     const res_t *resistances; 
00094     size_t num_resistances;   
00095     deg_t degrees_min;        
00096     deg_t degrees_step;       
00097 } NtcHwInfo;
00098 
00100 void ntc_init(void);
00101 
00103 deg_t ntc_read(NtcDev dev);
00104 
00105 #endif /* DRV_NTC_H */