Import into DevLib.
[bertos.git] / drv / thermo.h
1 /*!
2  * \file
3  * <!--
4  * Copyright 2004, 2005 Develer S.r.l. (http://www.develer.com/)
5  * This file is part of DevLib - See README.devlib for information.
6  * -->
7  *
8  * \brief Thermo-control driver
9  *
10  * \version $Id$
11  *
12  * \author Giovanni Bajo <rasky@develer.com>
13  * \author Francesco Sacchi <batt@develer.com>
14  *
15  * This module implements multiple thermo controls, which is the logic needed to try
16  * keeping the temperature of a device constant. For this module, a "device" is a black box
17  * whose temperature can be measured, and which has a mean to make it hotter or colder.
18  * For instance, a device could be the combination of a NTC (analog temperature reader) and
19  * a Peltier connected to the same physic block.
20  *
21  * This module relies on a low-level driver to communicate with the device (implementation
22  * of the black box). This low-level driver also controls the units in which the temperature
23  * is expressed: thermo control treats it just as a number.
24  *
25  */
26
27 /*#*
28  *#* $Log$
29  *#* Revision 1.1  2005/11/04 17:59:47  bernie
30  *#* Import into DevLib.
31  *#*
32  *#* Revision 1.2  2005/06/14 10:13:36  batt
33  *#* Better thermo errors handling.
34  *#*
35  *#* Revision 1.1  2005/05/24 09:17:58  batt
36  *#* Move drivers to top-level.
37  *#*
38  *#* Revision 1.4  2005/05/10 16:55:10  batt
39  *#* Add timeout to thermo-regulator; better thermo control handling; change thermo_getStatus() to thermo_status().
40  *#*
41  *#* Revision 1.3  2005/05/10 09:26:54  batt
42  *#* Add thermo_getStatus for getting status/errors of thermo control.
43  *#*
44  *#* Revision 1.2  2005/05/09 19:18:40  batt
45  *#* Remove old logs.
46  *#*
47  *#* Revision 1.1  2005/05/09 16:40:44  batt
48  *#* Add thermo-control driver
49  *#*/
50
51
52 #ifndef DRV_THERMO_H
53 #define DRV_THERMO_H
54
55 #include <drv/ntc.h>
56 #include <thermo_map.h>
57
58 void thermo_init(void);
59
60
61 /*!
62  * Set the target temperature at which a given device should be kept.
63  *
64  * \param dev Device
65  * \param temperature Target temperature
66  */
67 void thermo_setTarget(ThermoDev dev, deg_t temperature);
68
69 /*! Start thermo control for a certain device \a dev */
70 void thermo_start(ThermoDev dev);
71
72 /*! Stop thermo control for a certain device \a dev */
73 void thermo_stop(ThermoDev dev);
74
75 /*! Clear errors for channel \a dev */
76 void thermo_clearErrors(ThermoDev dev);
77
78 /*! Return the status of the specific \a dev thermo-device. */
79 thermostatus_t thermo_status(ThermoDev dev);
80
81 /*!
82  * Return the current temperature of a device currently under thermo
83  * control.
84  *
85  * \param dev Device
86  * \return Current temperature (Celsius degrees * 10)
87  */
88 deg_t thermo_read_temperature(ThermoDev dev);
89
90
91 #endif /* DRV_THERMO_H */