@@ -55,6 +55,10 @@ static uint8_t mMode;
55
55
#define UI_WIFI 0
56
56
#endif
57
57
58
+ /* *
59
+ * @brief Draw the entire UI on the screen including header, footer, and temperature.
60
+ * @param GLIB_Context_t * pointer to the context for the GLIB library
61
+ */
58
62
void RefrigeratorUI::DrawUI (GLIB_Context_t * glibContext)
59
63
{
60
64
if (glibContext == nullptr )
@@ -77,16 +81,28 @@ void RefrigeratorUI::DrawUI(GLIB_Context_t * glibContext)
77
81
#endif // SL_LCDCTRL_MUX
78
82
}
79
83
84
+ /* *
85
+ * @brief Set the current temperature of the refrigerator.
86
+ * @param int8_t temp The current temperature in Celsius
87
+ */
80
88
void RefrigeratorUI::SetCurrentTemp (int8_t temp)
81
89
{
82
90
mCurrentTempCelsius = temp;
83
91
}
84
92
93
+ /* *
94
+ * @brief Set the operating mode of the refrigerator.
95
+ * @param uint8_t mode Mode of the refrigerator (e.g., cooling, defrosting)
96
+ */
85
97
void RefrigeratorUI::SetMode (uint8_t mode)
86
98
{
87
99
mMode = mode;
88
100
}
89
101
102
+ /* *
103
+ * @brief Draw the header of the UI, usually displaying the title or current status.
104
+ * @param GLIB_Context_t * pointer to the context for the GLIB library
105
+ */
90
106
void RefrigeratorUI::DrawHeader (GLIB_Context_t * glibContext)
91
107
{
92
108
// Draw Silabs Corner icon
@@ -107,6 +123,11 @@ void RefrigeratorUI::DrawHeader(GLIB_Context_t * glibContext)
107
123
#endif // SL_LCDCTRL_MUX
108
124
}
109
125
126
+ /* *
127
+ * @brief Draw the footer of the UI, which may display additional information such as mode.
128
+ * @param GLIB_Context_t * pointer to the context for the GLIB library
129
+ * @param bool autoMode Whether the refrigerator is in automatic mode
130
+ */
110
131
void RefrigeratorUI::DrawFooter (GLIB_Context_t * glibContext, bool autoMode)
111
132
{
112
133
switch (static_cast <RefrigeratorUI::SUPPORTED_MODES>(mMode ))
@@ -204,6 +225,15 @@ void RefrigeratorUI::DrawCurrentTemp(GLIB_Context_t * glibContext, int8_t temp,
204
225
}
205
226
}
206
227
228
+ /* *
229
+ * @brief Draw a font at a specified position on the screen.
230
+ * @param GLIB_Context_t * pointer to the context for the GLIB library
231
+ * @param uint8_t initial_x X-coordinate for the starting position
232
+ * @param uint8_t initial_y Y-coordinate for the starting position
233
+ * @param uint8_t width Width of the font to be drawn
234
+ * @param uint8_t * data Pointer to the font data
235
+ * @param uint32_t size Size of the font data in bytes
236
+ */
207
237
void RefrigeratorUI::DrawFont (GLIB_Context_t * glibContext, uint8_t initial_x, uint8_t initial_y, uint8_t width, uint8_t * data,
208
238
uint32_t size)
209
239
{
@@ -232,6 +262,12 @@ void RefrigeratorUI::DrawFont(GLIB_Context_t * glibContext, uint8_t initial_x, u
232
262
}
233
263
}
234
264
265
+ /* *
266
+ * @brief Draw the set point temperature on the screen.
267
+ * @param GLIB_Context_t * pointer to the context for the GLIB library
268
+ * @param int8_t setPoint The set point temperature in Celsius
269
+ * @param bool secondLine Whether to display on the second line (true) or first line (false)
270
+ */
235
271
void RefrigeratorUI::DrawSetPoint (GLIB_Context_t * glibContext, int8_t setPoint, bool secondLine)
236
272
{
237
273
char setPointLine[] = { ' -' , ' X' , ' X' , ' \0 ' };
0 commit comments