Sat, 19 Jun 2021 20:46:42 +0200
Fixed HendiControl interface connecter to match the board input. Tested the new circuit.
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 % | |
101
1bc6e9263ada
Fixed HendiControl interface connecter to match the board input. Tested the new circuit.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
46 | int pwm_gpio; ///< PWM GPIO pin |
1bc6e9263ada
Fixed HendiControl interface connecter to match the board input. Tested the new circuit.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
47 | bool pwm_mlt; ///< PWM in use for MLT |
1bc6e9263ada
Fixed HendiControl interface connecter to match the board input. Tested the new circuit.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
48 | int pwm_nohlt; ///< PWM power limit to shutdown HLT |
0 | 49 | int hlt_gpio; ///< HLT SSR GPIO pin |
50 | int hlt_mode; ///< HLT Mode: 0 = off, 1 = bang on/off, 2 = always on | |
51 | double hlt_sp; ///< Setpoint HLT temperature | |
52 | double hlt_pv; ///< Current HLT temperature | |
53 | int hlt_power; ///< Current HLT drive power % | |
54 | bool hlt_and_mlt; ///< True if both MLT and HLT are allowed at the same time. | |
55 | int pump_gpio; ///< Pump SSR GPIO pin | |
56 | int pump_run; ///< Pump on/off | |
57 | } DRIVER_State; | |
58 | ||
59 | ||
60 | /** | |
61 | * @brief FreeRTOS driver task. This task drives the Solid | |
62 | * State Relays (SSR) to power the Mash Lauter Tun (MLT) and the Hot | |
63 | * Liquer Tank (HLT) heating elements. It also controls the pump relay. | |
64 | */ | |
65 | void task_driver(void *); | |
66 | ||
67 | #endif | |
68 |