-
Notifications
You must be signed in to change notification settings - Fork 0
/
UIHelper.h
53 lines (44 loc) · 1.82 KB
/
UIHelper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef __UIHELPER_H_
#define __UIHELPER_H_
#include "settings.h"
#define TOP_OVERLAY
#define OVERLAY_HEIGHT 14
#ifdef TOP_OVERLAY
#define OVERLAY_Y 0
#define correct_y(Y) (OVERLAY_HEIGHT + (Y) )
#else
#define OVERLAY_Y 52
#define correct_y(Y) (Y)
#endif
/******************************
* UI Prototypes
*****************************/
void toggleDisplayState(OLEDDisplay *display, OLEDDisplayUi *ui);
void displayOff(OLEDDisplay *display);
void displayBlank(OLEDDisplay *display);
void drawBootWelcome(OLEDDisplay *display, String title);
void drawProgress(OLEDDisplay *display, int percentage, String label);
void drawWifiConnecting(OLEDDisplay *display, int counter);
void drawDateTime(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y);
void drawIndoor(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y);
void drawCurrentWeather(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y);
void drawForecast(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y);
void drawForecastDetails(OLEDDisplay *display, int x, int y, int dayIndex);
void drawHeaderOverlay(OLEDDisplay *display, OLEDDisplayUiState* state);
/******************************
* End of UI Prototypes
*****************************/
/******************************
* Basic init
*****************************/
// Add frames
// this array keeps function pointers to all frames
// frames are the single views that slide from right to left
FrameCallback frames[] = { drawIndoor, drawCurrentWeather, drawForecast };
uint8_t numberOfFrames = 3;
OverlayCallback overlays[] = { drawHeaderOverlay };
uint8_t numberOfOverlays = 1;
/******************************
* End of Basic init
*****************************/
#endif /*define __UIHELPER_H_*/