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