Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
TFT_eSPI
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
TFT_eSPI
Commits
8582ff7e
Unverified
Commit
8582ff7e
authored
Apr 20, 2022
by
Bodmer
Committed by
GitHub
Apr 20, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1786 from dracir9/master
Fix problem in PR #1770
parents
7f5b8a91
24a6a06a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
38 deletions
+70
-38
CMakeLists.txt
CMakeLists.txt
+1
-3
Kconfig
Kconfig
+50
-25
TFT_config.h
TFT_config.h
+16
-6
TFT_eSPI.h
TFT_eSPI.h
+3
-4
No files found.
CMakeLists.txt
View file @
8582ff7e
idf_component_register
(
SRCS
"TFT_eSPI.cpp"
INCLUDE_DIRS
"."
PRIV_REQUIRES arduino
)
add_definitions
(
-DTFT_eSPI_COMPONENT
)
\ No newline at end of file
PRIV_REQUIRES arduino
)
\ No newline at end of file
Kconfig
View file @
8582ff7e
menu "TFT_eSPI"
menu "Hidden menu"
visible if false
config TFT_eSPI_ESPIDF
bool "Enable Configuration"
default y
endmenu
choice TFT_DRIVER
prompt "Select TFT driver"
...
...
@@ -145,11 +153,12 @@ menu "TFT_eSPI"
config TFT_PARALLEL_8_BIT
bool "Enable 8-bit parallel mode (otherwise SPI is assumed)"
default "n"
depends on IDF_TARGET_ESP32
help
Use 8-bit parallel bus to send data to the LCD. If not set SPI will be used.
menu "Display Data pins"
visible if
TFT_PARALLEL_8_BIT
depends on
TFT_PARALLEL_8_BIT
config TFT_D0
int "Data 0 pin"
default -1
...
...
@@ -202,11 +211,12 @@ menu "TFT_eSPI"
endmenu
menu "Display SPI config"
visible if
!TFT_PARALLEL_8_BIT
depends on
!TFT_PARALLEL_8_BIT
config TFT_MISO
int "TFT MISO pin"
default -1
range -1 32
range -1 32 if IDF_TARGET_ESP32
range -1 45 if IDF_TARGET_ESP32S2
help
Master In Slave Out pin.
Can be labelled as SDO in some displays
...
...
@@ -214,7 +224,8 @@ menu "TFT_eSPI"
config TFT_MOSI
int "TFT MOSI pin"
default -1
range -1 32
range -1 32 if IDF_TARGET_ESP32
range -1 45 if IDF_TARGET_ESP32S2
help
Master Out Slave In pin.
Can be labelled as SDA or SDI in some displays
...
...
@@ -222,7 +233,8 @@ menu "TFT_eSPI"
config TFT_SCLK
int "TFT Clock pin"
default -1
range -1 32
range -1 32 if IDF_TARGET_ESP32
range -1 45 if IDF_TARGET_ESP32S2
help
Labelled in some displays as WR
...
...
@@ -258,7 +270,8 @@ menu "TFT_eSPI"
config TFT_CS
int "TFT Chip Select pin"
default -1
range -1 33
range -1 33 if IDF_TARGET_ESP32
range -1 45 if IDF_TARGET_ESP32S2
config TFT_DC
int "TFT Data/Command pin"
...
...
@@ -270,17 +283,22 @@ menu "TFT_eSPI"
config TFT_RST
int "TFT Reset pin"
default -1
range -1 33
range -1 33 if IDF_TARGET_ESP32
range -1 45 if IDF_TARGET_ESP32S2
config ENABLE_BL
bool "Enable backlight control"
default y
if ENABLE_BL
config TFT_BL
int "TFT Backlight pin"
default -1
range -1 33 if IDF_TARGET_ESP32
range -1 45 if IDF_TARGET_ESP32S2
help
Pin for the backlight control signal
config TFT_BL
int "TFT Backlight pin"
default -1
range -1 33
help
Pin for the backlight control signal
Set to -1 to disable
if TFT_BL >= 0
choice TFT_BACKLIGHT_ON
bool "Pin state to activate backlight"
default TFT_BACKLIGHT_ON_HIGH
...
...
@@ -336,15 +354,22 @@ menu "TFT_eSPI"
endmenu
menu "Touch screen configuration"
config TOUCH_CS
int "Touch chip select pin"
default -1
range -1 33
config SPI_TOUCH_FREQUENCY
int "SPI frequency for XPT2046 chip (Hz)"
default 2500000
range 1 80000000
config ENABLE_TOUCH
bool "Enable Touch"
default n
if ENABLE_TOUCH
config TOUCH_CS
int "Touch chip select pin"
default -1
range -1 33 if IDF_TARGET_ESP32
range -1 45 if IDF_TARGET_ESP32S2
config SPI_TOUCH_FREQUENCY
int "SPI frequency for XPT2046 chip (Hz)"
default 2500000
range 1 80000000
endif
endmenu
endmenu
TFT_config.h
View file @
8582ff7e
...
...
@@ -12,7 +12,7 @@
* @author Ricard Bitriá Ribes (https://github.com/dracir9)
* Created Date: 22-01-2022
* -----
* Last Modified: 1
1
-04-2022
* Last Modified: 1
4
-04-2022
* Modified By: Ricard Bitriá Ribes
* -----
* @copyright (c) 2022 Ricard Bitriá Ribes
...
...
@@ -143,8 +143,13 @@
#endif
// Backlight config
#if CONFIG_TFT_BL != -1
#define TFT_BL CONFIG_TFT_BL
#ifdef CONFIG_ENABLE_BL
#if CONFIG_TFT_BL == -1
#error "Invalid backlight control pin. Check TFT_eSPI configuration"
#else
#define TFT_BL CONFIG_TFT_BL
#endif
#define TFT_BACKLIGHT_ON CONFIG_TFT_BACKLIGHT_ON
#endif
...
...
@@ -218,7 +223,6 @@
// SPI BUS
#else
#if CONFIG_TFT_MISO == -1
#error "Invalid MISO pin. Check TFT_eSPI configuration"
#else
...
...
@@ -289,8 +293,14 @@
** Section 5: Touchscreen configuration
***************************************************************************************/
#define TOUCH_CS CONFIG_TOUCH_CS
#ifdef CONFIG_ENABLE_TOUCH
#if CONFIG_TOUCH_CS == -1
#error "Invalid Touch Chip Select pin. Check TFT_eSPI configuration"
#else
#define TOUCH_CS CONFIG_TOUCH_CS
#endif
#define SPI_TOUCH_FREQUENCY CONFIG_SPI_TOUCH_FREQUENCY
#define SPI_TOUCH_FREQUENCY CONFIG_SPI_TOUCH_FREQUENCY
#endif
#endif // TFT_CONFIG_H
TFT_eSPI.h
View file @
8582ff7e
...
...
@@ -27,10 +27,6 @@
***************************************************************************************/
//Standard support
#ifdef TFT_eSPI_COMPONENT
#include "TFT_config.h"
#endif
#include <Arduino.h>
#include <Print.h>
#include <SPI.h>
...
...
@@ -40,6 +36,9 @@
***************************************************************************************/
// Include header file that defines the fonts loaded, the TFT drivers
// available and the pins to be used, etc, etc
#ifdef CONFIG_TFT_eSPI_ESPIDF
#include "TFT_config.h"
#endif
#include <User_Setup_Select.h>
// Handle FLASH based storage e.g. PROGMEM
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment