Skip to content

Commit e52dcb2

Browse files
committed
Added function header
1 parent 8302f2d commit e52dcb2

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

examples/refrigerator-app/silabs/src/RefrigeratorUI.cpp

+36
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ static uint8_t mMode;
5555
#define UI_WIFI 0
5656
#endif
5757

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+
*/
5862
void RefrigeratorUI::DrawUI(GLIB_Context_t * glibContext)
5963
{
6064
if (glibContext == nullptr)
@@ -77,16 +81,28 @@ void RefrigeratorUI::DrawUI(GLIB_Context_t * glibContext)
7781
#endif // SL_LCDCTRL_MUX
7882
}
7983

84+
/**
85+
* @brief Set the current temperature of the refrigerator.
86+
* @param int8_t temp The current temperature in Celsius
87+
*/
8088
void RefrigeratorUI::SetCurrentTemp(int8_t temp)
8189
{
8290
mCurrentTempCelsius = temp;
8391
}
8492

93+
/**
94+
* @brief Set the operating mode of the refrigerator.
95+
* @param uint8_t mode Mode of the refrigerator (e.g., cooling, defrosting)
96+
*/
8597
void RefrigeratorUI::SetMode(uint8_t mode)
8698
{
8799
mMode = mode;
88100
}
89101

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+
*/
90106
void RefrigeratorUI::DrawHeader(GLIB_Context_t * glibContext)
91107
{
92108
// Draw Silabs Corner icon
@@ -107,6 +123,11 @@ void RefrigeratorUI::DrawHeader(GLIB_Context_t * glibContext)
107123
#endif // SL_LCDCTRL_MUX
108124
}
109125

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+
*/
110131
void RefrigeratorUI::DrawFooter(GLIB_Context_t * glibContext, bool autoMode)
111132
{
112133
switch (static_cast<RefrigeratorUI::SUPPORTED_MODES>(mMode))
@@ -204,6 +225,15 @@ void RefrigeratorUI::DrawCurrentTemp(GLIB_Context_t * glibContext, int8_t temp,
204225
}
205226
}
206227

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+
*/
207237
void RefrigeratorUI::DrawFont(GLIB_Context_t * glibContext, uint8_t initial_x, uint8_t initial_y, uint8_t width, uint8_t * data,
208238
uint32_t size)
209239
{
@@ -232,6 +262,12 @@ void RefrigeratorUI::DrawFont(GLIB_Context_t * glibContext, uint8_t initial_x, u
232262
}
233263
}
234264

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+
*/
235271
void RefrigeratorUI::DrawSetPoint(GLIB_Context_t * glibContext, int8_t setPoint, bool secondLine)
236272
{
237273
char setPointLine[] = { '-', 'X', 'X', '\0' };

0 commit comments

Comments
 (0)