/* * 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 //(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_fullTank, str_error, str_flow, str_bye, str_waitoff, str_menu, str_menu_softoff, str_menu_kill, str_menu_singleEspresso, str_menu_stats, str_menu_stats2, str_menu_nextdesc, str_menu_temp, str_menu_clean, str_menu_reboot, str_menu_exit, str_menu_settings, str_menu_resetkwh, str_menu_resetkwh_val, str_menu_changepreinf, str_menu_changebrewtime, str_menu_changebrewml, str_menu_changesoaktime, str_menu_changeAutoReset, str_menu_leavesettings, str_postBrew, 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.." } }, { // full tank { "Abwasser leeren", "Graywater full" } }, { // 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 aus", "Turn off now" } }, { // str_menu_singleEspresso { "einf. Espresso", "single espresso" } }, { // 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_reboot { "Neustarten", "restart Pi" } }, { // str_menu_exit { "Menü verlassen", "Leave menu" } }, { // str_menu_settings { "Einstellungen", "Settings" } }, { // str_menu_resetkwh { "Reset kWh Zähler", "Reset kWh" } }, { // str_menu_resetkwh_val { "Zurücksetzen?", "Confirm to reset" } }, { // str_change_preinf { "Vorbrühmenge", "Preinfusion" } }, { // str_change_brewtime { "Extraktionszeit", "Brewing time" } }, { // str_changebrewml { "Menge Espresso", "Amount Dbl Espr" } }, { // str_changesoaktime { "Quellzeit", "Soak time" } }, { // str_menu_changeAutoReset { "Auto reset anp", "Auto reset adj" } }, { // str_leavesettings { "Verlassen", "Leave" } }, { // str_postBrew { "Qualitaet:", "Quality:" } } }; 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); const char* displayGetString(display_strings_t string); void displaySetLang(display_lang_t lang); #endif /* DISPLAY_H_ */