ntc.h

Go to the documentation of this file.
00001 
00044 #ifndef DRV_NTC_H
00045 #define DRV_NTC_H
00046 
00047 #include "hw/ntc_map.h"
00048 
00049 #include <cfg/compiler.h>
00050 #include <cfg/debug.h>
00051 
00052 #define NTC_OPEN_CIRCUIT  -32768
00053 #define NTC_SHORT_CIRCUIT 32767
00054 
00055 typedef int16_t  deg_t; 
00058 #define DEG_TO_DEG_T(x)         ((deg_t)((x) * 10))
00059 
00061 #define DEG_T_TO_INTDEG(x)      ((x) / 10)
00062 
00064 #define DEG_T_TO_DECIMALDEG(x)  ((x) % 10)
00065 
00067 #define DEG_T_TO_FLOATDEG(x)    ((x) / 10.0)
00068 
00069 
00070 typedef uint32_t res_t; 
00071 typedef float    amp_t; 
00073 DB(extern bool ntc_initialized;)
00074 
00075 
00077 typedef struct NtcHwInfo
00078 {
00079     const res_t *resistances; 
00080     size_t num_resistances;   
00081     deg_t degrees_min;        
00082     deg_t degrees_step;       
00083 } NtcHwInfo;
00084 
00086 void ntc_init(void);
00087 
00089 deg_t ntc_read(NtcDev dev);
00090 
00091 #endif /* DRV_NTC_H */