Commit Graph

108 Commits

Author SHA1 Message Date
Bodmer 87aca91218 Merge branch 'master' of https://github.com/Bodmer/TFT_eSPI 2020-02-06 13:38:13 +00:00
Bodmer 15c137633a Raise version add comments for button update 2020-02-06 13:38:03 +00:00
Bodmer 7841015043 Revert "Revert "Merge pull request #540 from justcallmekoko/master""
This reverts commit 38a057762f.
2020-02-06 13:20:17 +00:00
Just Call Me Koko b734b81e6b Fix center aligned button text 2020-02-05 22:21:02 -05:00
Bodmer 38a057762f Revert "Merge pull request #540 from justcallmekoko/master"
This reverts commit 6dec790e8d, reversing
changes made to 8146ac3015.
2020-02-06 01:43:42 +00:00
justcallmekoko 2b1147c6e8 Add setLabelDatum 2020-02-05 14:13:58 -05:00
Bodmer c8530d7ae4 4 bpp Sprite bug fix
OR has precedence over AND so brackets needed.
Remove unused varaible.
2020-02-01 01:43:16 +00:00
Bodmer 8209c00316 Add new alphaBlend functions
Added 24 bit colour handling alphaBlend to reduce precision loss in multiple blend stages (e.g. in 2D colour gradients). Added option for alpha dither to reduce colour banding in gradients with 16 bit colours.

Get rid of compile warnings.
2020-01-30 16:01:36 +00:00
Bodmer 0e0fd75277 Raise to version 2.0.0
The library has been cleaned up as it has got a bit untidy due to the large number of small incremental changes.

4bit Sprite examples renaed to be consistent with others.

alphaBlend example moved to generic folder (alphaBlend fn was moved to TFT_eSPI class).
Added sections + explanatory comments to functions prototypes.

Temporary comments added for potential gotchas for noobs when using DMA.

