Mon, 26 Sep 2022 22:17:35 +0200
Upgraded kicad to version 6
0 | 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 | */ | |
1
ad2c8b13eb88
Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
21 | #define DS18B20_ERR_NONE 0 ///< No errors |
ad2c8b13eb88
Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
22 | #define DS18B20_ERR_NOSENSOR 1 ///< No sensor detected |
ad2c8b13eb88
Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
23 | #define DS18B20_ERR_TOOMANY 2 ///< Too many sensors |
ad2c8b13eb88
Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
24 | #define DS18B20_ERR_CRC 3 ///< CRC read error |
ad2c8b13eb88
Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
25 | #define DS18B20_ERR_READ 4 ///< Generic read error |
0 | 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 |