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
3b5e6736
Commit
3b5e6736
authored
Nov 22, 2017
by
Bodmer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Version update, minor tweaks and typos
parent
3e3d638b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
22 deletions
+37
-22
TFT_eSPI.cpp
TFT_eSPI.cpp
+12
-2
examples/Sprite/Sprite_RLE_Font_test/Sprite_RLE_Font_test.ino
...ples/Sprite/Sprite_RLE_Font_test/Sprite_RLE_Font_test.ino
+12
-14
examples/Sprite/Sprite_drawPixel/Sprite_drawPixel.ino
examples/Sprite/Sprite_drawPixel/Sprite_drawPixel.ino
+10
-3
examples/Sprite/Sprite_scroll_16bit/Sprite_scroll_16bit.ino
examples/Sprite/Sprite_scroll_16bit/Sprite_scroll_16bit.ino
+1
-1
library.json
library.json
+1
-1
library.properties
library.properties
+1
-1
No files found.
TFT_eSPI.cpp
View file @
3b5e6736
...
...
@@ -4228,9 +4228,19 @@ void TFT_eSprite::createSprite(int16_t w, int16_t h)
void
TFT_eSprite
::
setColorDepth
(
int8_t
b
)
{
if
(
_created
)
deleteSprite
();
// Can't change an existing sprite's colour depth so delete it
if
(
_created
)
{
if
(
_bpp16
)
free
(
_img
);
else
free
(
_img8
);
}
// Now define the new colour depth
if
(
b
>
8
)
_bpp16
=
true
;
// Bytes per pixel
else
_bpp16
=
false
;
// If it existed, re-create the sprite with the new colour depth
if
(
_created
)
createSprite
(
_iwidth
,
_iheight
);
}
...
...
@@ -4724,7 +4734,7 @@ void TFT_eSprite::drawFastHLine(int32_t x, int32_t y, int32_t w, uint32_t color)
color
=
(
color
>>
8
)
|
(
color
<<
8
);
while
(
w
--
)
_img
[
_iwidth
*
y
+
x
++
]
=
(
uint16_t
)
color
;
}
else
else
{
color
=
(
color
&
0xE000
)
>>
8
|
(
color
&
0x0700
)
>>
6
|
(
color
&
0x0018
)
>>
3
;
//while (w--) _img8[_iwidth * y + x++] = (uint8_t) color;
...
...
examples/Sprite/Sprite_RLE_Font_test/Sprite_RLE_Font_test.ino
View file @
3b5e6736
/*
Display all the fast rendering fonts
.
Display all the fast rendering fonts
in a sprite
Make sure all the display driver and pin comnections are correct by
editting the User_Setup.h file in the TFT_eSPI library folder.
...
...
@@ -9,13 +9,10 @@
#########################################################################
*/
//
Create a sprite 160 x 128 pixels (needs 40Kbytes of RAM!
)
//
Specify sprite 160 x 128 pixels (needs 40Kbytes of RAM for 16 bit colour
)
#define IWIDTH 160
#define IHEIGHT 128
// New background colour
#define TFT_BROWN 0x38E0
// Pause in milliseconds between screens, change to 0 to time font rendering
#define WAIT 500
...
...
@@ -34,6 +31,7 @@ void setup(void) {
tft
.
fillScreen
(
TFT_BLUE
);
//img.setColorDepth(8); // Optionally set depth to 8 to reduce RAM use
img
.
createSprite
(
IWIDTH
,
IHEIGHT
);
img
.
fillSprite
(
TFT_BLACK
);
}
...
...
@@ -125,7 +123,7 @@ void loop() {
targetTime
=
millis
();
img
.
setTextSize
(
1
);
img
.
fillSprite
(
TFT_B
ROWN
);
img
.
fillSprite
(
TFT_B
LACK
);
img
.
setTextColor
(
TFT_GREEN
);
img
.
drawString
(
" !
\"
#$%&'()*+,-./0123456"
,
0
,
0
,
2
);
...
...
@@ -137,7 +135,7 @@ void loop() {
img
.
drawChar
(
127
,
xpos
,
64
,
2
);
img
.
pushSprite
(
0
,
0
);
delay
(
WAIT
);
img
.
fillSprite
(
TFT_B
ROWN
);
img
.
fillSprite
(
TFT_B
LACK
);
img
.
setTextColor
(
TFT_GREEN
);
img
.
drawString
(
" !
\"
#$%&'()*+,-."
,
0
,
0
,
4
);
...
...
@@ -147,7 +145,7 @@ void loop() {
img
.
drawString
(
"PQRSTUVWX"
,
0
,
104
,
4
);
img
.
pushSprite
(
0
,
0
);
delay
(
WAIT
);
img
.
fillSprite
(
TFT_B
ROWN
);
img
.
fillSprite
(
TFT_B
LACK
);
img
.
drawString
(
"YZ[
\\
]^_`abc"
,
0
,
0
,
4
);
img
.
drawString
(
"defghijklmno"
,
0
,
26
,
4
);
img
.
drawString
(
"pqrstuvwxyz"
,
0
,
52
,
4
);
...
...
@@ -156,7 +154,7 @@ void loop() {
img
.
drawChar
(
127
,
xpos
,
78
,
4
);
img
.
pushSprite
(
0
,
0
);
delay
(
WAIT
);
img
.
fillSprite
(
TFT_B
ROWN
);
img
.
fillSprite
(
TFT_B
LACK
);
img
.
setTextColor
(
TFT_BLUE
);
img
.
drawString
(
"012345"
,
0
,
0
,
6
);
...
...
@@ -164,29 +162,29 @@ void loop() {
img
.
drawString
(
"apm-:."
,
0
,
80
,
6
);
img
.
pushSprite
(
0
,
0
);
delay
(
WAIT
);
img
.
fillSprite
(
TFT_B
ROWN
);
img
.
fillSprite
(
TFT_B
LACK
);
img
.
setTextColor
(
TFT_RED
);
img
.
drawString
(
"0123"
,
0
,
0
,
7
);
img
.
drawString
(
"4567"
,
0
,
60
,
7
);
img
.
pushSprite
(
0
,
0
);
delay
(
WAIT
);
img
.
fillSprite
(
TFT_B
ROWN
);
img
.
fillSprite
(
TFT_B
LACK
);
img
.
drawString
(
"890:."
,
0
,
0
,
7
);
img
.
drawString
(
""
,
0
,
60
,
7
);
img
.
pushSprite
(
0
,
0
);
delay
(
WAIT
);
img
.
fillSprite
(
TFT_B
ROWN
);
img
.
fillSprite
(
TFT_B
LACK
);
img
.
setTextColor
(
TFT_YELLOW
);
img
.
drawString
(
"0123"
,
0
,
0
,
8
);
img
.
pushSprite
(
0
,
0
);
delay
(
WAIT
);
img
.
fillSprite
(
TFT_B
ROWN
);
img
.
fillSprite
(
TFT_B
LACK
);
img
.
drawString
(
"4567"
,
0
,
0
,
8
);
img
.
pushSprite
(
0
,
0
);
delay
(
WAIT
);
img
.
fillSprite
(
TFT_B
ROWN
);
img
.
fillSprite
(
TFT_B
LACK
);
img
.
drawString
(
"890:."
,
0
,
0
,
8
);
img
.
pushSprite
(
0
,
0
);
delay
(
WAIT
);
...
...
examples/Sprite/Sprite_drawPixel/Sprite_drawPixel.ino
View file @
3b5e6736
...
...
@@ -7,17 +7,21 @@
Example for library:
https://github.com/Bodmer/TFT_eSPI
A Sprite is notionally an invisibl
y
graphics screen that is
A Sprite is notionally an invisibl
e
graphics screen that is
kept in the processors RAM. Graphics can be drawn into the
Sprite just as it can be drawn directly to the screen. Once
the Sprite is completed it can be plotted onto the screen in
any position. If there is sufficient RAM then the Sprite can
be the same size as the screen and used as a frame buffer.
The
Sprite occupies (2 * width * height) bytes in RAM.
A 16 bit
Sprite occupies (2 * width * height) bytes in RAM.
On a ESP8266 Sprite sizes up to 126 x 160 can be accomodated,
this size requires 40kBytes of RAM.
this size requires 40kBytes of RAM for a 16 bit colour depth.
When 8 bit colour depth sprites are created they occupy
(width * height) bytes in RAM, so larger sprites can be
created, or the RAM required is halved.
*/
...
...
@@ -42,6 +46,9 @@ void setup()
// Initialise the TFT registers
tft
.
init
();
// Optionally set colour depth to 8 or 16 bits, default is 16 if not spedified
// spr.setColorDepth(8);
// Create a sprite of defined size
spr
.
createSprite
(
WIDTH
,
HEIGHT
);
...
...
examples/Sprite/Sprite_scroll_16bit/Sprite_scroll_16bit.ino
View file @
3b5e6736
...
...
@@ -7,7 +7,7 @@
The sketch has been tested on a 320x240 ILI9341 based TFT, it
coule be adapted for other screen sizes.
A Sprite is notionally an invisibl
y
graphics screen that is
A Sprite is notionally an invisibl
e
graphics screen that is
kept in the processors RAM. Graphics can be drawn into the
Sprite just as it can be drawn directly to the screen. Once
the Sprite is completed it can be plotted onto the screen in
...
...
library.json
View file @
3b5e6736
{
"name"
:
"TFT_eSPI"
,
"version"
:
"0.16.
16
"
,
"version"
:
"0.16.
20
"
,
"keywords"
:
"TFT, ESP8266, NodeMCU, ESP32, ILI9341, ST7735, ILI9163, S6D02A1, ILI9486"
,
"description"
:
"A TFT SPI graphics library for ESP8266"
,
"repository"
:
...
...
library.properties
View file @
3b5e6736
name
=
TFT_eSPI
version
=
0.16.
16
version
=
0.16.
20
author
=
Bodmer
maintainer
=
Bodmer
sentence
=
A fast TFT library for ESP8266 processors and the Arduino IDE
...
...
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