/*
 * display.h
 *
 *  Created on: Sep 26, 2017
 *      Author: Philipp Hinz
 */

#ifndef DISPLAY_H_
#define DISPLAY_H_
#include <string>
#include "coffee.h"

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_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"
				}
		},
		{
				{
						"Ausschalten...",
						"Turning off..."
				}
		}
};

#define DEFAULT_LANG 	lang_en /**< Default display language */
#define REFRESH_RATE	10 /**< Display refresh rate in Hz */
#define DISPLAY_ROWS	2
#define DISPLAY_COLS	16

void *displayThread(void *threadid);
void *displayTimerHandler(void *threadid);
void displayInit(void);
void displaySetLang(display_lang_t lang);

void displayPushState(coffee_status_t state);

void displayRefresh(void);
const char* displayGetString(display_strings_t string);


#endif /* DISPLAY_H_ */
