EX-Display
EX-Display
Loading...
Searching...
No Matches
/home/runner/work/EX-Display/EX-Display/TFT_eSPITouch.h
Go to the documentation of this file.
1/*
2 * © 2024 Peter Cole
3 *
4 * This is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * It is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this code. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#ifndef TFT_ESPITOUCH_H
19#define TFT_ESPITOUCH_H
20
21// Do not load when testing, TFT_eSPI library is incompatible and will cause failures.
22#ifndef PIO_UNIT_TESTING
23
24#include "Defines.h"
25#include "InputInterface.h"
26#include "TFT_eSPIDisplay.h"
27#include <SPI.h>
28#include <TFT_eSPI.h>
29
32public:
35 TFT_eSPITouch(int displayId);
36
38 void begin() override;
39
42 void check() override;
43
47 static TFT_eSPITouch *create(int displayId);
48
49private:
50 TFT_eSPI *_tft;
51 const char _calibrationFile[20];
52
55 bool _calibrated();
56
59 bool _doCalibration();
60
63 bool _setupSPIFFS();
64
68};
69
70#endif // PIO_UNIT_TESTING
71
72#endif // TFT_ESPITOUCH_H
Class to abstract away all physical input implementatio to enable multiple input types Default return...
Definition InputInterface.h:28
Display class for TFT_eSPI based displays.
Definition TFT_eSPIDisplay.h:48
Display class for TFT_eSPI touch screens.
Definition TFT_eSPITouch.h:31
bool _setupSPIFFS()
Ensure SPIFFS filesystem is up and running.
Definition TFT_eSPITouch.cpp:141
bool _calibrated()
Test if valid calibration data is available for this touch interface.
Definition TFT_eSPITouch.cpp:103
bool _doCalibration()
Run the TFT_eSPI calibration sequence.
Definition TFT_eSPITouch.cpp:126
TFT_eSPI * _tft
Definition TFT_eSPITouch.h:50
void begin() override
Perform any initial once off setup or configuration here and call only once.
Definition TFT_eSPITouch.cpp:33
static TFT_eSPITouch * create(int displayId)
Static method to enable the compiler to generate create commands from myDevices.h entries.
Definition TFT_eSPITouch.cpp:98
const char _calibrationFile[20]
Definition TFT_eSPITouch.h:51
void _displayCalibrationError(TFT_eSPIDisplay *display)
Display calibration error on screen and pause for 5 seconds.
Definition TFT_eSPITouch.cpp:155
void check() override
Call this method at least once per main loop to monitor for input actions Any actions should call the...
Definition TFT_eSPITouch.cpp:81