ST7789V.h
Go to the documentation of this file.
1 /****
2  * ST7789V.h
3  *
4  * This file is part of the Sming-Graphics Library
5  *
6  * This library is free software: you can redistribute it and/or modify it under the terms of the
7  * GNU General Public License as published by the Free Software Foundation, version 3 or later.
8  *
9  * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along with this library.
14  * If not, see <https://www.gnu.org/licenses/>.
15  *
16  * @author: October 2021 - Slavey Karadzhov <slav@attachix.com>
17  *
18  ****/
19 
20 #pragma once
21 
22 #include "../MipiDisplay.h"
23 
24 namespace Graphics
25 {
26 namespace Display
27 {
28 class ST7789V : public MipiDisplay
29 {
30 public:
31  static constexpr Size resolution{240, 320};
32 
33  ST7789V(HSPI::Controller& spi, Size screenSize = resolution) : MipiDisplay(spi, resolution, screenSize)
34  {
35  }
36 
37  uint16_t readNvMemStatus();
38 
39  /* Device */
40 
41  String getName() const override
42  {
43  return F("ST7789V");
44  }
45 
46 protected:
47  bool initialise() override;
48 };
49 
50 } // namespace Display
51 } // namespace Graphics
#define F(string_literal)
Wrap a string literal stored in flash and access it using a String object.
Definition: WString.h:113
Definition: Display.h:22
Definition: ST7789V.h:29
static constexpr Size resolution
Definition: ST7789V.h:31
ST7789V(HSPI::Controller &spi, Size screenSize=resolution)
Definition: ST7789V.h:33
bool initialise() override
Perform display-specific initialisation.
String getName() const override
Get name of display.
Definition: ST7789V.h:41
Definition: MipiDisplay.h:28
Manages access to SPI hardware.
Definition: HardwareSPI/src/include/HSPI/Controller.h:52
The String class.
Definition: WString.h:137
Definition: Virtual.h:31
Size of rectangular area (width x height)
Definition: Libraries/Graphics/src/include/Graphics/Types.h:105