Wed, 10 Jun 2020 09:43:51 +0200
SDK settings to reduce bin size. Some log messages to debug level. Added KWH usage registration. Added equipment power usage for HLT and MLT. Equipment database upgraded to version 2, expandable. Fixed some screen errors during temperature mash steps.
0 | 1 | #ifndef _TASK_DRIVER_H |
2 | #define _TASK_DRIVER_H | |
3 | ||
4 | /** | |
5 | * @file task_driver.h | |
6 | * @brief The interface to the FreeRTOS driver task. This task drives the Solid | |
7 | * State Relays (SSR) to power the Mash Lauter Tun (MLT) and the Hot | |
8 | * Liquer Tank (HLT) heating elements. It also controls the pump relay. | |
9 | * | |
10 | * It takes the temperature readings from the DS18B20 task. | |
11 | */ | |
12 | ||
13 | ||
1
ad2c8b13eb88
Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
14 | /** |
ad2c8b13eb88
Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
15 | * @brief MLT working mode. |
ad2c8b13eb88
Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
16 | */ |
0 | 17 | typedef enum { |
18 | MLT_MODE_NONE = 0, ///< Not active | |
19 | MLT_MODE_BANG = 1, ///< Bang on/off mode | |
20 | MLT_MODE_PID = 2, ///< PID mode | |
21 | MLT_MODE_OFF = 3, ///< Off but show setpoint | |
22 | MLT_MODE_EXT = 4, ///< External regulation | |
23 | } MLT_MODE_TYPE; | |
24 | ||
1
ad2c8b13eb88
Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
25 | /** |
ad2c8b13eb88
Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
26 | * @brief HLT working mode. |
ad2c8b13eb88
Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
27 | */ |
0 | 28 | typedef enum { |
29 | HLT_MODE_NONE = 0, ///< Not active | |
30 | HLT_MODE_BANG = 1, ///< Bang on/off mode | |
31 | HLT_MODE_OFF = 2, ///< Off but show setpoint | |
32 | HLT_MODE_ON = 3, ///< On if free | |
33 | } HLT_MODE_TYPE; | |
34 | ||
35 | ||
36 | /** | |
37 | * @brief Structure containing the information of the driver task. | |
38 | */ | |
39 | typedef struct { | |
40 | bool enable; ///< Enable outputs | |
41 | int mlt_gpio; ///< MLT SSR GPIO pin | |
42 | int mlt_mode; ///< MLT Mode: 0 = off, 1 = bang on/off, 2 = PID, 3 = cooling | |
43 | double mlt_sp; ///< Setpoint MLT temperature | |
44 | double mlt_pv; ///< Current MLT temperature | |
45 | int mlt_power; ///< Current MLT drive power % | |
46 | int hlt_gpio; ///< HLT SSR GPIO pin | |
47 | int hlt_mode; ///< HLT Mode: 0 = off, 1 = bang on/off, 2 = always on | |
48 | double hlt_sp; ///< Setpoint HLT temperature | |
49 | double hlt_pv; ///< Current HLT temperature | |
50 | int hlt_power; ///< Current HLT drive power % | |
51 | bool hlt_and_mlt; ///< True if both MLT and HLT are allowed at the same time. | |
52 | int pump_gpio; ///< Pump SSR GPIO pin | |
53 | int pump_run; ///< Pump on/off | |
54 | } DRIVER_State; | |
55 | ||
56 | ||
57 | /** | |
58 | * @brief FreeRTOS driver task. This task drives the Solid | |
59 | * State Relays (SSR) to power the Mash Lauter Tun (MLT) and the Hot | |
60 | * Liquer Tank (HLT) heating elements. It also controls the pump relay. | |
61 | */ | |
62 | void task_driver(void *); | |
63 | ||
64 | #endif | |
65 |