mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2024-09-21 02:17:13 +00:00
Various updates - raise to version 2.4.43
Sprite class uses TFT_eSPI setBitmapColor - fn deleted Small performance improvement to RP2040 SPI PIO Typo corrections Correct (unused) tft_Write_32 for STM32 Update HX8357D rotation code Enable software reset for ILI9486 Add preliminary RM68120 support
This commit is contained in:
parent
3b63aa9e63
commit
8480f39a9c
@ -335,18 +335,6 @@ int8_t TFT_eSprite::getColorDepth(void)
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************************
|
||||
** Function name: setBitmapColor
|
||||
** Description: Set the 1bpp foreground foreground and background colour
|
||||
***************************************************************************************/
|
||||
void TFT_eSprite::setBitmapColor(uint16_t c, uint16_t b)
|
||||
{
|
||||
if (c == b) b = ~c;
|
||||
_tft->bitmap_fg = c;
|
||||
_tft->bitmap_bg = b;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************************
|
||||
** Function name: setPaletteColor
|
||||
** Description: Set the 4bpp palette color at the given index
|
||||
|
@ -49,9 +49,6 @@ class TFT_eSprite : public TFT_eSPI {
|
||||
// Get the color at the given palette index
|
||||
uint16_t getPaletteColor(uint8_t index);
|
||||
|
||||
// Set foreground and background colours for 1 bit per pixel Sprite
|
||||
void setBitmapColor(uint16_t fg, uint16_t bg);
|
||||
|
||||
void drawPixel(int32_t x, int32_t y, uint32_t color);
|
||||
|
||||
void drawChar(int32_t x, int32_t y, uint16_t c, uint32_t color, uint32_t bg, uint8_t font),
|
||||
|
@ -478,7 +478,7 @@ SPI3_HOST = 2
|
||||
// Write 8 bits
|
||||
#define tft_Write_8(C) TFT_WRITE_BITS((C)<<8, 16)
|
||||
|
||||
// Write 16 bits with corrected endianess for 16 bit colours
|
||||
// Write 16 bits with corrected endianness for 16 bit colours
|
||||
#define tft_Write_16(C) TFT_WRITE_BITS((C)<<8 | (C)>>8, 16)
|
||||
|
||||
// Future option for transfer without wait
|
||||
@ -513,7 +513,7 @@ SPI3_HOST = 2
|
||||
// Write 8 bits
|
||||
#define tft_Write_8(C) TFT_WRITE_BITS(C, 8)
|
||||
|
||||
// Write 16 bits with corrected endianess for 16 bit colours
|
||||
// Write 16 bits with corrected endianness for 16 bit colours
|
||||
#define tft_Write_16(C) TFT_WRITE_BITS((C)<<8 | (C)>>8, 16)
|
||||
|
||||
// Write 16 bits
|
||||
@ -537,7 +537,7 @@ SPI3_HOST = 2
|
||||
// Write 8 bits
|
||||
#define tft_Write_8(C) TFT_WRITE_BITS(C, 8)
|
||||
|
||||
// Write 16 bits with corrected endianess for 16 bit colours
|
||||
// Write 16 bits with corrected endianness for 16 bit colours
|
||||
#define tft_Write_16(C) TFT_WRITE_BITS((C)<<8 | (C)>>8, 16)
|
||||
|
||||
// Future option for transfer without wait
|
||||
|
@ -1010,8 +1010,8 @@
|
||||
HAL_SPI_Transmit(&spiHal, spiBuffer, 2, 10); }
|
||||
|
||||
#define tft_Write_32(C) \
|
||||
{ spiBuffer[1] = ((C)>>24); spiBuffer[3] = ((C)>>16); spiBuffer[5] = ((C)>>8); spiBuffer[7] = C; \
|
||||
HAL_SPI_Transmit(&spiHal, spiBuffer, 8, 10); }
|
||||
{ spiBuffer[0] = (C)>>24; spiBuffer[1] = (C)>>16; spiBuffer[2] = (C)>>8; spiBuffer[3] = C; \
|
||||
HAL_SPI_Transmit(&spiHal, spiBuffer, 4, 10); }
|
||||
|
||||
#define tft_Write_32C(C,D) \
|
||||
{ spiBuffer[1] = ((C)>>8); spiBuffer[3] = (C); spiBuffer[5] = ((D)>>8); spiBuffer[7] = D; \
|
||||
|
@ -16,10 +16,10 @@
|
||||
public start_8:
|
||||
// Pull the next 32 bit value from the TX FIFO.
|
||||
pull side 0
|
||||
// Lose the top 24 bits
|
||||
out null, 24
|
||||
// Lose the top 24 bits, send 1st bit
|
||||
out pins, 25
|
||||
// Now send remaining bits
|
||||
jmp spi_out side 0
|
||||
jmp spi_out side 1
|
||||
|
||||
public set_addr_window:
|
||||
// Loop count in x for caset, paset and ramwr
|
||||
|
@ -22,8 +22,8 @@
|
||||
|
||||
static const uint16_t tft_io_program_instructions[] = {
|
||||
0x90a0, // 0: pull block side 0
|
||||
0x6078, // 1: out null, 24
|
||||
0x101e, // 2: jmp 30 side 0
|
||||
0x6019, // 1: out pins, 25
|
||||
0x181e, // 2: jmp 30 side 1
|
||||
0xf022, // 3: set x, 2 side 0
|
||||
0xe000, // 4: set pins, 0
|
||||
0x90a0, // 5: pull block side 0
|
||||
|
@ -5,22 +5,22 @@
|
||||
switch (rotation) {
|
||||
case 0: // Portrait
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
|
||||
_width = TFT_WIDTH;
|
||||
_height = TFT_HEIGHT;
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 1: // Landscape (Portrait + 90)
|
||||
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
|
||||
_width = TFT_HEIGHT;
|
||||
_height = TFT_WIDTH;
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
case 2: // Inverter portrait
|
||||
writedata(TFT_MAD_COLOR_ORDER);
|
||||
_width = TFT_WIDTH;
|
||||
_height = TFT_HEIGHT;
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 3: // Inverted landscape
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
|
||||
_width = TFT_HEIGHT;
|
||||
_height = TFT_WIDTH;
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
writecommand(0x01); // SW reset
|
||||
delay(120);
|
||||
|
||||
|
||||
writecommand(0x11); // Sleep out, also SW reset
|
||||
delay(120);
|
||||
|
||||
|
36
TFT_eSPI.cpp
36
TFT_eSPI.cpp
@ -737,6 +737,9 @@ void TFT_eSPI::init(uint8_t tc)
|
||||
#elif defined (ILI9225_DRIVER)
|
||||
#include "TFT_Drivers/ILI9225_Init.h"
|
||||
|
||||
#elif defined (RM68120_DRIVER)
|
||||
#include "TFT_Drivers/RM68120_Init.h"
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef TFT_INVERSION_ON
|
||||
@ -825,6 +828,9 @@ void TFT_eSPI::setRotation(uint8_t m)
|
||||
#elif defined (ILI9225_DRIVER)
|
||||
#include "TFT_Drivers/ILI9225_Rotation.h"
|
||||
|
||||
#elif defined (RM68120_DRIVER)
|
||||
#include "TFT_Drivers/RM68120_Rotation.h"
|
||||
|
||||
#endif
|
||||
|
||||
delayMicroseconds(10);
|
||||
@ -889,6 +895,7 @@ void TFT_eSPI::spiwrite(uint8_t c)
|
||||
** Function name: writecommand
|
||||
** Description: Send an 8 bit command to the TFT
|
||||
***************************************************************************************/
|
||||
#ifndef RM68120_DRIVER
|
||||
void TFT_eSPI::writecommand(uint8_t c)
|
||||
{
|
||||
begin_tft_write();
|
||||
@ -902,7 +909,36 @@ void TFT_eSPI::writecommand(uint8_t c)
|
||||
end_tft_write();
|
||||
|
||||
}
|
||||
#else
|
||||
void TFT_eSPI::writecommand(uint16_t c)
|
||||
{
|
||||
begin_tft_write();
|
||||
|
||||
DC_C;
|
||||
|
||||
tft_Write_16(c);
|
||||
|
||||
DC_D;
|
||||
|
||||
end_tft_write();
|
||||
|
||||
}
|
||||
void TFT_eSPI::writeRegister(uint16_t c, uint8_t d)
|
||||
{
|
||||
begin_tft_write();
|
||||
|
||||
DC_C;
|
||||
|
||||
tft_Write_16(c);
|
||||
|
||||
DC_D;
|
||||
|
||||
tft_Write_8(d);
|
||||
|
||||
end_tft_write();
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
/***************************************************************************************
|
||||
** Function name: writedata
|
||||
|
12
TFT_eSPI.h
12
TFT_eSPI.h
@ -16,7 +16,7 @@
|
||||
#ifndef _TFT_eSPIH_
|
||||
#define _TFT_eSPIH_
|
||||
|
||||
#define TFT_ESPI_VERSION "2.4.42"
|
||||
#define TFT_ESPI_VERSION "2.4.43"
|
||||
|
||||
// Bit level feature flags
|
||||
// Bit 0 set: viewport capability
|
||||
@ -620,9 +620,13 @@ class TFT_eSPI : public Print { friend class TFT_eSprite; // Sprite class has ac
|
||||
|
||||
// Low level read/write
|
||||
void spiwrite(uint8_t); // legacy support only
|
||||
|
||||
void writecommand(uint8_t c), // Send a command, function resets DC/RS high ready for data
|
||||
writedata(uint8_t d); // Send data with DC/RS set high
|
||||
#ifndef RM68120_DRIVER
|
||||
void writecommand(uint8_t c); // Send a command, function resets DC/RS high ready for data
|
||||
#else
|
||||
void writecommand(uint16_t c); // Send a command, function resets DC/RS high ready for data
|
||||
void writeRegister(uint16_t c, uint8_t d); // Write data to 16 bit command register
|
||||
#endif
|
||||
void writedata(uint8_t d); // Send data with DC/RS set high
|
||||
|
||||
void commandList(const uint8_t *addr); // Send a initialisation sequence to TFT stored in FLASH
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "TFT_eSPI",
|
||||
"version": "2.4.42",
|
||||
"version": "2.4.43",
|
||||
"keywords": "Arduino, tft, display, ttgo, LilyPi, WT32_SC01, ePaper, display, Pico, RP2040_Nano_Connect, RP2040, STM32, ESP8266, NodeMCU, ESP32, M5Stack, ILI9341, ST7735, ILI9163, S6D02A1, ILI9481, ILI9486, ILI9488, ST7789, ST7796, RM68140, SSD1351, SSD1963, ILI9225, HX8357D, GC9A01, R61581",
|
||||
"description": "A TFT and ePaper SPI graphics library with optimisation for Raspberry Pi Pico, RP2040, ESP8266, ESP32 and STM32",
|
||||
"repository":
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=TFT_eSPI
|
||||
version=2.4.42
|
||||
version=2.4.43
|
||||
author=Bodmer
|
||||
maintainer=Bodmer
|
||||
sentence=TFT graphics library for Arduino processors with performance optimisation for RP2040, STM32, ESP8266 and ESP32
|
||||
|
Loading…
Reference in New Issue
Block a user