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.
This commit is contained in:
Bodmer committed 2020-01-26 21:17:49 +00:00
1 parent b954372859
commit 0e0fd75277
29 files changed
+1267 -797

No files matched your search

+1 -2
View File
@@ -2,9 +2,8 @@
#define RPI_ILI9486_DRIVER // 20MHz maximum SPI
// For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation
#define TFT_CS PIN_D8 // Chip select control pin D8
#define TFT_CS PIN_D2 // Chip select control pin D2
#define TFT_DC PIN_D3 // Data Command control pin
#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
@@ -0,0 +1,52 @@
///////////////////////////////////////////////////
// Setup for Nucleo-F446/767 and ILI9341 display //
///////////////////////////////////////////////////
// See SetupX_Template.h for all options available
// Define STM32 to invoke optimised processor support
#define STM32
// Defining the board allows the library to optimise the performance
// for UNO compatible "MCUfriend" style shields
#define NUCLEO_64_TFT
//#define NUCLEO_144_TFT
// Tell the library to use 8 bit parallel mode(otherwise SPI is assumed)
#define TFT_PARALLEL_8_BIT
// Define the display driver chip type
#define ST7796_DRIVER
//#define ILI9481_DRIVER
// Define the Nucleo 64/144 pins used for the parallel interface TFT
// The pins can be changed here but these are the ones used by the
// common "MCUfriend" shields
#define TFT_CS A3 // Chip select control pin
#define TFT_DC A2 // Data Command control pin
#define TFT_RST A4 // Reset pin
#define TFT_WR A1 // Write strobe control pin
#define TFT_RD A0 // Read pin
#define TFT_D0 D8 // 8 bit parallel bus to TFT
#define TFT_D1 D9
#define TFT_D2 D2
#define TFT_D3 D3
#define TFT_D4 D4
#define TFT_D5 D5
#define TFT_D6 D6
#define TFT_D7 D7
// Fonts to be available
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
// At the moment SMOOTH fonts must be disabled for STM32 processors (due to lack of SPIFFS)
// Support for smooth fonts via SD cards is planned.
//#define SMOOTH_FONT
+62
View File
@@ -0,0 +1,62 @@
///////////////////////////////////////////////////
// Setup for Nucleo-F446/767 and ILI9341 display //
///////////////////////////////////////////////////
// Last update by Bodmer: 14/1/20
// Define STM32 to invoke STM32 optimised driver (optimised fns only tested on STM32F767 so far)
// so you may need to comment this out
#define STM32
// Define the TFT display driver
#define ILI9341_DRIVER
//#define ILI9481_DRIVER
// MOSI and SCK do not need to be defined, connect:
// - Arduino SCK (Blue Pill pin A5) to TFT SCK
// - Arduino MOSI (Blue Pill pin A7) to TFT SDI (may be marked SDA or MOSI)
// - Optional to read TFT: Arduino MISO (Blue Pill pin A6) to TFT SDO (may be marked MISO or may not exist on TFT)
// Note: not all TFT's support reads
// reminder: Blue Pill SPI pins are SCK=A5, MISO = A6, MOSI=A7
// Can use Ardiuno pin references, arbitrary allocation, TFT_eSPI controls chip select
#define TFT_CS A0 // Chip select control pin to TFT CS
#define TFT_DC A1 // Data Command control pin to TFT DC (may be labelled RS = Register Select)
#define TFT_RST A2 // Reset pin to TFT RST (or RESET)
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to processor reset
// Use an Arduino pin for initial testing as connecting to processor reset
// may not work (due to variations in display design)
#define TOUCH_CS A4 // Connect to T_CS (Touch controller chip select) if XPT2046 is connected to SPI bus
// You may need to wire the touch controller to the processor in addition to the TFT
// For example on some boards the pins are labelled:
// T_IRQ - no connection to processor
// T_DO - connect to processor MISO
// T_DIN - connect to processor MOSI
// T_CS - connect to processor pin specified by TOUCH_CS above
// T_SCK - connect to processor SCK
//*
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
//*/
// At the moment SMOOTH fonts MUST be disabled for STM32 processors (due to lack of SPIFFS)
// Support for smooth fonts via SD cards is planned.
//#define SMOOTH_FONT // Must be commented out for STM32
// Assuming the processor clock is 72MHz:
#define SPI_FREQUENCY 36000000 // 36MHz SPI clock
//#define SPI_FREQUENCY 18000000 // 18MHz SPI clock
#define SPI_READ_FREQUENCY 12000000 // Reads need a slower SPI clock
#define SPI_TOUCH_FREQUENCY 2500000 // Must be very slow
// This has no effect, transactions are automatically enabled for STM32
//#define SUPPORT_TRANSACTIONS