BeRTOS
|
00001 00043 #ifndef DRV_NTC_H 00044 #define DRV_NTC_H 00045 00046 #include "hw/ntc_map.h" 00047 00048 #include <cfg/compiler.h> 00049 #include <cfg/debug.h> 00050 00051 #define NTC_OPEN_CIRCUIT -32768 00052 #define NTC_SHORT_CIRCUIT 32767 00053 00054 typedef int16_t deg_t; 00057 #define DEG_TO_DEG_T(x) ((deg_t)((x) * 10)) 00058 00060 #define DEG_T_TO_INTDEG(x) ((x) / 10) 00061 00063 #define DEG_T_TO_DECIMALDEG(x) ((x) % 10) 00064 00066 #define DEG_T_TO_FLOATDEG(x) ((x) / 10.0) 00067 00068 00069 typedef uint32_t res_t; 00070 typedef float amp_t; 00072 DB(extern bool ntc_initialized;) 00073 00074 00076 typedef struct NtcHwInfo 00077 { 00078 const res_t *resistances; 00079 size_t num_resistances; 00080 deg_t degrees_min; 00081 deg_t degrees_step; 00082 } NtcHwInfo; 00083 00085 void ntc_init(void); 00086 00088 deg_t ntc_read(NtcDev dev); 00089 00090 #endif /* DRV_NTC_H */