1717#include "LCD.h"
1818#include "display.h"
1919#include "display_driver.h"
20+ #include "StringPixelCoordTable_ili9341.h"
2021
2122
2223
24+ MainscreenType MainScreen = {
25+ .Value .x = X_LEFT_EDGE ,
26+ .Value .y = Y_VALUES_START ,
27+ .Volume .x = X_LEFT_EDGE ,
28+ .Volume .y = Y_VALUES_START + FONT2_H * 1 ,
29+ .Corr .x = X_LEFT_EDGE ,
30+ .Corr .y = Y_VALUES_START + FONT2_H * 2 ,
31+ .Temp .x = X_LEFT_EDGE ,
32+ .Temp .y = Y_VALUES_START + FONT2_H * 3 ,
33+ .Press .x = X_LEFT_EDGE ,
34+ .Press .y = Y_VALUES_START + FONT2_H * 4 ,
35+ };
36+
37+
2338void lcd_init (void ){
2439 #ifdef ili9341
2540 LCD_Init ();
26-
41+
2742 glcd_led_on ();
2843 Orientation = Portrait ;
2944 #endif
45+
46+ #ifdef old_LCD
47+ init_LCD ();
48+ #endif
3049}
3150
3251
@@ -94,4 +113,89 @@ void lcd_Draw_Cross(uint16_t x0,uint16_t y0,uint16_t x1,uint16_t y1){
94113 #ifdef ili9341
95114 LCD_Draw_Cross (x0 ,y0 ,x1 ,y1 );
96115 #endif
97- }
116+ }
117+
118+ void Print_add_Line (char * Text ,uint8_t first_line ){
119+ #ifdef ili9341
120+ InitScreen_AddLine_ili (Text ,first_line );
121+ #endif
122+ #ifdef old_LCD
123+ LCD_InitScreen_AddLine (Text ,first_line );
124+ #endif
125+ }
126+
127+ void setInitScreen (uint16_t fore , uint16_t back , uint8_t nextLine , uint8_t FontNr , uint8_t XScale , uint8_t YScale ){
128+ #ifdef ili9341
129+ setInitScreen_ili (fore ,back ,nextLine ,FontNr ,XScale ,YScale );
130+ #endif // ili9341
131+ }
132+
133+ void paint_info_line (char * line , _Bool update ){
134+ #ifdef ili9341
135+ paint_info_line_ili (line ,update );
136+ #endif
137+
138+ #ifdef old_LCD
139+ LCD_paint_info_line (* line ,update );
140+ #endif
141+ }
142+
143+
144+ void paint_value (char * text ,uint8_t update ,char * unit ){
145+ if (update )
146+ {
147+ lcd_Print (" " ,MainScreen .Value .x + DESCRUPTOR_LEN * FONT2_W ,MainScreen .Value .y ,2 ,1 ,1 ,FGC ,BGC );
148+ }
149+ lcd_Print (text ,MainScreen .Value .x + DESCRUPTOR_LEN * FONT2_W ,MainScreen .Value .y ,2 ,1 ,1 ,FGC ,BGC );
150+
151+ lcd_Print (unit ,HALF_SPACE_WIDTH_FONT_2 + MainScreen .Value .x + (DESCRUPTOR_LEN + strlen (text )) * FONT2_W , MainScreen .Value .y ,2 ,1 ,1 ,FGC ,BGC );
152+ }
153+ void paint_volume (char * text ,uint8_t update ,char * unit ){
154+ if (update )
155+ {
156+ lcd_Print (" " ,MainScreen .Volume .x + DESCRUPTOR_LEN * FONT2_W ,MainScreen .Volume .y ,2 ,1 ,1 ,FGC ,BGC );
157+ }
158+ lcd_Print (text ,MainScreen .Volume .x + DESCRUPTOR_LEN * FONT2_W ,MainScreen .Volume .y ,2 ,1 ,1 ,FGC ,BGC );
159+
160+ lcd_Print (unit ,HALF_SPACE_WIDTH_FONT_2 + MainScreen .Volume .x + (DESCRUPTOR_LEN + strlen (text )) * FONT2_W , MainScreen .Volume .y ,2 ,1 ,1 ,FGC ,BGC );
161+
162+ }
163+
164+ void paint_corr (char * text ,uint8_t update ,char * unit ){
165+ if (update )
166+ {
167+ lcd_Print (" " ,MainScreen .Corr .x + DESCRUPTOR_LEN * FONT2_W ,MainScreen .Corr .y ,2 ,1 ,1 ,FGC ,BGC );
168+ }
169+ lcd_Print (text ,MainScreen .Corr .x + DESCRUPTOR_LEN * FONT2_W ,MainScreen .Corr .y ,2 ,1 ,1 ,FGC ,BGC );
170+
171+ lcd_Print (unit ,HALF_SPACE_WIDTH_FONT_2 + MainScreen .Corr .x + (DESCRUPTOR_LEN + strlen (text )) * FONT2_W , MainScreen .Corr .y ,2 ,1 ,1 ,FGC ,BGC );
172+ }
173+ void paint_temp (char * text ,uint8_t update ,char * unit ){
174+ if (update )
175+ {
176+ lcd_Print (" " ,MainScreen .Temp .x + DESCRUPTOR_LEN * FONT2_W ,MainScreen .Temp .y ,2 ,1 ,1 ,FGC ,BGC );
177+ }
178+ lcd_Print (text ,MainScreen .Temp .x + DESCRUPTOR_LEN * FONT2_W ,MainScreen .Temp .y ,2 ,1 ,1 ,FGC ,BGC );
179+
180+ lcd_Print (unit ,HALF_SPACE_WIDTH_FONT_2 + MainScreen .Temp .x + (DESCRUPTOR_LEN + strlen (text )) * FONT2_W , MainScreen .Temp .y ,2 ,1 ,1 ,FGC ,BGC );
181+ }
182+
183+ void paint_press (char * text ,uint8_t update ,char * unit ){
184+ if (update )
185+ {
186+ lcd_Print (" " ,MainScreen .Press .x + DESCRUPTOR_LEN * FONT2_W ,MainScreen .Press .y ,2 ,1 ,1 ,FGC ,BGC );
187+ }
188+ lcd_Print (text ,MainScreen .Press .x + DESCRUPTOR_LEN * FONT2_W ,MainScreen .Press .y ,2 ,1 ,1 ,FGC ,BGC );
189+
190+ lcd_Print (unit ,HALF_SPACE_WIDTH_FONT_2 + MainScreen .Press .x + (DESCRUPTOR_LEN + strlen (text )) * FONT2_W , MainScreen .Press .y ,2 ,1 ,1 ,FGC ,BGC );
191+ }
192+
193+ void paint_Main (void ){
194+ lcd_Print ("Val:" ,MainScreen .Value .x ,MainScreen .Value .y ,2 ,1 ,1 ,FGC ,BGC );
195+ lcd_Print ("Vol:" ,MainScreen .Volume .x ,MainScreen .Volume .y ,2 ,1 ,1 ,FGC ,BGC );
196+ lcd_Print ("Cor:" ,MainScreen .Corr .x ,MainScreen .Corr .y ,2 ,1 ,1 ,FGC ,BGC );
197+ lcd_Print ("Tmp:" ,MainScreen .Temp .x ,MainScreen .Temp .y ,2 ,1 ,1 ,FGC ,BGC );
198+ lcd_Print ("Prs:" ,MainScreen .Press .x ,MainScreen .Press .y ,2 ,1 ,1 ,FGC ,BGC );
199+ }
200+
201+
0 commit comments