display.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * display.h
  3. *
  4. * Created on: Sep 26, 2017
  5. * Author: Philipp Hinz
  6. */
  7. #ifndef DISPLAY_H_
  8. #define DISPLAY_H_
  9. #include <string>
  10. typedef enum {
  11. lang_de,
  12. lang_en,
  13. lang_last
  14. } display_lang_t;
  15. typedef enum {
  16. str_heating,
  17. str_heatingready,
  18. str_ready,
  19. str_brewing,
  20. str_cleaning,
  21. str_error,
  22. str_flow,
  23. str_bye,
  24. str_last
  25. } display_strings_t;
  26. typedef struct {
  27. char const * const text[lang_last];
  28. } display_string_t;
  29. static const display_string_t display_strings[str_last] =
  30. {
  31. { // heating
  32. {
  33. "Heizt auf",
  34. "Heating"
  35. }
  36. },
  37. { // heatingready
  38. {
  39. "Bereit (Heizt)",
  40. "Ready (Heating)"
  41. }
  42. },
  43. { // ready
  44. {
  45. "Bereit",
  46. "Ready"
  47. }
  48. },
  49. { // brewing
  50. {
  51. "Bezug..",
  52. "Brewing.."
  53. }
  54. },
  55. { // cleaning
  56. {
  57. "Reinigt..",
  58. "Cleaning.."
  59. }
  60. },
  61. { // error
  62. {
  63. "Fehler",
  64. "Error"
  65. }
  66. },
  67. { // flow
  68. {
  69. "Menge",
  70. "Flow"
  71. }
  72. },
  73. { // bye
  74. {
  75. "Auf wiedersehen",
  76. "Good bye"
  77. }
  78. }
  79. };
  80. #define DEFAULT_LANG lang_de /**< Default display language */
  81. #define REFRESH_RATE 10 /**< Display refresh rate in Hz */
  82. #define DISPLAY_ROWS 2
  83. #define DISPLAY_COLS 16
  84. void *displayThread(void *threadid);
  85. void *displayTimerHandler(void *threadid);
  86. void displayInit(void);
  87. void displayTerminate(void);
  88. void displaySetLang(display_lang_t lang);
  89. void displayPushState(int state);
  90. void displayRefresh(void);
  91. const char* displayGetString(display_strings_t string);
  92. #endif /* DISPLAY_H_ */