3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34#include "TinyGPU/Boards/LCDBoardsCommon.h"
35#include "TinyGPU/Color/RGB565.h"
36#include "TinyGPU/Drivers/DisplayDriver.h"
37#include "TinyGPU/Input/TouchDriver.h"
39#include <STM32F723Discovery.h>
46
47
48
49
50
51
52
53
54
55
56
57
58
62 stm32f723::LcdOrientation orientation =
77 const size_t n = surface.size();
78 if (scratch_.size() < n) scratch_.resize(n);
79 const uint16_t* src =
reinterpret_cast<
const uint16_t*>(surface.data());
80 uint16_t* dst =
reinterpret_cast<uint16_t*>(scratch_.data());
81 const size_t pixelCount = n /
sizeof(RGB565);
82 for (size_t i = 0; i < pixelCount; ++i) {
83 dst[i] = RGB565::swapBytes(src[i]);
85 lcd_.drawRGBImage(
static_cast<uint16_t>(x),
static_cast<uint16_t>(y),
86 static_cast<uint16_t>(surface.width()),
87 static_cast<uint16_t>(surface.height()),
103 static constexpr size_t kSize = 240;
105 stm32f723::LcdOrientation orientation_;
107 std::vector<uint8_t> scratch_;
111
112
113
114
119 bool begin()
override {
return touch_.begin(kSize, kSize); }
121 bool isTouched()
override {
return touch_.read().touched(); }
124 const stm32f723::TouchState state = touch_.read();
125 if (!state.touched())
return false;
126 outPoint.x = state.primary().x;
127 outPoint.y = state.primary().y;
134 const stm32f723::TouchState state = touch_.read();
135 if (state.touchCount < 2)
return false;
136 outPoint.x = state.points[1].x;
137 outPoint.y = state.points[1].y;
143 static constexpr uint16_t kSize = 240;
145 stm32f723::TouchScreen touch_;
149
150
151
152
153
154
155
156
157
158
159
164 if (!display_.begin())
return false;
165 return touch_.begin();
DisplayDriver<RGB565> wrapping the stm32f723-disco library's LCD class - the library owns the panel's...
Definition: LCDBoardsSTM32F723Discovery.h:59
bool writeData(ISurface< RGB565 > &surface) override
Definition: LCDBoardsSTM32F723Discovery.h:72
size_t height() const override
Definition: LCDBoardsSTM32F723Discovery.h:70
bool writeData(ISurface< RGB565 > &surface, size_t x, size_t y) override
Definition: LCDBoardsSTM32F723Discovery.h:76
size_t width() const override
Definition: LCDBoardsSTM32F723Discovery.h:69
bool begin() override
Resets and initializes the panel via the stm32f723-disco BSP wrapper.
Definition: LCDBoardsSTM32F723Discovery.h:67
bool setAddressWindow(size_t x, size_t y, size_t w, size_t h) override
Definition: LCDBoardsSTM32F723Discovery.h:98
DisplayDriverSTM32F723Discovery(stm32f723::LcdOrientation orientation=stm32f723::LcdOrientation::Landscape)
Definition: LCDBoardsSTM32F723Discovery.h:61
stm32f723::LCD & lcd()
Definition: LCDBoardsSTM32F723Discovery.h:95
"STM32F723E-Discovery" - on-board 240x240 ST7789H2 LCD (FMC) + FT6x06/FT3x67 capacitive touch,...
Definition: LCDBoardsSTM32F723Discovery.h:160
size_t height() const override
Panel height in pixels.
Definition: LCDBoardsSTM32F723Discovery.h:169
const I2SPins & i2s() const override
The board's I2S/PA pin assignment.
Definition: LCDBoardsSTM32F723Discovery.h:173
TouchDriver * touch() override
The board's touch controller, or nullptr if none is wired up.
Definition: LCDBoardsSTM32F723Discovery.h:172
size_t width() const override
Panel width in pixels.
Definition: LCDBoardsSTM32F723Discovery.h:168
bool begin() override
Initializes the display, then the touch controller.
Definition: LCDBoardsSTM32F723Discovery.h:163
const LEDPins & led() const override
The board's LED pin assignment.
Definition: LCDBoardsSTM32F723Discovery.h:174
DisplayDriverSTM32F723Discovery & display() override
The board's display driver.
Definition: LCDBoardsSTM32F723Discovery.h:171
Definition: LCDBoardsCommon.h:62
RGB color stored in 16-bit RGB565 format, byte-swapped from the conventional bit layout.
Definition: RGB565.h:24
TouchDriver wrapping the stm32f723-disco library's TouchScreen class (on-board FT6x06/FT3x67 capaciti...
Definition: LCDBoardsSTM32F723Discovery.h:115
bool isTouched() override
Return whether the panel currently appears touched.
Definition: LCDBoardsSTM32F723Discovery.h:121
bool getPoint(Point &outPoint) override
Read the current touch point.
Definition: LCDBoardsSTM32F723Discovery.h:123
bool begin() override
Definition: LCDBoardsSTM32F723Discovery.h:119
bool getSecondPoint(Point &outPoint) override
The FT6x06/FT3x67 supports up to two simultaneous touches.
Definition: LCDBoardsSTM32F723Discovery.h:133
Base class for touch controllers.
Definition: TouchDriverCommon.h:72
Definition: DSIBusESP32.h:19
Definition: LCDBoardsCommon.h:28
Definition: LCDBoardsCommon.h:49
Touch point.
Definition: TouchDriverCommon.h:32
uint16_t pressure
Definition: TouchDriverCommon.h:35