Update for spelling etc. in comments!
This commit is contained in:
1 parent
aefcf5af63
commit
d506a3c49d
197 files changed
+1006
-757
No files matched your search
@@ -100,7 +100,7 @@ void TFT_eSPI::end_SDA_Read(void)
|
||||
|
||||
/***************************************************************************************
|
||||
** Function name: read byte - supports class functions
|
||||
** Description: Read a byte from ESP32 8 bit data port
|
||||
** Description: Read a byte from ESP32 8-bit data port
|
||||
***************************************************************************************/
|
||||
// Parallel bus MUST be set to input before calling this function!
|
||||
uint8_t TFT_eSPI::readByte(void)
|
||||
@@ -415,7 +415,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len){
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour
|
||||
#elif defined (SPI_18BIT_DRIVER) // SPI 18-bit colour
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/***************************************************************************************
|
||||
@@ -428,7 +428,7 @@ void TFT_eSPI::pushBlock(uint16_t color, uint32_t len)
|
||||
uint32_t r = (color & 0xF800)>>8;
|
||||
uint32_t g = (color & 0x07E0)<<5;
|
||||
uint32_t b = (color & 0x001F)<<19;
|
||||
// Concatenate 4 pixels into three 32 bit blocks
|
||||
// Concatenate 4 pixels into three 32-bit blocks
|
||||
uint32_t r0 = r<<24 | b | g | r;
|
||||
uint32_t r1 = r0>>8 | g<<16;
|
||||
uint32_t r2 = r1>>8 | b<<8;
|
||||
@@ -512,7 +512,7 @@ void TFT_eSPI::pushSwapBytePixels(const void* data_in, uint32_t len){
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#elif defined (TFT_PARALLEL_8_BIT) // Now the code for ESP32 8 bit parallel
|
||||
#elif defined (TFT_PARALLEL_8_BIT) // Now the code for ESP32 8-bit parallel
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/***************************************************************************************
|
||||
@@ -793,7 +793,7 @@ bool TFT_eSPI::initDMA(bool ctrl_cs)
|
||||
.sclk_io_num = TFT_SCLK,
|
||||
.quadwp_io_num = -1,
|
||||
.quadhd_io_num = -1,
|
||||
#ifdef CONFIG_IDF_TARGET_ESP32S2
|
||||
#ifdef xCONFIG_IDF_TARGET_ESP32S2
|
||||
.data4_io_num = -1,
|
||||
.data5_io_num = -1,
|
||||
.data6_io_num = -1,
|
||||
|
||||
+17
-17
@@ -87,14 +87,14 @@ SPI3_HOST = 2
|
||||
// Initialise processor specific SPI functions, used by init()
|
||||
#define INIT_TFT_DATA_BUS // Not used
|
||||
|
||||
// Define a generic flag for 8 bit parallel
|
||||
// Define a generic flag for 8-bit parallel
|
||||
#if defined (ESP32_PARALLEL) // Specific to ESP32 for backwards compatibility
|
||||
#if !defined (TFT_PARALLEL_8_BIT)
|
||||
#define TFT_PARALLEL_8_BIT // Generic parallel flag
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Ensure ESP32 specific flag is defined for 8 bit parallel
|
||||
// Ensure ESP32 specific flag is defined for 8-bit parallel
|
||||
#if defined (TFT_PARALLEL_8_BIT)
|
||||
#if !defined (ESP32_PARALLEL)
|
||||
#define ESP32_PARALLEL
|
||||
@@ -380,12 +380,12 @@ SPI3_HOST = 2
|
||||
|
||||
#if defined (SSD1963_DRIVER)
|
||||
|
||||
// Write 18 bit color to TFT
|
||||
// Write 18-bit color to TFT
|
||||
#define tft_Write_16(C) GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) (((C) & 0xF800)>> 8)); WR_H; \
|
||||
GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) (((C) & 0x07E0)>> 3)); WR_H; \
|
||||
GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) (((C) & 0x001F)<< 3)); WR_H
|
||||
|
||||
// 18 bit color write with swapped bytes
|
||||
// 18-bit color write with swapped bytes
|
||||
#define tft_Write_16S(C) Cswap = ((C) >>8 | (C) << 8); tft_Write_16(Cswap)
|
||||
|
||||
#else
|
||||
@@ -399,7 +399,7 @@ SPI3_HOST = 2
|
||||
#define tft_Write_16(C) GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 8)); WR_H; \
|
||||
GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 0)); WR_H
|
||||
|
||||
// 16 bit write with swapped bytes
|
||||
// 16-bit write with swapped bytes
|
||||
#define tft_Write_16S(C) GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 0)); WR_H; \
|
||||
GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 8)); WR_H
|
||||
#endif
|
||||
@@ -412,13 +412,13 @@ SPI3_HOST = 2
|
||||
GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 8)); WR_H; \
|
||||
GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 0)); WR_H
|
||||
|
||||
// Write two concatenated 16 bit values to TFT
|
||||
// Write two concatenated 16-bit values to TFT
|
||||
#define tft_Write_32C(C,D) GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 8)); WR_H; \
|
||||
GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 0)); WR_H; \
|
||||
GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((D) >> 8)); WR_H; \
|
||||
GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((D) >> 0)); WR_H
|
||||
|
||||
// Write 16 bit value twice to TFT - used by drawPixel()
|
||||
// Write 16-bit value twice to TFT - used by drawPixel()
|
||||
#define tft_Write_32D(C) GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 8)); WR_H; \
|
||||
GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 0)); WR_H; \
|
||||
GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 8)); WR_H; \
|
||||
@@ -447,12 +447,12 @@ SPI3_HOST = 2
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Macros to write commands/pixel colour data to a SPI ILI948x TFT
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour
|
||||
#elif defined (SPI_18BIT_DRIVER) // SPI 18-bit colour
|
||||
|
||||
// Write 8 bits to TFT
|
||||
#define tft_Write_8(C) spi.transfer(C)
|
||||
|
||||
// Convert 16 bit colour to 18 bit and write in 3 bytes
|
||||
// Convert 16-bit colour to 18-bit and write in 3 bytes
|
||||
#define tft_Write_16(C) spi.transfer(((C) & 0xF800)>>8); \
|
||||
spi.transfer(((C) & 0x07E0)>>3); \
|
||||
spi.transfer(((C) & 0x001F)<<3)
|
||||
@@ -460,7 +460,7 @@ SPI3_HOST = 2
|
||||
// Future option for transfer without wait
|
||||
#define tft_Write_16N(C) tft_Write_16(C)
|
||||
|
||||
// Convert swapped byte 16 bit colour to 18 bit and write in 3 bytes
|
||||
// Convert swapped byte 16-bit colour to 18-bit and write in 3 bytes
|
||||
#define tft_Write_16S(C) spi.transfer((C) & 0xF8); \
|
||||
spi.transfer(((C) & 0xE000)>>11 | ((C) & 0x07)<<5); \
|
||||
spi.transfer(((C) & 0x1F00)>>5)
|
||||
@@ -468,10 +468,10 @@ SPI3_HOST = 2
|
||||
// Write 32 bits to TFT
|
||||
#define tft_Write_32(C) spi.write32(C)
|
||||
|
||||
// Write two concatenated 16 bit values to TFT
|
||||
// Write two concatenated 16-bit values to TFT
|
||||
#define tft_Write_32C(C,D) spi.write32((C)<<16 | (D))
|
||||
|
||||
// Write 16 bit value twice to TFT
|
||||
// Write 16-bit value twice to TFT
|
||||
#define tft_Write_32D(C) spi.write32((C)<<16 | (C))
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -479,7 +479,7 @@ SPI3_HOST = 2
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#elif defined (RPI_DISPLAY_TYPE)
|
||||
|
||||
// ESP32 low level SPI writes for 8, 16 and 32 bit values
|
||||
// ESP32 low level SPI writes for 8, 16 and 32-bit values
|
||||
// to avoid the function call overhead
|
||||
#define TFT_WRITE_BITS(D, B) \
|
||||
WRITE_PERI_REG(SPI_MOSI_DLEN_REG(SPI_PORT), B-1); \
|
||||
@@ -490,7 +490,7 @@ SPI3_HOST = 2
|
||||
// Write 8 bits
|
||||
#define tft_Write_8(C) TFT_WRITE_BITS((C)<<8, 16)
|
||||
|
||||
// Write 16 bits with corrected endianness 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
|
||||
@@ -514,7 +514,7 @@ SPI3_HOST = 2
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#else
|
||||
/* Old macros
|
||||
// ESP32 low level SPI writes for 8, 16 and 32 bit values
|
||||
// ESP32 low level SPI writes for 8, 16 and 32-bit values
|
||||
// to avoid the function call overhead
|
||||
#define TFT_WRITE_BITS(D, B) \
|
||||
WRITE_PERI_REG(SPI_MOSI_DLEN_REG(SPI_PORT), B-1); \
|
||||
@@ -525,7 +525,7 @@ SPI3_HOST = 2
|
||||
// Write 8 bits
|
||||
#define tft_Write_8(C) TFT_WRITE_BITS(C, 8)
|
||||
|
||||
// Write 16 bits with corrected endianness 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
|
||||
@@ -549,7 +549,7 @@ SPI3_HOST = 2
|
||||
// Write 8 bits
|
||||
#define tft_Write_8(C) TFT_WRITE_BITS(C, 8)
|
||||
|
||||
// Write 16 bits with corrected endianness 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
|
||||
|
||||
@@ -93,7 +93,7 @@ void TFT_eSPI::end_SDA_Read(void)
|
||||
|
||||
/***************************************************************************************
|
||||
** Function name: read byte - supports class functions
|
||||
** Description: Read a byte from ESP32 8 bit data port
|
||||
** Description: Read a byte from ESP32 8-bit data port
|
||||
***************************************************************************************/
|
||||
// Parallel bus MUST be set to input before calling this function!
|
||||
uint8_t TFT_eSPI::readByte(void)
|
||||
@@ -436,7 +436,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len){
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour
|
||||
#elif defined (SPI_18BIT_DRIVER) // SPI 18-bit colour
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/***************************************************************************************
|
||||
@@ -449,7 +449,7 @@ void TFT_eSPI::pushBlock(uint16_t color, uint32_t len)
|
||||
uint32_t r = (color & 0xF800)>>8;
|
||||
uint32_t g = (color & 0x07E0)<<5;
|
||||
uint32_t b = (color & 0x001F)<<19;
|
||||
// Concatenate 4 pixels into three 32 bit blocks
|
||||
// Concatenate 4 pixels into three 32-bit blocks
|
||||
uint32_t r0 = r<<24 | b | g | r;
|
||||
uint32_t r1 = r0>>8 | g<<16;
|
||||
uint32_t r2 = r1>>8 | b<<8;
|
||||
@@ -540,7 +540,7 @@ void TFT_eSPI::pushSwapBytePixels(const void* data_in, uint32_t len){
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#elif defined (TFT_PARALLEL_8_BIT) // Now the code for ESP32 8 bit parallel
|
||||
#elif defined (TFT_PARALLEL_8_BIT) // Now the code for ESP32 8-bit parallel
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/***************************************************************************************
|
||||
|
||||
@@ -79,14 +79,14 @@ SPI3_HOST = 2
|
||||
// Initialise processor specific SPI functions, used by init()
|
||||
#define INIT_TFT_DATA_BUS // Not used
|
||||
|
||||
// Define a generic flag for 8 bit parallel
|
||||
// Define a generic flag for 8-bit parallel
|
||||
#if defined (ESP32_PARALLEL) // Specific to ESP32 for backwards compatibility
|
||||
#if !defined (TFT_PARALLEL_8_BIT)
|
||||
#define TFT_PARALLEL_8_BIT // Generic parallel flag
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Ensure ESP32 specific flag is defined for 8 bit parallel
|
||||
// Ensure ESP32 specific flag is defined for 8-bit parallel
|
||||
#if defined (TFT_PARALLEL_8_BIT)
|
||||
#if !defined (ESP32_PARALLEL)
|
||||
#define ESP32_PARALLEL
|
||||
@@ -371,12 +371,12 @@ SPI3_HOST = 2
|
||||
|
||||
#if defined (SSD1963_DRIVER)
|
||||
|
||||
// Write 18 bit color to TFT
|
||||
// Write 18-bit color to TFT
|
||||
#define tft_Write_16(C) GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) (((C) & 0xF800)>> 8)); WR_H; \
|
||||
GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) (((C) & 0x07E0)>> 3)); WR_H; \
|
||||
GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) (((C) & 0x001F)<< 3)); WR_H
|
||||
|
||||
// 18 bit color write with swapped bytes
|
||||
// 18-bit color write with swapped bytes
|
||||
#define tft_Write_16S(C) Cswap = ((C) >>8 | (C) << 8); tft_Write_16(Cswap)
|
||||
|
||||
#else
|
||||
@@ -390,7 +390,7 @@ SPI3_HOST = 2
|
||||
#define tft_Write_16(C) GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((C) >> 8)); WR_H; \
|
||||
GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((C) >> 0)); WR_H
|
||||
|
||||
// 16 bit write with swapped bytes
|
||||
// 16-bit write with swapped bytes
|
||||
#define tft_Write_16S(C) GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((C) >> 0)); WR_H; \
|
||||
GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((C) >> 8)); WR_H
|
||||
#endif
|
||||
@@ -403,13 +403,13 @@ SPI3_HOST = 2
|
||||
GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((C) >> 8)); WR_H; \
|
||||
GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((C) >> 0)); WR_H
|
||||
|
||||
// Write two concatenated 16 bit values to TFT
|
||||
// Write two concatenated 16-bit values to TFT
|
||||
#define tft_Write_32C(C,D) GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((C) >> 8)); WR_H; \
|
||||
GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((C) >> 0)); WR_H; \
|
||||
GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((D) >> 8)); WR_H; \
|
||||
GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((D) >> 0)); WR_H
|
||||
|
||||
// Write 16 bit value twice to TFT - used by drawPixel()
|
||||
// Write 16-bit value twice to TFT - used by drawPixel()
|
||||
#define tft_Write_32D(C) GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((C) >> 8)); WR_H; \
|
||||
GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((C) >> 0)); WR_H; \
|
||||
GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((C) >> 8)); WR_H; \
|
||||
@@ -438,12 +438,12 @@ SPI3_HOST = 2
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Macros to write commands/pixel colour data to a SPI ILI948x TFT
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour
|
||||
#elif defined (SPI_18BIT_DRIVER) // SPI 18-bit colour
|
||||
|
||||
// Write 8 bits to TFT
|
||||
#define tft_Write_8(C) spi.transfer(C)
|
||||
|
||||
// Convert 16 bit colour to 18 bit and write in 3 bytes
|
||||
// Convert 16-bit colour to 18-bit and write in 3 bytes
|
||||
#define tft_Write_16(C) spi.transfer(((C) & 0xF800)>>8); \
|
||||
spi.transfer(((C) & 0x07E0)>>3); \
|
||||
spi.transfer(((C) & 0x001F)<<3)
|
||||
@@ -451,7 +451,7 @@ SPI3_HOST = 2
|
||||
// Future option for transfer without wait
|
||||
#define tft_Write_16N(C) tft_Write_16(C)
|
||||
|
||||
// Convert swapped byte 16 bit colour to 18 bit and write in 3 bytes
|
||||
// Convert swapped byte 16-bit colour to 18-bit and write in 3 bytes
|
||||
#define tft_Write_16S(C) spi.transfer((C) & 0xF8); \
|
||||
spi.transfer(((C) & 0xE000)>>11 | ((C) & 0x07)<<5); \
|
||||
spi.transfer(((C) & 0x1F00)>>5)
|
||||
@@ -459,10 +459,10 @@ SPI3_HOST = 2
|
||||
// Write 32 bits to TFT
|
||||
#define tft_Write_32(C) spi.write32(C)
|
||||
|
||||
// Write two concatenated 16 bit values to TFT
|
||||
// Write two concatenated 16-bit values to TFT
|
||||
#define tft_Write_32C(C,D) spi.write32((C)<<16 | (D))
|
||||
|
||||
// Write 16 bit value twice to TFT
|
||||
// Write 16-bit value twice to TFT
|
||||
#define tft_Write_32D(C) spi.write32((C)<<16 | (C))
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -470,7 +470,7 @@ SPI3_HOST = 2
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#elif defined (RPI_DISPLAY_TYPE)
|
||||
|
||||
// ESP32 low level SPI writes for 8, 16 and 32 bit values
|
||||
// ESP32 low level SPI writes for 8, 16 and 32-bit values
|
||||
// to avoid the function call overhead
|
||||
#define TFT_WRITE_BITS(D, B) \
|
||||
WRITE_PERI_REG(SPI_MOSI_DLEN_REG(SPI_PORT), B-1); \
|
||||
@@ -481,7 +481,7 @@ SPI3_HOST = 2
|
||||
// Write 8 bits
|
||||
#define tft_Write_8(C) TFT_WRITE_BITS((C)<<8, 16)
|
||||
|
||||
// Write 16 bits with corrected endianness 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
|
||||
@@ -505,7 +505,7 @@ SPI3_HOST = 2
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#else
|
||||
/* Old macros
|
||||
// ESP32 low level SPI writes for 8, 16 and 32 bit values
|
||||
// ESP32 low level SPI writes for 8, 16 and 32-bit values
|
||||
// to avoid the function call overhead
|
||||
#define TFT_WRITE_BITS(D, B) \
|
||||
WRITE_PERI_REG(SPI_MOSI_DLEN_REG(SPI_PORT), B-1); \
|
||||
@@ -516,7 +516,7 @@ SPI3_HOST = 2
|
||||
// Write 8 bits
|
||||
#define tft_Write_8(C) TFT_WRITE_BITS(C, 8)
|
||||
|
||||
// Write 16 bits with corrected endianness 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
|
||||
@@ -548,7 +548,7 @@ SPI3_HOST = 2
|
||||
// Write 8 bits
|
||||
#define tft_Write_8(C) TFT_WRITE_BITS(C, 8)
|
||||
|
||||
// Write 16 bits with corrected endianness 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
|
||||
|
||||
@@ -84,7 +84,7 @@ void TFT_eSPI::end_SDA_Read(void)
|
||||
|
||||
/***************************************************************************************
|
||||
** Function name: read byte - supports class functions
|
||||
** Description: Read a byte from ESP32 8 bit data port
|
||||
** Description: Read a byte from ESP32 8-bit data port
|
||||
***************************************************************************************/
|
||||
// Parallel bus MUST be set to input before calling this function!
|
||||
uint8_t TFT_eSPI::readByte(void)
|
||||
@@ -426,7 +426,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len){
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour
|
||||
#elif defined (SPI_18BIT_DRIVER) // SPI 18-bit colour
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/***************************************************************************************
|
||||
@@ -439,7 +439,7 @@ void TFT_eSPI::pushBlock(uint16_t color, uint32_t len)
|
||||
uint32_t r = (color & 0xF800)>>8;
|
||||
uint32_t g = (color & 0x07E0)<<5;
|
||||
uint32_t b = (color & 0x001F)<<19;
|
||||
// Concatenate 4 pixels into three 32 bit blocks
|
||||
// Concatenate 4 pixels into three 32-bit blocks
|
||||
uint32_t r0 = r<<24 | b | g | r;
|
||||
uint32_t r1 = r0>>8 | g<<16;
|
||||
uint32_t r2 = r1>>8 | b<<8;
|
||||
@@ -530,7 +530,7 @@ void TFT_eSPI::pushSwapBytePixels(const void* data_in, uint32_t len){
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#elif defined (TFT_PARALLEL_8_BIT) // Now the code for ESP32 8 bit parallel
|
||||
#elif defined (TFT_PARALLEL_8_BIT) // Now the code for ESP32 8-bit parallel
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/***************************************************************************************
|
||||
@@ -646,7 +646,7 @@ void TFT_eSPI::pushPixelsDMA(uint16_t* image, uint32_t len)
|
||||
// of 32768 pixels maximum. (equivalent to an area of ~320 x 100 pixels)
|
||||
bool temp = _swapBytes;
|
||||
_swapBytes = false;
|
||||
while(len>0x4000) { // Transfer 16 bit pixels in blocks if len*2 over 65536 bytes
|
||||
while(len>0x4000) { // Transfer 16-bit pixels in blocks if len*2 over 65536 bytes
|
||||
pushPixels(image, 0x400);
|
||||
len -= 0x400; image+= 0x400; // Arbitrarily send 1K pixel blocks (2Kbytes)
|
||||
}
|
||||
@@ -690,7 +690,7 @@ void TFT_eSPI::pushImageDMA(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t
|
||||
// of 32768 pixels maximum. (equivalent to an area of ~320 x 100 pixels)
|
||||
bool temp = _swapBytes;
|
||||
_swapBytes = false;
|
||||
while(len>0x4000) { // Transfer 16 bit pixels in blocks if len*2 over 65536 bytes
|
||||
while(len>0x4000) { // Transfer 16-bit pixels in blocks if len*2 over 65536 bytes
|
||||
pushPixels(buffer, 0x400);
|
||||
len -= 0x400; buffer+= 0x400; // Arbitrarily send 1K pixel blocks (2Kbytes)
|
||||
}
|
||||
@@ -778,7 +778,7 @@ void TFT_eSPI::pushImageDMA(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t
|
||||
// of 32768 pixels maximum. (equivalent to an area of ~320 x 100 pixels)
|
||||
bool temp = _swapBytes;
|
||||
_swapBytes = false;
|
||||
while(len>0x4000) { // Transfer 16 bit pixels in blocks if len*2 over 65536 bytes
|
||||
while(len>0x4000) { // Transfer 16-bit pixels in blocks if len*2 over 65536 bytes
|
||||
pushPixels(buffer, 0x400);
|
||||
len -= 0x400; buffer+= 0x400; // Arbitrarily send 1K pixel blocks (2Kbytes)
|
||||
}
|
||||
|
||||
@@ -93,14 +93,14 @@ SPI3_HOST = 2
|
||||
// Initialise processor specific SPI functions, used by init()
|
||||
#define INIT_TFT_DATA_BUS // Not used
|
||||
|
||||
// Define a generic flag for 8 bit parallel
|
||||
// Define a generic flag for 8-bit parallel
|
||||
#if defined (ESP32_PARALLEL) // Specific to ESP32 for backwards compatibility
|
||||
#if !defined (TFT_PARALLEL_8_BIT)
|
||||
#define TFT_PARALLEL_8_BIT // Generic parallel flag
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Ensure ESP32 specific flag is defined for 8 bit parallel
|
||||
// Ensure ESP32 specific flag is defined for 8-bit parallel
|
||||
#if defined (TFT_PARALLEL_8_BIT)
|
||||
#if !defined (ESP32_PARALLEL)
|
||||
#define ESP32_PARALLEL
|
||||
@@ -414,12 +414,12 @@ SPI3_HOST = 2
|
||||
|
||||
#if defined (SSD1963_DRIVER)
|
||||
|
||||
// Write 18 bit color to TFT
|
||||
// Write 18-bit color to TFT
|
||||
#define tft_Write_16(C) GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) (((C) & 0xF800)>> 8)); WR_H; \
|
||||
GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) (((C) & 0x07E0)>> 3)); WR_H; \
|
||||
GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) (((C) & 0x001F)<< 3)); WR_H
|
||||
|
||||
// 18 bit color write with swapped bytes
|
||||
// 18-bit color write with swapped bytes
|
||||
#define tft_Write_16S(C) Cswap = ((C) >>8 | (C) << 8); tft_Write_16(Cswap)
|
||||
|
||||
#else
|
||||
@@ -433,7 +433,7 @@ SPI3_HOST = 2
|
||||
#define tft_Write_16(C) GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H; \
|
||||
GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 0)); WR_H
|
||||
|
||||
// 16 bit write with swapped bytes
|
||||
// 16-bit write with swapped bytes
|
||||
#define tft_Write_16S(C) GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 0)); WR_H; \
|
||||
GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H
|
||||
#endif
|
||||
@@ -446,13 +446,13 @@ SPI3_HOST = 2
|
||||
GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H; \
|
||||
GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 0)); WR_H
|
||||
|
||||
// Write two concatenated 16 bit values to TFT
|
||||
// Write two concatenated 16-bit values to TFT
|
||||
#define tft_Write_32C(C,D) GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H; \
|
||||
GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 0)); WR_H; \
|
||||
GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((D) >> 8)); WR_H; \
|
||||
GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((D) >> 0)); WR_H
|
||||
|
||||
// Write 16 bit value twice to TFT - used by drawPixel()
|
||||
// Write 16-bit value twice to TFT - used by drawPixel()
|
||||
#define tft_Write_32D(C) GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H; \
|
||||
GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 0)); WR_H; \
|
||||
GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H; \
|
||||
@@ -481,12 +481,12 @@ SPI3_HOST = 2
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Macros to write commands/pixel colour data to a SPI ILI948x TFT
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour
|
||||
#elif defined (SPI_18BIT_DRIVER) // SPI 18-bit colour
|
||||
|
||||
// Write 8 bits to TFT
|
||||
#define tft_Write_8(C) spi.transfer(C)
|
||||
|
||||
// Convert 16 bit colour to 18 bit and write in 3 bytes
|
||||
// Convert 16-bit colour to 18-bit and write in 3 bytes
|
||||
#define tft_Write_16(C) spi.transfer(((C) & 0xF800)>>8); \
|
||||
spi.transfer(((C) & 0x07E0)>>3); \
|
||||
spi.transfer(((C) & 0x001F)<<3)
|
||||
@@ -494,7 +494,7 @@ SPI3_HOST = 2
|
||||
// Future option for transfer without wait
|
||||
#define tft_Write_16N(C) tft_Write_16(C)
|
||||
|
||||
// Convert swapped byte 16 bit colour to 18 bit and write in 3 bytes
|
||||
// Convert swapped byte 16-bit colour to 18-bit and write in 3 bytes
|
||||
#define tft_Write_16S(C) spi.transfer((C) & 0xF8); \
|
||||
spi.transfer(((C) & 0xE000)>>11 | ((C) & 0x07)<<5); \
|
||||
spi.transfer(((C) & 0x1F00)>>5)
|
||||
@@ -502,17 +502,17 @@ SPI3_HOST = 2
|
||||
// Write 32 bits to TFT
|
||||
#define tft_Write_32(C) spi.write32(C)
|
||||
|
||||
// Write two concatenated 16 bit values to TFT
|
||||
// Write two concatenated 16-bit values to TFT
|
||||
#define tft_Write_32C(C,D) spi.write32((C)<<16 | (D))
|
||||
|
||||
// Write 16 bit value twice to TFT
|
||||
// Write 16-bit value twice to TFT
|
||||
#define tft_Write_32D(C) spi.write32((C)<<16 | (C))
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Macros to write commands/pixel colour data to an Raspberry Pi TFT
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#elif defined (RPI_DISPLAY_TYPE)
|
||||
// ESP32-S3 low level SPI writes for 8, 16 and 32 bit values
|
||||
// ESP32-S3 low level SPI writes for 8, 16 and 32-bit values
|
||||
// to avoid the function call overhead
|
||||
#define TFT_WRITE_BITS(D, B) *_spi_mosi_dlen = B-1; \
|
||||
*_spi_w = D; \
|
||||
@@ -524,7 +524,7 @@ SPI3_HOST = 2
|
||||
// Write 8 bits
|
||||
#define tft_Write_8(C) TFT_WRITE_BITS((C)<<8, 16)
|
||||
|
||||
// Write 16 bits with corrected endianness 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
|
||||
@@ -563,7 +563,7 @@ SPI3_HOST = 2
|
||||
// Write 8 bits
|
||||
#define tft_Write_8(C) TFT_WRITE_BITS(C, 8)
|
||||
|
||||
// Write 16 bits with corrected endianness 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
|
||||
|
||||
@@ -109,7 +109,7 @@ void TFT_eSPI::pushSwapBytePixels(const void* data_in, uint32_t len){
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour
|
||||
#elif defined (SPI_18BIT_DRIVER) // SPI 18-bit colour
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/***************************************************************************************
|
||||
@@ -122,7 +122,7 @@ void TFT_eSPI::pushBlock(uint16_t color, uint32_t len)
|
||||
uint8_t r = (color & 0xF800)>>8;
|
||||
uint8_t g = (color & 0x07E0)>>3;
|
||||
uint8_t b = (color & 0x001F)<<3;
|
||||
// Concatenate 4 pixels into three 32 bit blocks
|
||||
// Concatenate 4 pixels into three 32-bit blocks
|
||||
uint32_t r0 = r<<24 | b<<16 | g<<8 | r;
|
||||
uint32_t r1 = g<<24 | r<<16 | b<<8 | g;
|
||||
uint32_t r2 = b<<24 | g<<16 | r<<8 | b;
|
||||
|
||||
@@ -117,17 +117,17 @@
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Macros to write commands/pixel colour data to a SPI ILI948x TFT
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#if defined (SPI_18BIT_DRIVER) // SPI 18 bit colour
|
||||
#if defined (SPI_18BIT_DRIVER) // SPI 18-bit colour
|
||||
|
||||
// Write 8 bits to TFT
|
||||
#define tft_Write_8(C) spi.transfer(C)
|
||||
|
||||
// Convert 16 bit colour to 18 bit and write in 3 bytes
|
||||
// Convert 16-bit colour to 18-bit and write in 3 bytes
|
||||
#define tft_Write_16(C) spi.transfer(((C) & 0xF800)>>8); \
|
||||
spi.transfer(((C) & 0x07E0)>>3); \
|
||||
spi.transfer(((C) & 0x001F)<<3)
|
||||
|
||||
// Convert swapped byte 16 bit colour to 18 bit and write in 3 bytes
|
||||
// Convert swapped byte 16-bit colour to 18-bit and write in 3 bytes
|
||||
#define tft_Write_16S(C) spi.transfer((C) & 0xF8); \
|
||||
spi.transfer(((C) & 0xE000)>>11 | ((C) & 0x07)<<5); \
|
||||
spi.transfer(((C) & 0x1F00)>>5)
|
||||
@@ -148,7 +148,7 @@
|
||||
// Command is 16 bits
|
||||
#define CMD_BITS 16
|
||||
|
||||
// ESP8266 low level SPI writes for 8, 16 and 32 bit values
|
||||
// ESP8266 low level SPI writes for 8, 16 and 32-bit values
|
||||
// to avoid the function call overhead
|
||||
#define TFT_WRITE_BITS(D, B) \
|
||||
SPI1U1 = ((B-1) << SPILMOSI); \
|
||||
|
||||
@@ -172,7 +172,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len)
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour
|
||||
#elif defined (SPI_18BIT_DRIVER) // SPI 18-bit colour
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/***************************************************************************************
|
||||
@@ -216,7 +216,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len){
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#else // Standard SPI 16 bit colour TFT
|
||||
#else // Standard SPI 16-bit colour TFT
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/***************************************************************************************
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
// This is a generic driver for Arduino boards, it supports SPI interface displays
|
||||
// 8 bit parallel interface to TFT is not supported for generic processors
|
||||
// 8-bit parallel interface to TFT is not supported for generic processors
|
||||
|
||||
#ifndef _TFT_eSPI_GENERICH_
|
||||
#define _TFT_eSPI_GENERICH_
|
||||
@@ -94,17 +94,17 @@
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Macros to write commands/pixel colour data to a SPI ILI948x TFT
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#if defined (SPI_18BIT_DRIVER) // SPI 18 bit colour
|
||||
#if defined (SPI_18BIT_DRIVER) // SPI 18-bit colour
|
||||
|
||||
// Write 8 bits to TFT
|
||||
#define tft_Write_8(C) spi.transfer(C)
|
||||
|
||||
// Convert 16 bit colour to 18 bit and write in 3 bytes
|
||||
// Convert 16-bit colour to 18-bit and write in 3 bytes
|
||||
#define tft_Write_16(C) spi.transfer(((C) & 0xF800)>>8); \
|
||||
spi.transfer(((C) & 0x07E0)>>3); \
|
||||
spi.transfer(((C) & 0x001F)<<3)
|
||||
|
||||
// Convert swapped byte 16 bit colour to 18 bit and write in 3 bytes
|
||||
// Convert swapped byte 16-bit colour to 18-bit and write in 3 bytes
|
||||
#define tft_Write_16S(C) spi.transfer((C) & 0xF8); \
|
||||
spi.transfer(((C) & 0xE000)>>11 | ((C) & 0x07)<<5); \
|
||||
spi.transfer(((C) & 0x1F00)>>5)
|
||||
@@ -121,7 +121,7 @@
|
||||
// Macros to write commands/pixel colour data to other displays
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#else
|
||||
#if defined (RPI_DISPLAY_TYPE) // RPi TFT type always needs 16 bit transfers
|
||||
#if defined (RPI_DISPLAY_TYPE) // RPi TFT type always needs 16-bit transfers
|
||||
#define tft_Write_8(C) spi.transfer(C); spi.transfer(C)
|
||||
#define tft_Write_16(C) spi.transfer((uint8_t)((C)>>8));spi.transfer((uint8_t)((C)>>0))
|
||||
#define tft_Write_16S(C) spi.transfer((uint8_t)((C)>>0));spi.transfer((uint8_t)((C)>>8))
|
||||
@@ -143,7 +143,7 @@
|
||||
spi.transfer(0); spi.transfer((C)>>0)
|
||||
|
||||
#else
|
||||
#ifdef __AVR__ // AVR processors do not have 16 bit transfer
|
||||
#ifdef __AVR__ // AVR processors do not have 16-bit transfer
|
||||
#define tft_Write_8(C) {SPDR=(C); while (!(SPSR&_BV(SPIF)));}
|
||||
#define tft_Write_16(C) tft_Write_8((uint8_t)((C)>>8));tft_Write_8((uint8_t)((C)>>0))
|
||||
#define tft_Write_16S(C) tft_Write_8((uint8_t)((C)>>0));tft_Write_8((uint8_t)((C)>>8))
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#ifdef RP2040_PIO_SPI
|
||||
#if defined (SPI_18BIT_DRIVER)
|
||||
// SPI PIO code for 18 bit colour transmit
|
||||
// SPI PIO code for 18-bit colour transmit
|
||||
#include "pio_SPI_18bit.pio.h"
|
||||
#else
|
||||
// SPI PIO code for 16-bit colour transmit
|
||||
@@ -30,7 +30,7 @@
|
||||
#endif
|
||||
#elif defined (TFT_PARALLEL_8_BIT)
|
||||
#if defined (SSD1963_DRIVER)
|
||||
// PIO code for 8-bit parallel interface (18 bit colour)
|
||||
// PIO code for 8-bit parallel interface (18-bit colour)
|
||||
#include "pio_8bit_parallel_18bpp.pio.h"
|
||||
#else
|
||||
// PIO code for 8-bit parallel interface (16-bit colour)
|
||||
@@ -458,7 +458,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len)
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour
|
||||
#elif defined (SPI_18BIT_DRIVER) // SPI 18-bit colour
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/***************************************************************************************
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
// This is a generic driver for Arduino boards, it supports SPI interface displays
|
||||
// 8 bit parallel interface to TFT is not supported for generic processors
|
||||
// 8-bit parallel interface to TFT is not supported for generic processors
|
||||
|
||||
#ifndef _TFT_eSPI_RP2040H_
|
||||
#define _TFT_eSPI_RP2040H_
|
||||
@@ -72,8 +72,8 @@
|
||||
|
||||
#if !defined (RP2040_PIO_INTERFACE) // SPI
|
||||
|
||||
#if defined (MHS_DISPLAY_TYPE) // High speed RPi TFT type always needs 16 bit transfers
|
||||
// This swaps to 16 bit mode, used for commands so wait avoids clash with DC timing
|
||||
#if defined (MHS_DISPLAY_TYPE) // High speed RPi TFT type always needs 16-bit transfers
|
||||
// This swaps to 16-bit mode, used for commands so wait avoids clash with DC timing
|
||||
#define INIT_TFT_DATA_BUS hw_write_masked(&spi_get_hw(SPI_X)->cr0, (16 - 1) << SPI_SSPCR0_DSS_LSB, SPI_SSPCR0_DSS_BITS)
|
||||
#else
|
||||
// Initialise processor specific SPI functions, used by init()
|
||||
@@ -114,7 +114,7 @@
|
||||
#define DIV_UNITS 3 // 96ns write cycle time
|
||||
#endif
|
||||
#define DIV_FRACT 0
|
||||
#else // 8 bit parallel mode default 64ns write cycle time
|
||||
#else // 8-bit parallel mode default 64ns write cycle time
|
||||
#define DIV_UNITS 2
|
||||
#define DIV_FRACT 0 // Note: Fractional values done with clock period dithering
|
||||
#endif
|
||||
@@ -166,10 +166,10 @@
|
||||
tft_pio->sm[pio_sm].instr = pio_instr_clr_dc
|
||||
|
||||
#ifndef RM68120_DRIVER
|
||||
// Flush has happened before this and mode changed back to 16 bit
|
||||
// Flush has happened before this and mode changed back to 16-bit
|
||||
#define DC_D tft_pio->sm[pio_sm].instr = pio_instr_set_dc
|
||||
#else
|
||||
// Need to wait for stall since RM68120 commands are 16 bit
|
||||
// Need to wait for stall since RM68120 commands are 16-bit
|
||||
#define DC_D WAIT_FOR_STALL; tft_pio->sm[pio_sm].instr = pio_instr_set_dc
|
||||
#endif
|
||||
#endif
|
||||
@@ -257,7 +257,7 @@
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#if !defined (RP2040_PIO_INTERFACE) // SPI
|
||||
|
||||
#if defined (SPI_18BIT_DRIVER) // SPI 18 bit colour
|
||||
#if defined (SPI_18BIT_DRIVER) // SPI 18-bit colour
|
||||
|
||||
// Write 8 bits to TFT
|
||||
#define tft_Write_8(C) spi_get_hw(SPI_X)->dr = (uint32_t)(C); \
|
||||
@@ -267,17 +267,17 @@
|
||||
#define tft_Write_8N(B) while (!spi_is_writable(SPI_X)){}; \
|
||||
spi_get_hw(SPI_X)->dr = (uint8_t)(B)
|
||||
|
||||
// Convert 16 bit colour to 18 bit and write in 3 bytes
|
||||
// Convert 16-bit colour to 18-bit and write in 3 bytes
|
||||
#define tft_Write_16(C) tft_Write_8N(((C) & 0xF800)>>8); \
|
||||
tft_Write_8N(((C) & 0x07E0)>>3); \
|
||||
tft_Write_8N(((C) & 0x001F)<<3)
|
||||
|
||||
// Convert 16 bit colour to 18 bit and write in 3 bytes
|
||||
// Convert 16-bit colour to 18-bit and write in 3 bytes
|
||||
#define tft_Write_16N(C) tft_Write_8N(((C) & 0xF800)>>8); \
|
||||
tft_Write_8N(((C) & 0x07E0)>>3); \
|
||||
tft_Write_8N(((C) & 0x001F)<<3)
|
||||
|
||||
// Convert swapped byte 16 bit colour to 18 bit and write in 3 bytes
|
||||
// Convert swapped byte 16-bit colour to 18-bit and write in 3 bytes
|
||||
#define tft_Write_16S(C) tft_Write_8N((C) & 0xF8); \
|
||||
tft_Write_8N(((C) & 0xE000)>>11 | ((C) & 0x07)<<5); \
|
||||
tft_Write_8N(((C) & 0x1F00)>>5)
|
||||
@@ -303,8 +303,8 @@
|
||||
// Macros to write commands/pixel colour data to other displays
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#else
|
||||
#if defined (MHS_DISPLAY_TYPE) // High speed RPi TFT type always needs 16 bit transfers
|
||||
// This swaps to 16 bit mode, used for commands so wait avoids clash with DC timing
|
||||
#if defined (MHS_DISPLAY_TYPE) // High speed RPi TFT type always needs 16-bit transfers
|
||||
// This swaps to 16-bit mode, used for commands so wait avoids clash with DC timing
|
||||
#define tft_Write_8(C) while (spi_get_hw(SPI_X)->sr & SPI_SSPSR_BSY_BITS) {}; \
|
||||
hw_write_masked(&spi_get_hw(SPI_X)->cr0, (16 - 1) << SPI_SSPCR0_DSS_LSB, SPI_SSPCR0_DSS_BITS); \
|
||||
spi_get_hw(SPI_X)->dr = (uint32_t)((C) | ((C)<<8)); \
|
||||
@@ -324,7 +324,7 @@
|
||||
|
||||
#define tft_Write_32D(C) spi_get_hw(SPI_X)->dr = (uint32_t)(C); spi_get_hw(SPI_X)->dr = (uint32_t)(C)
|
||||
|
||||
#elif defined (RPI_DISPLAY_TYPE) // RPi TFT type always needs 16 bit transfers
|
||||
#elif defined (RPI_DISPLAY_TYPE) // RPi TFT type always needs 16-bit transfers
|
||||
#define tft_Write_8(C) spi.transfer(C); spi.transfer(C)
|
||||
#define tft_Write_16(C) spi.transfer((uint8_t)((C)>>8));spi.transfer((uint8_t)((C)>>0))
|
||||
#define tft_Write_16N(C) spi.transfer((uint8_t)((C)>>8));spi.transfer((uint8_t)((C)>>0))
|
||||
@@ -348,7 +348,7 @@
|
||||
|
||||
#elif defined (ILI9225_DRIVER) // Needs gaps between commands + data bytes, so use slower transfer functions
|
||||
|
||||
// Warning: these all end in 8 bit SPI mode!
|
||||
// Warning: these all end in 8-bit SPI mode!
|
||||
#define tft_Write_8(C) spi.transfer(C);
|
||||
|
||||
#define tft_Write_16(C) spi.transfer16(C)
|
||||
@@ -365,7 +365,7 @@
|
||||
|
||||
#else
|
||||
|
||||
// This swaps to 8 bit mode, then back to 16 bit mode
|
||||
// This swaps to 8-bit mode, then back to 16-bit mode
|
||||
#define tft_Write_8(C) while (spi_get_hw(SPI_X)->sr & SPI_SSPSR_BSY_BITS) {}; \
|
||||
hw_write_masked(&spi_get_hw(SPI_X)->cr0, (8 - 1) << SPI_SSPCR0_DSS_LSB, SPI_SSPCR0_DSS_BITS); \
|
||||
spi_get_hw(SPI_X)->dr = (uint32_t)(C); \
|
||||
@@ -389,7 +389,7 @@
|
||||
#endif // RPI_DISPLAY_TYPE
|
||||
#endif
|
||||
|
||||
#else // Parallel 8 bit or PIO SPI
|
||||
#else // Parallel 8-bit or PIO SPI
|
||||
|
||||
// Wait for the PIO to stall (SM pull request finds no data in TX FIFO)
|
||||
// This is used to detect when the SM is idle and hence ready for a jump instruction
|
||||
@@ -413,15 +413,15 @@
|
||||
// Temporary - to be deleted
|
||||
#define GPIO_DIR_MASK 0
|
||||
|
||||
#if defined (SPI_18BIT_DRIVER) || defined (SSD1963_DRIVER) // 18 bit colour (3 bytes)
|
||||
// This writes 8 bits, then switches back to 16 bit mode automatically
|
||||
#if defined (SPI_18BIT_DRIVER) || defined (SSD1963_DRIVER) // 18-bit colour (3 bytes)
|
||||
// This writes 8 bits, then switches back to 16-bit mode automatically
|
||||
// Have already waited for pio stalled (last data write complete) when DC switched to command mode
|
||||
// The wait for stall allows DC to be changed immediately afterwards
|
||||
#define tft_Write_8(C) tft_pio->sm[pio_sm].instr = pio_instr_jmp8; \
|
||||
TX_FIFO = (C); \
|
||||
WAIT_FOR_STALL
|
||||
|
||||
// Used to send last byte for 32 bit macros below since PIO sends 24 bits
|
||||
// Used to send last byte for 32-bit macros below since PIO sends 24 bits
|
||||
#define tft_Write_8L(C) WAIT_FOR_STALL; \
|
||||
tft_pio->sm[pio_sm].instr = pio_instr_jmp8; \
|
||||
TX_FIFO = (C)
|
||||
@@ -441,14 +441,14 @@
|
||||
#define tft_Write_32D(C) WAIT_FOR_FIFO_FREE(2); TX_FIFO = (((C)<<8) | ((C)>>8)); tft_Write_8L(C)
|
||||
|
||||
#else // PIO interface, SPI or parallel
|
||||
// This writes 8 bits, then switches back to 16 bit mode automatically
|
||||
// This writes 8 bits, then switches back to 16-bit mode automatically
|
||||
// Have already waited for pio stalled (last data write complete) when DC switched to command mode
|
||||
// The wait for stall allows DC to be changed immediately afterwards
|
||||
#if defined (TFT_PARALLEL_8_BIT) || defined (RP2040_PIO_SPI)
|
||||
#define tft_Write_8(C) tft_pio->sm[pio_sm].instr = pio_instr_jmp8; \
|
||||
TX_FIFO = (C); \
|
||||
WAIT_FOR_STALL
|
||||
#else // For 16 bit parallel 16 bits are always sent
|
||||
#else // For 16-bit parallel 16 bits are always sent
|
||||
#define tft_Write_8(C) TX_FIFO = (C); \
|
||||
WAIT_FOR_STALL
|
||||
#endif
|
||||
|
||||
@@ -76,7 +76,7 @@ void TFT_eSPI::end_SDA_Read(void)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#if defined (TFT_PARALLEL_8_BIT) // Code for STM32 8 bit parallel
|
||||
#if defined (TFT_PARALLEL_8_BIT) // Code for STM32 8-bit parallel
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/***************************************************************************************
|
||||
@@ -286,7 +286,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len)
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour
|
||||
#elif defined (SPI_18BIT_DRIVER) // SPI 18-bit colour
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/***************************************************************************************
|
||||
@@ -356,7 +356,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len)
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#else // Standard SPI 16 bit colour TFT All Tested
|
||||
#else // Standard SPI 16-bit colour TFT All Tested
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/***************************************************************************************
|
||||
@@ -405,7 +405,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len)
|
||||
else {
|
||||
// HAL byte count for transmit is only 16 bits maximum so to avoid this constraint
|
||||
// transfers of small blocks are performed until HAL capacity is reached.
|
||||
while(len>0x7FFF) { // Transfer 16 bit pixels in blocks if len*2 over 65534 bytes
|
||||
while(len>0x7FFF) { // Transfer 16-bit pixels in blocks if len*2 over 65534 bytes
|
||||
HAL_SPI_Transmit(&spiHal, (uint8_t*)data, 0x800<<1, HAL_MAX_DELAY);
|
||||
len -= 0x800; data+= 0x800; // Arbitrarily use 2KByte blocks
|
||||
}
|
||||
@@ -527,7 +527,7 @@ void TFT_eSPI::pushImageDMA(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t
|
||||
// small transfers are performed using a blocking call until DMA capacity is reached.
|
||||
// User sketch can prevent blocking by managing pixel count and splitting into blocks
|
||||
// of 32767 pixels maximum. (equivalent to an area of ~320 x 100 pixels)
|
||||
while(len>0x7FFF) { // Transfer 16 bit pixels in blocks if len*2 over 65534 bytes
|
||||
while(len>0x7FFF) { // Transfer 16-bit pixels in blocks if len*2 over 65534 bytes
|
||||
HAL_SPI_Transmit(&spiHal, (uint8_t*)buffer, 0x800<<1, HAL_MAX_DELAY);
|
||||
len -= 0x800; buffer+= 0x800; // Arbitrarily send 1K pixel blocks (2Kbytes)
|
||||
}
|
||||
|
||||
+20
-20
@@ -401,7 +401,7 @@
|
||||
#define D5_BSR_MASK(B) ((D5_PIN_MASK<<16)>>(((B)>> 1)&0x10))
|
||||
#define D6_BSR_MASK(B) ((D6_PIN_MASK<<16)>>(((B)>> 2)&0x10))
|
||||
#define D7_BSR_MASK(B) ((D7_PIN_MASK<<16)>>(((B)>> 3)&0x10))
|
||||
// Create bit set/reset mask for top byte of 16 bit value B
|
||||
// Create bit set/reset mask for top byte of 16-bit value B
|
||||
#define D8_BSR_MASK(B) ((D0_PIN_MASK<<16)>>(((B)>> 4)&0x10))
|
||||
#define D9_BSR_MASK(B) ((D1_PIN_MASK<<16)>>(((B)>> 5)&0x10))
|
||||
#define D10_BSR_MASK(B) ((D2_PIN_MASK<<16)>>(((B)>> 6)&0x10))
|
||||
@@ -420,7 +420,7 @@
|
||||
|
||||
#if defined (SSD1963_DRIVER)
|
||||
|
||||
// Write 18 bit color to TFT (untested)
|
||||
// Write 18-bit color to TFT (untested)
|
||||
#define tft_Write_16(C) r6 = (((C) & 0xF800)>> 8); g6 = (((C) & 0x07E0)>> 3); b6 = (((C) & 0x001F)<< 3); \
|
||||
GPIOA->BSRR = D0_BSR_MASK(r6) | D2_BSR_MASK(r6) | D7_BSR_MASK(r6); \
|
||||
WR_L; \
|
||||
@@ -438,7 +438,7 @@
|
||||
GPIOB->BSRR = D3_BSR_MASK(b6) | D4_BSR_MASK(b6) | D5_BSR_MASK(b6) | D6_BSR_MASK(b6); \
|
||||
WR_STB // Need to slow down strobe
|
||||
|
||||
// 18 bit color write with swapped bytes
|
||||
// 18-bit color write with swapped bytes
|
||||
#define tft_Write_16S(C) Cswap = ((C) >>8 | (C) << 8); tft_Write_16(Cswap)
|
||||
|
||||
#else
|
||||
@@ -454,7 +454,7 @@
|
||||
GPIOB->BSRR = D3_BSR_MASK(C) | D4_BSR_MASK(C) | D5_BSR_MASK(C) | D6_BSR_MASK(C); \
|
||||
WR_STB // Need to slow down strobe
|
||||
|
||||
// 16 bit write with swapped bytes
|
||||
// 16-bit write with swapped bytes
|
||||
#define tft_Write_16S(C) GPIOA->BSRR = D0_BSR_MASK(C) | D2_BSR_MASK(C) | D7_BSR_MASK(C); \
|
||||
WR_L; \
|
||||
GPIOC->BSRR = D1_BSR_MASK(C); \
|
||||
@@ -541,7 +541,7 @@
|
||||
#define D5_BSR_MASK(B) ((D5_PIN_MASK<<16)>>(((B)>> 1)&0x10))
|
||||
#define D6_BSR_MASK(B) ((D6_PIN_MASK<<16)>>(((B)>> 2)&0x10))
|
||||
#define D7_BSR_MASK(B) ((D7_PIN_MASK<<16)>>(((B)>> 3)&0x10))
|
||||
// Create bit set/reset mask for top byte of 16 bit value B
|
||||
// Create bit set/reset mask for top byte of 16-bit value B
|
||||
#define D8_BSR_MASK(B) ((D0_PIN_MASK<<16)>>(((B)>> 4)&0x10))
|
||||
#define D9_BSR_MASK(B) ((D1_PIN_MASK<<16)>>(((B)>> 5)&0x10))
|
||||
#define D10_BSR_MASK(B) ((D2_PIN_MASK<<16)>>(((B)>> 6)&0x10))
|
||||
@@ -561,7 +561,7 @@
|
||||
|
||||
#if defined (SSD1963_DRIVER)
|
||||
|
||||
// Write 18 bit color to TFT (untested)
|
||||
// Write 18-bit color to TFT (untested)
|
||||
#define tft_Write_16(C) r6 = (((C) & 0xF800)>> 8); g6 = (((C) & 0x07E0)>> 3); b6 = (((C) & 0x001F)<< 3); \
|
||||
GPIOF->BSRR = D0_BSR_MASK(r6) | D2_BSR_MASK(r6) | D4_BSR_MASK(r6) | D7_BSR_MASK(r6); \
|
||||
WR_L; \
|
||||
@@ -579,7 +579,7 @@
|
||||
GPIOE->BSRR = D3_BSR_MASK(b6) | D5_BSR_MASK(b6) | D6_BSR_MASK(b6); \
|
||||
WR_STB // Need to slow down strobe
|
||||
|
||||
// 18 bit color write with swapped bytes
|
||||
// 18-bit color write with swapped bytes
|
||||
#define tft_Write_16S(C) Cswap = ((C) >>8 | (C) << 8); tft_Write_16(Cswap)
|
||||
|
||||
#else
|
||||
@@ -596,7 +596,7 @@
|
||||
GPIOE->BSRR = D3_BSR_MASK(C) | D5_BSR_MASK(C) | D6_BSR_MASK(C); \
|
||||
WR_STB
|
||||
|
||||
// 16 bit write with swapped bytes
|
||||
// 16-bit write with swapped bytes
|
||||
#define tft_Write_16S(C) GPIOF->BSRR = D0_BSR_MASK(C) | D2_BSR_MASK(C) | D4_BSR_MASK(C) | D7_BSR_MASK(C); \
|
||||
WR_L; \
|
||||
GPIOD->BSRR = D1_BSR_MASK(C); \
|
||||
@@ -659,7 +659,7 @@
|
||||
#define D5_BSR_MASK(B) ((D5_PIN_MASK<<16)>>(((B)>> 1)&0x10))
|
||||
#define D6_BSR_MASK(B) ((D6_PIN_MASK<<16)>>(((B)>> 2)&0x10))
|
||||
#define D7_BSR_MASK(B) ((D7_PIN_MASK<<16)>>(((B)>> 3)&0x10))
|
||||
// Create bit set/reset mask for top byte of 16 bit value B
|
||||
// Create bit set/reset mask for top byte of 16-bit value B
|
||||
#define D8_BSR_MASK(B) ((D0_PIN_MASK<<16)>>(((B)>> 4)&0x10))
|
||||
#define D9_BSR_MASK(B) ((D1_PIN_MASK<<16)>>(((B)>> 5)&0x10))
|
||||
#define D10_BSR_MASK(B) ((D2_PIN_MASK<<16)>>(((B)>> 6)&0x10))
|
||||
@@ -692,7 +692,7 @@
|
||||
GPIOE->BSRR = D3_BSR_MASK(C) | D4_BSR_MASK(C) | D5_BSR_MASK(C) | D6_BSR_MASK(C); \
|
||||
WR_STB
|
||||
|
||||
// 16 bit write with swapped bytes
|
||||
// 16-bit write with swapped bytes
|
||||
#define tft_Write_16S(C) GPIOF->BSRR = D0_BSR_MASK(C); \
|
||||
GPIOG->BSRR = D2_BSR_MASK(C) | D7_BSR_MASK(C); \
|
||||
WR_L; \
|
||||
@@ -743,14 +743,14 @@
|
||||
|
||||
#if defined (SSD1963_DRIVER)
|
||||
|
||||
// Write 18 bit color to TFT (untested)
|
||||
// Write 18-bit color to TFT (untested)
|
||||
|
||||
#define tft_Write_16(C) r6 = (((C) & 0xF800)>> 8); g6 = (((C) & 0x07E0)>> 3); b6 = (((C) & 0x001F)<< 3); \
|
||||
GPIOX->BSRR = (0x00FF0000 | (uint8_t)(r6)); WR_L; WR_STB; \
|
||||
GPIOX->BSRR = (0x00FF0000 | (uint8_t)(g6)); WR_L; WR_STB; \
|
||||
GPIOX->BSRR = (0x00FF0000 | (uint8_t)(b6)); WR_L; WR_STB
|
||||
|
||||
// 18 bit color write with swapped bytes
|
||||
// 18-bit color write with swapped bytes
|
||||
#define tft_Write_16S(C) Cswap = ((C) >>8 | (C) << 8); tft_Write_16(Cswap)
|
||||
|
||||
#else
|
||||
@@ -759,7 +759,7 @@
|
||||
#define tft_Write_16(C) GPIOX->BSRR = (0x00FF0000 | (uint8_t)(C>>8)); WR_L; WR_STB; \
|
||||
GPIOX->BSRR = (0x00FF0000 | (uint8_t)(C>>0)); WR_L; WR_STB
|
||||
|
||||
// 16 bit write with swapped bytes
|
||||
// 16-bit write with swapped bytes
|
||||
#define tft_Write_16S(C) GPIOX->BSRR = (0x00FF0000 | (uint8_t)(C>>0)); WR_L; WR_STB; \
|
||||
GPIOX->BSRR = (0x00FF0000 | (uint8_t)(C>>8)); WR_L; WR_STB
|
||||
#endif
|
||||
@@ -832,7 +832,7 @@
|
||||
#define D5_BSR_MASK(B) ((D5_PIN_MASK<<16)>>(((B)>> 1)&0x10))
|
||||
#define D6_BSR_MASK(B) ((D6_PIN_MASK<<16)>>(((B)>> 2)&0x10))
|
||||
#define D7_BSR_MASK(B) ((D7_PIN_MASK<<16)>>(((B)>> 3)&0x10))
|
||||
// Create bit set/reset mask for top byte of 16 bit value B
|
||||
// Create bit set/reset mask for top byte of 16-bit value B
|
||||
#define D8_BSR_MASK(B) ((D0_PIN_MASK<<16)>>(((B)>> 4)&0x10))
|
||||
#define D9_BSR_MASK(B) ((D1_PIN_MASK<<16)>>(((B)>> 5)&0x10))
|
||||
#define D10_BSR_MASK(B) ((D2_PIN_MASK<<16)>>(((B)>> 6)&0x10))
|
||||
@@ -857,7 +857,7 @@
|
||||
|
||||
#if defined (SSD1963_DRIVER)
|
||||
|
||||
// Write 18 bit color to TFT (untested)
|
||||
// Write 18-bit color to TFT (untested)
|
||||
#define tft_Write_16(C) r6 = (((C) & 0xF800)>> 8); g6 = (((C) & 0x07E0)>> 3); b6 = (((C) & 0x001F)<< 3); \
|
||||
D0_PIN_PORT->BSRR = D8_BSR_MASK(r6); \
|
||||
D1_PIN_PORT->BSRR = D9_BSR_MASK(r6); \
|
||||
@@ -890,7 +890,7 @@
|
||||
D7_PIN_PORT->BSRR = D7_BSR_MASK(b6); \
|
||||
WR_STB
|
||||
|
||||
// 18 bit color write with swapped bytes
|
||||
// 18-bit color write with swapped bytes
|
||||
#define tft_Write_16S(C) Cswap = ((C) >>8 | (C) << 8); tft_Write_16(Cswap)
|
||||
|
||||
#else
|
||||
@@ -917,7 +917,7 @@
|
||||
D7_PIN_PORT->BSRR = D7_BSR_MASK(C); \
|
||||
WR_STB
|
||||
|
||||
// 16 bit write with swapped bytes
|
||||
// 16-bit write with swapped bytes
|
||||
#define tft_Write_16S(C) D0_PIN_PORT->BSRR = D0_BSR_MASK(C); \
|
||||
D1_PIN_PORT->BSRR = D1_BSR_MASK(C); \
|
||||
D2_PIN_PORT->BSRR = D2_BSR_MASK(C); \
|
||||
@@ -960,19 +960,19 @@
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Macros to write commands/pixel colour data to a SPI ILI948x TFT
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour
|
||||
#elif defined (SPI_18BIT_DRIVER) // SPI 18-bit colour
|
||||
|
||||
// Write 8 bits to TFT
|
||||
#define tft_Write_8(C) \
|
||||
{ spiBuffer[0] = C; \
|
||||
HAL_SPI_Transmit(&spiHal, spiBuffer, 1, 10); }
|
||||
|
||||
// Convert 16 bit colour to 18 bit and write in 3 bytes
|
||||
// Convert 16-bit colour to 18-bit and write in 3 bytes
|
||||
#define tft_Write_16(C) \
|
||||
{ spiBuffer[0] = ((C) & 0xF800)>>8; spiBuffer[1] = ((C) & 0x07E0)>>3; spiBuffer[2] = ((C) & 0x001F)<<3; \
|
||||
HAL_SPI_Transmit(&spiHal, spiBuffer, 3, 10); }
|
||||
|
||||
// Convert swapped byte 16 bit colour to 18 bit and write in 3 bytes
|
||||
// Convert swapped byte 16-bit colour to 18-bit and write in 3 bytes
|
||||
#define tft_Write_16S(C) \
|
||||
{ spiBuffer[0] = (C) & 0xF8; spiBuffer[1] = ((C) & 0xE000)>>11 | ((C) & 0x07)<<5; spiBuffer[2] = ((C) & 0x1F00)>>5; \
|
||||
HAL_SPI_Transmit(&spiHal, spiBuffer, 3, 10); }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// -------------------------------------------------- //
|
||||
// This file is autogenerated by pioasm; do not edit! //
|
||||
// 16 bit parallel //
|
||||
// 16-bit parallel //
|
||||
// -------------------------------------------------- //
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// -------------------------------------------------- //
|
||||
// This file is autogenerated by pioasm; do not edit! //
|
||||
// 8 bit parallel //
|
||||
// 8-bit parallel //
|
||||
// -------------------------------------------------- //
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// -------------------------------------------------- //
|
||||
// This file is autogenerated by pioasm; do not edit! //
|
||||
// 8 + 16 bit SPI - no auto colour conversion //
|
||||
// 8 + 16-bit SPI - no auto colour conversion //
|
||||
// -------------------------------------------------- //
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// -------------------------------------------------- //
|
||||
// This file is autogenerated by pioasm; do not edit! //
|
||||
// 8 + 18 bit SPI - no auto colour conversion //
|
||||
// 8 + 18-bit SPI - no auto colour conversion //
|
||||
// -------------------------------------------------- //
|
||||
|
||||
#pragma once
|
||||
|
||||
Reference in new issue
Block a user