display.h
Go to the documentation of this file.
/*
* display.h
*
* Created on: Sep 26, 2017
* Author: Philipp Hinz
*/
#ifndef DISPLAY_H_
#define DISPLAY_H_
#include <string>
typedef enum {
lang_de,
lang_en,
lang_last
} display_lang_t;
typedef enum {
str_heating,
str_heatingready,
str_ready,
str_brewing,
str_cleaning,
str_error,
str_flow,
str_bye,
str_last
} display_strings_t;
typedef struct {
char const * const text[lang_last];
} display_string_t;
static const display_string_t display_strings[str_last] =
{
{ // heating
{
"Heizt auf",
"Heating"
}
},
{ // heatingready
{
"Bereit (Heizt)",
"Ready (Heating)"
}
},
{ // ready
{
"Bereit",
"Ready"
}
},
{ // brewing
{
"Bezug..",
"Brewing.."
}
},
{ // cleaning
{
"Reinigt..",
"Cleaning.."
}
},
{ // error
{
"Fehler",
"Error"
}
},
{ // flow
{
"Menge",
"Flow"
}
},
{ // bye
{
"Auf wiedersehen",
"Good bye"
}
}
};
#define DEFAULT_LANG lang_de
#define REFRESH_RATE 10
#define DISPLAY_ROWS 2
#define DISPLAY_COLS 16
void *displayThread(void *threadid);
void *displayTimerHandler(void *threadid);
void displayInit(void);
void displayTerminate(void);
void displaySetLang(display_lang_t lang);
void displayPushState(int state);
void displayRefresh(void);
const char* displayGetString(display_strings_t string);
#endif /* DISPLAY_H_ */
displayRefresh
void displayRefresh(void)
Refreshed the display content and outputs it.
Definition: display.cpp:198
display_string_t
Definition: display.h:30
displayThread
void * displayThread(void *threadid)
Main thread to handle display data.
Definition: display.cpp:103
lang_en
Definition: display.h:14
displayPushState
void displayPushState(int state)
Updates the display state to the matching coffee state.
Definition: display.cpp:263
str_flow
Definition: display.h:25
display_lang_t
display_lang_t
Definition: display.h:12
str_bye
Definition: display.h:26
str_brewing
Definition: display.h:22
display_strings_t
display_strings_t
Definition: display.h:18
str_cleaning
Definition: display.h:23
displayInit
void displayInit(void)
Initializes display.
Definition: display.cpp:159
displaySetLang
void displaySetLang(display_lang_t lang)
Sets the language of the display text.
Definition: display.cpp:190
displayTimerHandler
void * displayTimerHandler(void *threadid)
Timer handler for display update.
Definition: display.cpp:125
str_ready
Definition: display.h:21
str_last
Definition: display.h:27
str_heatingready
Definition: display.h:20
str_heating
Definition: display.h:19
displayGetString
const char * displayGetString(display_strings_t string)
Returns the matching translation of a string.
Definition: display.cpp:252
str_error
Definition: display.h:24
displayTerminate
void displayTerminate(void)
Handles cleanup before program termination.
Definition: display.cpp:180
lang_de
Definition: display.h:13
lang_last
Definition: display.h:15
state
int state
Definition: coffee.cpp:27