lcd.h
1 /*
2  * EEZ PSU Firmware
3  * Copyright (C) 2015-present, Envox d.o.o.
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9 
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14 
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #pragma once
20 
21 #include "UTFT.h"
22 #include "font.h"
23 
24 namespace eez {
25 namespace psu {
26 namespace gui {
27 namespace lcd {
28 
29 class EEZ_UTFT : public UTFT {
30 public:
31  EEZ_UTFT(byte model, int RS, int WR, int CS, int RST, int SER = 0);
32 
33  void drawStr(const char *text, int textLength, int x, int y, int clip_x1, int clip_y1, int clip_x2, int clip_y2, font::Font &font, bool fill_background);
34  int measureStr(const char *text, int textLength, font::Font &font, int max_width = 0);
35 
36  //void fillRect();
37  //void drawRect();
38  //void drawBitmap();
39  //void drawHLine();
40  //void drawVLine();
41 
42 private:
43  font::Font font;
44 
45  int8_t drawGlyph(int x1, int y1, int clip_x1, int clip_y1, int clip_x2, int clip_y2, uint8_t encoding, bool fill_background);
46  int8_t measureGlyph(uint8_t encoding);
47 };
48 
49 extern EEZ_UTFT lcd;
50 
51 void init();
52 void turnOn();
53 void turnOff();
54 
55 }
56 }
57 }
58 } // namespace eez::psu::ui::lcd
Namespace for the everything from the EEZ.
Definition: actions.cpp:41
Definition: lcd.h:29
Definition: font.h:40