spi_begin/end functions renamed to reflect functionality. Old fns  retained for backwards compatibility with user setup.h files.
2020-01-26 21:17:49 +00:00
kamorris 7fd29d509f Suggested changes from code review
Set font for Transparent_Sprite_Demo_Colormap to correct value (4)
renamed setColorMap to createPalette
renamed cmpPixel to readPixelValue
added setPaletteColor / getPaletteColor
added error check to createPalette
2020-01-25 12:49:29 -08:00
kamorris e019b6dcf6 added color maps and examples 2020-01-24 22:07:45 -08:00
Bodmer 7f53a571f4 Add STM32 and generic processor support 2020-01-11 23:32:10 +00:00
Bodmer 8342507233 Remove scrap drivers, fix Sprite destructor 2020-01-11 01:27:51 +00:00
Bodmer 1476da56ba Restructured code, added ST7796
RPi MHS-4.0 inch Display-B type display now supported.
2020-01-11 00:58:38 +00:00
Bodmer 10078c8325
Fix #473
Update to accommodate smooth font rendering, which need a background colour specified.
2019-11-27 02:36:17 +00:00
lovyan03 7b71a3d8b5 Add: TFT_eSprite destructor. 2019-11-21 15:19:33 +09:00
Bodmer 5bb14ba2d8 Add new callback for smooth font antialiasing
Callback allows anitaliased fonts to be rendered over colour gradients
or images.
"Smooth_font_reading_TFT" example added
"Smooth_font_gradient" example added
Minor changes to avoid signed/unsigned comparison warnings.
2019-11-10 02:23:22 +00:00
Bodmer bd23626b53 Correct coordinate cropping in Sprite 2019-10-22 23:01:33 +01:00
Bodmer d3210a7ee6 Fix #417 and add for 135x240 display
Setup 135 is for TTGO T Display (ESP32)
Plus minor tweaks to avoid some warnings
2019-10-07 17:56:17 +01:00
Bodmer 4a38aa6aec Correct issue #398 2019-07-30 17:59:08 +01:00
Bodmer 00bf69fc48 Correct #400 and #402 + other tweaks
Corrected font 2 rendering issue #402
Corrected NULL pointer issue #400
Changed grave ` character (key for this character is left of numeral 1
key) to degree symbol in font 2
Change setup24 so DC pin is not D3
2019-07-30 15:56:55 +01:00
Bodmer ab5e407e2e
Merge pull request #366 from ImpulseAdventure/Fix_getTouch_bounds
Fix getTouch() return status upon bounds overflow
2019-06-11 19:42:45 +01:00
Bodmer da349a5fbd Minor changes 2019-06-03 23:31:04 +01:00
Calvin Hass a627c51118
Fix getTouch() return status upon bounds overflow
- When the post-remapped coordinates exceed screen bounds, `getTouch()` was returning a "valid" status without updating the coordinates. This would result in spurious touch detection events at the screen boundaries.
- The fix ensures that the return value is set to "invalid" in this boundary condition.
2019-05-21 07:13:19 -07:00
Bodmer da2239f4c1
ESP8266 compiler compatibility update #361 2019-05-20 12:35:17 +01:00
Bodmer 9f17920115 Add ESP32 SD support for smooth font plus performance updates
Added SD card storage for smooth fonts with ESP32
ESP32 will use PSRAM (if available and enabled) to hold smooth font
metrics
Improve performance of ESP32 Sprite shared functions
Add basic ST7789 driver option
Latent bug fixes for pin mask
2019-04-15 12:23:16 +01:00
Bodmer 43862876a2 Permit larger anti-aliased fonts
Size limit for anti-aliased fonts raised to ~200 pixels
2019-02-20 23:33:21 +00:00
Bodmer 1edfe6c680 Fic #311
Pixel function used wrong width and height for bounds check.
Remove String variable in smooth font code (not used)
Correct ESP8266UncannyEyes example for new setAddrWindow parameters
2019-02-20 00:45:02 +00:00
Bodmer 26d7e4038a Fix touch screen handler
The touch screen handler was broken for the ESP8266 only. The library
uses SPI write only configuration for ESP8266 so the SPI buffer can be
recycled and it was left in write only mode. The library now switches
back to read & write mode at the end of a transaction.
2019-02-14 00:32:16 +00:00
Bodmer 1e1e888fa0 Support extended font formats
Adafruit_GFX font support extended to Unidode Basic Multilingual Plane
Print stream deocdes UTF-8
Smooth font ascent and descent (affects line spacing) changed to rely on
metrics provided by Processing IDE (issue #303)
Bug fix for font rendering with no background on RLE native fonts
2019-02-10 21:36:40 +00:00
Bodmer 61dfb2b4ac Extended character set suport for Adafruit_GFX format fonts
Supports Adafruit_GFX compatible font format with characters in the range 32-255.

Note that the font rendering functions expect UTF-8 encoded characters/strings.
2019-02-08 18:25:55 +00:00
Bodmer caef4519f3 Improve bounds checking update CS management
Add bounds checking to graphics functions
Rationalise variable types and style used to minimse type casting needs
(this change ended up being a more extensive refactoring than
anticipated - but once started...)
Add version reporting to diagnostic sketch
Boost PDQ graphicstest performance
2019-01-25 14:25:40 +00:00
Bodmer 054a824eb8 Add ESP32 VSPI or HSPI port option + others
If the VSPI port is in use and pins are not accessible (e.g. TTGO
T-Beam)
then add or uncomment the following line in the setup header file:
//#define USE_HSPI_PORT

Minor performance tweaks for ESP32 to minimise the occurence of the slow
transaction overhead.

setAddrWindow now takes xstart, ystart, width and height as inputs

Multi-sample raw touch x and y for noisy displays

Example update for setAddrWindow change compatibility
2019-01-22 18:41:31 +00:00
Bodmer 0fdd25186a
Fix #289
A 16 bit color image can now be plotted into an 8 bit Sprite.
2019-01-22 17:43:31 +00:00
Bodmer 8cf85c89d3 Fix #293 for Sprites 2019-01-22 12:10:13 +00:00
Bodmer 05359a4dff Misc updates
Speed up Sprite rotation on an ESP32
Update utf8 serial decoder to handle illegal format strings
Remove need for D0_USED_FOR_xx (issue #271)
Clean up setup files
Correct various comment typos
2019-01-06 17:45:06 +00:00
Bodmer 96228cbf44 Add Sprite rotation and examples
Sprites can be rendered rotated with defined pivot points, 3 new
examples have been added "Rotated_Sprite_1/2/3".
The FLASH bitmap example has been moved to the Generic examples folder.
Boundary checks have been added to pushImage()
A new scrolling and wrapping in a Sprite example has been added.
2019-01-06 01:14:10 +00:00
Bodmer e8c201db5e Update touch handler
Added new function that sketch can call to convert raw ADC x and y
values to calibrated screen coordinates:
tft.convertRawXY(&x, &y);

Redunced required number of SPI transfers needed to read raw values.
Changed mode so PENIRQ pin is enabled so users sketch can read this
signal (if needed).

See issue #279.
2019-01-01 23:56:08 +00:00
Bodmer 41dea61bfd Correct #263, add setup file for 160x80 TFT, add invert option
Fixed bug where wrong wodth was returned for 1bpp Sprite
Improved speed for copying a 1bpp Sprite into another 1bpp Sprite (
affects Sprite pushImage() function only)
Added option to setup for colour inversion
2018-11-30 23:27:10 +00:00
Bodmer b0d56ce394 Add ability to scroll 1bpp Sprites
New example added: Sprite_scroll_1bit
2018-11-24 23:30:40 +00:00
Bodmer 98a61058a4 Fix issue #250 2018-11-24 02:38:49 +00:00
Bodmer 1cf2305e4d Add capability to read TFT SDA bi-directional pin
Tested on an ESP32 with ST7789V display
SDA read is very slow on an ESP8266 (to be investigated)
Added new setup #define TFT_SDA_READ
Add new ESP32 and ESP8266 compatible in example/Generic folder to test
capture of TFT screen
2018-11-23 03:09:07 +00:00
Bodmer 7a3d6bcab9 Minor performance improvements for ESP32
Remove legacy changes for double buffered SPI
Eliminate unecessary ESP32 SPI read/modify write
Eliminate two stage control bit changes (may impact some diplays with
setup/hold  timing and show ESP32 hardware register bug?)
Add single register write for CS and DC command
Make setAddrWindow smarter (as used in previous AVR library)
Improve compatibility with GFX sketches
Re-arrange comments slightly to improve positioning
2018-11-14 01:05:16 +00:00
Bodmer 9666314eb6 Support for ESP32 PSRAM added
If PSRAM is fitted and enabled the Sprites are now created in PSRAM.
This makes multiple full screen buffers possible!
2018-10-21 21:22:20 +01:00
Bodmer 1a0b37097a Add new anti-aliased (smooth) font examples + bug fixes
Four new examples have been added to show different methods of rendering
the anta-aliased fonts.  A few minor bugs have been corrected associated
with the font rendering. drawNumber and drawFloat handle fixed width
mono fonts with no digit movement.
2018-10-21 17:53:27 +01:00
Bodmer a9c4351c64 Allow more settle time for raw values read from touch controller 2018-08-26 23:17:58 +01:00
Bodmer 73c1831e7b Add option for a different TFT read SPI frequency
#define SPI_READ_FREQUENCY  20000000 // Optional reduced SPI frequency
for reading TFT

Also weeded out some compiler warnings
2018-07-29 15:00:09 +01:00
Bodmer bdcbca43ec Fix ePaper 1bpp width bug 2018-04-23 20:13:33 +01:00
Bodmer 71c06273c0
Revert "Update Sprite.cpp" 2018-04-12 02:27:22 +01:00
Bodmer bdc9821b7d
Add this-> 2018-04-12 01:55:38 +01:00
rdts 82b749a93a
Update Sprite.cpp
Hi,
I found a bug.

_width and _height need to be initialized properly.

That is because they are used in drawString(). Lines 4118 and 4120 in TFT_eSPI.cpp.
2018-04-11 19:12:33 +02:00
Bodmer f56184e9cd Add diagnostic sketches
Do not load button class is touch screen chip select not defined
2018-04-11 01:03:26 +01:00
Bodmer aa81a4eab8 Correct issue #115 2018-04-06 22:44:31 +01:00
Bodmer ada678d76e Added Waveshare ePaper support
Also added ability to push 1bpp bitmaps to a Sprite to support rendering
images on an EPaper screen.

Floyd-Steinberg dithering and basic graphics example added as first
ePaper demo.
2018-04-02 02:53:42 +01:00
Bodmer d5f0812bbb Fix touch issue #114
Also had to mirror the coordinate transform.
2018-04-01 16:37:53 +01:00
Bodmer 9276b0162d Add support for 1 bit per pixel in Sprite class
This is stage one of support for ePaper displays from Waveshare.
Examples for 1 bit per pixel Sprites and 2 or 3 colour ePaper displays
to follow soon.
2018-03-26 01:02:23 +01:00
Bodmer a00011c2df Add 8 bit parallel TFT support for ESP32
Add interface driver macro
Add 8 bit parallel support
Add 8 bit parallel read support
Add ILI9481, ILI9488 and HX8357D drivers
Update version and ReadMe
Update Create_Font processing sketch
Add slightly narrower alternative font 8
2018-03-10 23:08:57 +00:00
Bodmer 8752236ac2 Add smooth (antialiased) fonts 2018-02-24 19:02:20 +00:00