ntc.h
Go to the documentation of this file.00001
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
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