/* * display.h * * Created on: Sep 26, 2017 * Author: Philipp Hinz */ #ifndef DISPLAY2_H_ #define DISPLAY2_H_ #include #include "coffee.h" #define DEFAULT_LANG lang_en // Default display language #define REFRESH_FAST 5 #define REFRESH_STD 2 #define DISPLAY_ROWS 2 #define DISPLAY_COLS 16 void *displayThread(void *threadid); void *displayTimerHandler(void *threadid); void displayInit(void); void displayPrintLn(int line, const char* str, bool centered); void displayPushState(coffee_status_t state); void displayRefresh(void); //(DO NOT change the following values unless you know what you do -> Integer division) typedef enum { refresh_fast = 5, // Display refresh rate in Hz when active refresh_std = 2 // Display refresh rate in Hz when not active } refreshRate_t; 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_waitoff, str_menu, str_menu_softoff, str_menu_kill, str_menu_stats, str_menu_stats2, str_menu_nextdesc, str_menu_temp, str_menu_clean, str_menu_demo, str_menu_exit, 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" } }, { // waitoff { "Ausschalten...", "Turning off..." } }, { // str_menu { "CoffeePi MenĂ¼", "CoffeePi Menu" } }, { // str_menu_softoff { "Ausschalten", "Turn off" } }, { // str_menu_kill { "Sofort ausschalten", "Turn off now" } }, { // str_menu_stats { "Stats", "Stats" } },{ // str_menu_stats2 { "Energieverbrauch", "Energy consumed" } }, { // str_menu_nextdesc { "Reiningung in", "Descaling in" } }, { // str_menu_temp { "Temperatur", "Temperature" } }, { // str_menu_clean { "Reinigen", "Clean" } }, { // str_menu_demo { "Demo", "Demo" } }, { // str_menu_exit { "MenĂ¼ verlassen", "Leave menu" } } }; const char* displayGetString(display_strings_t string); void displaySetLang(display_lang_t lang); #endif /* DISPLAY_H_ */