aboutsummaryrefslogtreecommitdiffstats
path: root/gui.h
diff options
context:
space:
mode:
Diffstat (limited to 'gui.h')
-rw-r--r--gui.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/gui.h b/gui.h
index 443f31b3..488f1120 100644
--- a/gui.h
+++ b/gui.h
@@ -10,6 +10,21 @@ struct button_t {
uint16_t interval;
};
+struct bar_t {
+ uint16_t x0;
+ uint16_t y0;
+ uint16_t x1;
+ uint16_t y1;
+ uint16_t orientation;
+ uint16_t frameColor;
+ uint16_t bkColor;
+ uint16_t valueColor;
+ uint16_t interval;
+ uint8_t *percent;
+};
+
+enum {horizontal, vertical};
+
/*
* Description: starts main GUI thread which keeps X and Y coordinates of touchpad updated for guiDraw() threads
*
@@ -28,11 +43,28 @@ void guiInit(uint16_t updateIntervl);
* - str: string written centered into button
* - fontColor: color of string
* - buttonColor: color of button
+ * - interval: interval in ms which updates state
* - state: pointer to variable which keeps state (1 = pressed, 0 = unpressed)
*
* return: pointer to created thread
*/
Thread *guiDrawButton(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, unsigned char *str, uint16_t fontColor, uint16_t buttonColor, uint16_t inverval, uint8_t *state);
+/*
+ * Description: draws a bar graph and updates it's value
+ *
+ * param:
+ * - x0, y0, x1, y1: coordinates where bar graph gets drawn
+ * - orientation: horizontal or vertical
+ * - frameColor: color of the frame
+ * - bkColor: color of piece inside bar with is not set
+ * - valueColor: color of value that will be drawn into bar
+ * - interval: interval in ms which updates percentage
+ * - percent: pointer value from 0 to 100 percent
+ *
+ * return : pointer to created thread
+ */
+Thread *guiDrawBarGraph(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t orientation, uint16_t frameColor, uint16_t bkColor, uint16_t valueColor, uint16_t interval, uint16_t *percent);
+
#endif