Hanna
Sourcecode Batteriemanagementsystem
screens_gfx.h
gehe zur Dokumentation dieser Datei
1 
14 #ifndef SCREENS_GFX_H_
15 #define SCREENS_GFX_H_
16 
17 #include <gfx.h>
18 
19 #include <stdio.h>
20 #include <string.h>
21 #include <stddef.h>
22 #include <stdlib.h>
23 #include <stdbool.h>
24 
25 /* Include symbols and bitmaps */
26 #include "lib_icons.h"
27 #include <lib_gfx_bms.h>
28 #include <sysfont.h>
29 
31 
32 #define BETRIEB_SPALTE_1 30
33 #define BETRIEB_SPALTE_2 80
34 #define BETRIEB_SPALTE_3 170
35 #define BETRIEB_KOPFZEILE 0
36 #define BETRIEB_TEXTZEILE 50
37 #define BETRIEB_BATZEILE_1 70
38 #define BETRIEB_BATZEILE_2 110
39 #define BETRIEB_BATZEILE_3 150
40 #define BETRIEB_BATZEILE_4 190
41 #define BETRIEB_VENTZEILE 230
42 #define BETRIEB_FUSSZEILE 270
43 
44 #define AKKU_SPALTE_1 55
45 #define AKKU_SPALTE_2 140
46 #define AKKU_VENTZEILE 46
47 #define AKKU_SOCZEILE 89
48 #define AKKU_TEMPZEILE 125
49 #define AKKU_STROMZEILE 180
50 #define AKKU_VOLTZEILE 222
51 #define AKKU_SOHZEILE 267
52 
53 #define LADEN_SPALTE_1 30
54 #define LADEN_SPALTE_2 80
55 #define LADEN_SPALTE_3 170
56 #define LADEN_KOPFZEILE 0
57 #define LADEN_TEXTZEILE 70
58 #define LADEN_BATZEILE_1 90
59 #define LADEN_BATZEILE_2 130
60 #define LADEN_BATZEILE_3 170
61 #define LADEN_BATZEILE_4 210
62 #define LADEN_VENTZEILE 270
63 
64 #define WARN_SPALTE_1 55
65 #define WARN_SPALTE_2 120
66 #define WARN_SOCZEILE 55
67 #define WARN_TEMPZEILE 100
68 #define WARN_VOLTZEILE 155
69 #define WARN_SOHZEILE 210
70 #define WARN_HINWEIS 280
71 
72 
74 
75 #define SCREEN_FLAG_BETRIEB 1
76 #define SCREEN_FLAG_AKKU_INFO 2
77 #define SCREEN_FLAG_WARNUNG 3
78 #define SCREEN_FLAG_LADEN 4
79 #define SCREEN_FLAG_HOME 5
80 
81 
83 
84 #define SCREEN_RETURN_BETRIEB 1
85 #define SCREEN_RETURN_LADEN 0
86 
87 
89 
90 #define SET_WARNUNG_FLAG 1
91 #define CLEAR_WARNUNG_FLAG 0
92 
93 
94 //const gfx_color_t color_base[] = { GFX_COLOR_GREEN, GFX_COLOR_YELLOW, GFX_COLOR_RED, GFX_COLOR_WHITE, GFX_COLOR_LT_GRAY, GFX_COLOR_GRAY };
95 
103 typedef struct
104 {
105  bool verbraucher;
106  bool warnung;
107  bool vent1;
108  bool vent2;
109  float volt;
110  int mAmp;
111  uint16_t battery_color[8];
112  float bat_voltage[8];
113 } scr_betrieb_t;
114 
121 typedef struct
122 {
123  char name[3];
124  bool verbraucher;
125  bool vent;
126  float volt;
127  int16_t mAmp;
128  uint8_t soc;
129  uint16_t soc_color;
130  uint8_t soh;
131  uint8_t temperatur;
132  uint16_t temp_color;
133  uint8_t top_bat_cross;
134  uint16_t top_bat_color;
135 } scr_info_t;
136 
144 typedef struct
145 {
146  bool vent1;
147  bool vent2;
148  uint16_t battery_color[8];
149  uint16_t soc_color;
150  int16_t mAmp[8];
151 } scr_laden_t;
152 
159 typedef struct
160 {
161  char name[3];
162  bool soc;
163  uint16_t soc_color;
164  bool soh;
165  uint8_t temperatur; // 0 = normal, 1 = upper, 2 = critical
166  uint16_t temp_color;
167  bool volt;
168 } scr_warning_t;
169 
170 typedef struct
171 {
172  uint8_t x;
173  uint16_t y;
174 } auswahl_t;
175 
176 extern scr_betrieb_t scr_betrieb;
177 extern scr_laden_t scr_laden;
178 extern scr_info_t scr_akku_info[];
179 extern scr_warning_t scr_akku_warning;
180 extern uint8_t screen_flag, warnung_flag;
181 extern int8_t auswahl_nr;
182 extern auswahl_t auswahl_batterie[8];
183 extern uint8_t screen_return;
184 extern bool msgbox_notaus;
185 
186 void screen_betrieb ( scr_betrieb_t icon );
187 void screen_akku_info ( scr_info_t icon );
188 void screen_laden ( scr_laden_t icon );
189 void screen_akku_warnung ( scr_warning_t icon );
190 void screen_home ( void );
191 void screen_init ( void );
192 void message_notaus ( void );
193 
194 #endif /* SCREENS_GFX_H_ */
void screen_home(void)
Der Home-Screen.
Definition: screens_gfx.c:507
Variablentyp zur Darstellung des Laden-Screen.
Definition: screens_gfx.h:144
void screen_betrieb(scr_betrieb_t icon)
Der Standard Betriebsscreen.
Definition: screens_gfx.c:55
bool verbraucher
Verbraucher ein- oder ausgeschaltet.
Definition: screens_gfx.h:105
Standardheader.
Graphical System Font system.
Variablentyp zur Darstellung des Info-Screen.
Definition: screens_gfx.h:121
void screen_laden(scr_laden_t icon)
Der Ladescreen.
Definition: screens_gfx.c:284
void screen_init(void)
Koordinaten für die Markierung ausgewählter Zeilen wird initialisiert.
Definition: screens_gfx.c:570
Graphical library API header file.
void message_notaus(void)
Messagebox mit Text NOTAUS.
Definition: screens_gfx.c:557
Variablentyp zur Darstellung des Betriebs-Screen.
Definition: screens_gfx.h:103
void screen_akku_warnung(scr_warning_t icon)
Der Warnung-Screen.
Definition: screens_gfx.c:400
Standardheader.
Variablentyp zur Darstellung des Warnung-Screen.
Definition: screens_gfx.h:159
void screen_akku_info(scr_info_t icon)
Der Infoscreen.
Definition: screens_gfx.c:198