BeRTOS
hw_thermo.h
Go to the documentation of this file.
00001 
00039 #ifndef HW_THERMO_H
00040 #define HW_THERMO_H
00041 
00042 #include "hw/thermo_map.h"
00043 
00044 #include <cfg/debug.h>
00045 
00046 #include <drv/ntc.h>
00047 
00048 
00049 INLINE ticks_t thermo_hw_timeout(ThermoDev dev)
00050 {
00051     (void)dev;
00052     return 0;
00053 }
00054 
00058 INLINE deg_t thermo_hw_tolerance(ThermoDev dev)
00059 {
00060     (void)dev;
00061     return 0;
00062 }
00063 
00067 INLINE deg_t thermo_hw_read(ThermoDev dev)
00068 {
00069     ASSERT(dev < THERMO_CNT);
00070     /* Put here the code to read current temperature */
00071     return 0;
00072 }
00073 
00074 
00079 INLINE void thermo_hw_off(ThermoDev dev)
00080 {
00081     ASSERT(dev < THERMO_CNT);
00082     /* Put here the code to turn off the thermo device */
00083 }
00084 
00090 INLINE void thermo_hw_set(ThermoDev dev, deg_t target, deg_t cur_temp)
00091 {
00092     ASSERT(dev < THERMO_CNT);
00093 
00094     if (target - cur_temp > 0)
00095     {
00096         /*
00097          * We are leveaving the target temperature, so
00098          * turn on the thermo device!
00099          */
00100     }
00101     else
00102     {
00103         /*
00104          * Ok, we are near the target temperature, so
00105          * turn off the thermo device!
00106          */
00107     }
00108 
00109 }
00110 
00111 #define THERMO_HW_INIT  _thermo_hw_init()
00112 
00116 INLINE void _thermo_hw_init(void)
00117 {
00118     /* Init your devices here! */
00119 }
00120 
00121 #endif /* HW_THERMO_H */