main/task_ds18b20.h

changeset 0
b74b0e4902c3
child 1
ad2c8b13eb88
equal deleted inserted replaced
-1:000000000000 0:b74b0e4902c3
1
2 /**
3 * @file task_ds18b20.h
4 * @brief The FreeRTOS task to query the DS18B20 sensors on one or two
5 * one-wire busses. Each bus must have only one sensor. That way
6 * we don't need to care about the DS18B20 internal ROM address.
7 * The task will update the DS18B20_State structure.
8 *
9 * Using a compile setting with make menuconfig it is possible to compile
10 * a simulator instead of real hardware sensors. The simulator includes
11 * fake kettles so that the temperature actually changes with the
12 * activation of the kettle Solid State Relays. Only usefull for developers.
13 */
14
15 #ifndef _TASK_DS18B20_H
16 #define _TASK_DS18B20_H
17
18 /*
19 * Error codes in this task
20 */
21 #define DS18B20_ERR_NONE 0
22 #define DS18B20_ERR_NOSENSOR 1
23 #define DS18B20_ERR_TOOMANY 2
24 #define DS18B20_ERR_CRC 3
25 #define DS18B20_ERR_READ 4
26
27
28 /**
29 * @brief Structure containing the variables for the DS18B20 task.
30 */
31 typedef struct {
32 bool mlt_valid; ///< MLT sensor valid reading.
33 double mlt_temperature; ///< Current MLT temperature.
34 int mlt_error; ///< MLT error number.
35 bool hlt_valid; ///< HLT sensor valid reading.
36 double hlt_temperature; ///< Current HLT temperature.
37 int hlt_error; ///< HLT error number.
38 } DS18B20_State;
39
40
41 /**
42 * @brief The FreeRTOS task to update the DS18B20 temperature sensors.
43 */
44 void task_ds18b20(void *);
45
46
47 #endif
48

mercurial