CoffeePi
Coffee machine control for Raspberry Pi
display.h
Go to the documentation of this file.
1 /*
2  * display.h
3  *
4  * Created on: Sep 26, 2017
5  * Author: Philipp Hinz
6  */
7 
8 #ifndef DISPLAY_H_
9 #define DISPLAY_H_
10 #include <string>
11 
12 typedef enum {
17 
18 typedef enum {
29 
30 typedef struct {
31  char const * const text[lang_last];
33 
34 static const display_string_t display_strings[str_last] =
35 {
36  { // heating
37  {
38  "Heizt auf",
39  "Heating"
40  }
41  },
42  { // heatingready
43  {
44  "Bereit (Heizt)",
45  "Ready (Heating)"
46  }
47  },
48  { // ready
49  {
50  "Bereit",
51  "Ready"
52  }
53  },
54  { // brewing
55  {
56  "Bezug..",
57  "Brewing.."
58  }
59  },
60  { // cleaning
61  {
62  "Reinigt..",
63  "Cleaning.."
64  }
65  },
66  { // error
67  {
68  "Fehler",
69  "Error"
70  }
71  },
72  { // flow
73  {
74  "Menge",
75  "Flow"
76  }
77  },
78  { // bye
79  {
80  "Auf wiedersehen",
81  "Good bye"
82  }
83  }
84 };
85 
86 #define DEFAULT_LANG lang_de
87 #define REFRESH_RATE 10
88 #define DISPLAY_ROWS 2
89 #define DISPLAY_COLS 16
90 
91 void *displayThread(void *threadid);
92 void *displayTimerHandler(void *threadid);
93 void displayInit(void);
94 void displayTerminate(void);
96 
97 void displayPushState(int state);
98 
99 void displayRefresh(void);
100 const char* displayGetString(display_strings_t string);
101 
102 
103 #endif /* DISPLAY_H_ */
void displayRefresh(void)
Refreshed the display content and outputs it.
Definition: display.cpp:198
Definition: display.h:30
void * displayThread(void *threadid)
Main thread to handle display data.
Definition: display.cpp:103
Definition: display.h:14
void displayPushState(int state)
Updates the display state to the matching coffee state.
Definition: display.cpp:263
Definition: display.h:25
display_lang_t
Definition: display.h:12
Definition: display.h:26
Definition: display.h:22
display_strings_t
Definition: display.h:18
Definition: display.h:23
void displayInit(void)
Initializes display.
Definition: display.cpp:159
void displaySetLang(display_lang_t lang)
Sets the language of the display text.
Definition: display.cpp:190
void * displayTimerHandler(void *threadid)
Timer handler for display update.
Definition: display.cpp:125
Definition: display.h:21
Definition: display.h:27
Definition: display.h:20
Definition: display.h:19
const char * displayGetString(display_strings_t string)
Returns the matching translation of a string.
Definition: display.cpp:252
Definition: display.h:24
void displayTerminate(void)
Handles cleanup before program termination.
Definition: display.cpp:180
Definition: display.h:13
Definition: display.h:15
int state
Definition: coffee.cpp:27