You've already forked TEF6686_ESP32
c with classes and also remove useless drivers in tft_espi
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
// Change the width and height if required (defined in portrait mode)
|
||||
// or use the constructor to over-ride defaults
|
||||
#ifndef TFT_WIDTH
|
||||
#define TFT_WIDTH 240
|
||||
#endif
|
||||
#ifndef TFT_HEIGHT
|
||||
#define TFT_HEIGHT 240
|
||||
#endif
|
||||
|
||||
// Delay between some initialisation commands
|
||||
#define TFT_INIT_DELAY 0x80
|
||||
|
||||
// Generic commands used by TFT_eSPI.cpp
|
||||
#define TFT_NOP 0x00
|
||||
#define TFT_SWRST 0x01
|
||||
|
||||
#define TFT_SLPIN 0x10
|
||||
#define TFT_SLPOUT 0x11
|
||||
|
||||
#define TFT_INVOFF 0x20
|
||||
#define TFT_INVON 0x21
|
||||
|
||||
#define TFT_DISPOFF 0x28
|
||||
#define TFT_DISPON 0x29
|
||||
|
||||
#define TFT_CASET 0x2A
|
||||
#define TFT_PASET 0x2B
|
||||
#define TFT_RAMWR 0x2C
|
||||
|
||||
#define TFT_RAMRD 0x2E
|
||||
#define TFT_IDXRD 0x00 //0xDD // ILI9341 only, indexed control register read
|
||||
|
||||
#define TFT_MADCTL 0x36
|
||||
#define TFT_MAD_MY 0x80
|
||||
#define TFT_MAD_MX 0x40
|
||||
#define TFT_MAD_MV 0x20
|
||||
#define TFT_MAD_ML 0x10
|
||||
#define TFT_MAD_BGR 0x08
|
||||
#define TFT_MAD_MH 0x04
|
||||
#define TFT_MAD_RGB 0x00
|
||||
@@ -1,232 +0,0 @@
|
||||
|
||||
// This is the command sequence that initialises the GC9A01 driver
|
||||
|
||||
{
|
||||
writecommand(0xEF);
|
||||
writecommand(0xEB);
|
||||
writedata(0x14);
|
||||
|
||||
writecommand(0xFE);
|
||||
writecommand(0xEF);
|
||||
|
||||
writecommand(0xEB);
|
||||
writedata(0x14);
|
||||
|
||||
writecommand(0x84);
|
||||
writedata(0x40);
|
||||
|
||||
writecommand(0x85);
|
||||
writedata(0xFF);
|
||||
|
||||
writecommand(0x86);
|
||||
writedata(0xFF);
|
||||
|
||||
writecommand(0x87);
|
||||
writedata(0xFF);
|
||||
|
||||
writecommand(0x88);
|
||||
writedata(0x0A);
|
||||
|
||||
writecommand(0x89);
|
||||
writedata(0x21);
|
||||
|
||||
writecommand(0x8A);
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(0x8B);
|
||||
writedata(0x80);
|
||||
|
||||
writecommand(0x8C);
|
||||
writedata(0x01);
|
||||
|
||||
writecommand(0x8D);
|
||||
writedata(0x01);
|
||||
|
||||
writecommand(0x8E);
|
||||
writedata(0xFF);
|
||||
|
||||
writecommand(0x8F);
|
||||
writedata(0xFF);
|
||||
|
||||
writecommand(0xB6);
|
||||
writedata(0x00);
|
||||
writedata(0x20);
|
||||
|
||||
writecommand(0x3A);
|
||||
writedata(0x05);
|
||||
|
||||
writecommand(0x90);
|
||||
writedata(0x08);
|
||||
writedata(0x08);
|
||||
writedata(0x08);
|
||||
writedata(0x08);
|
||||
|
||||
writecommand(0xBD);
|
||||
writedata(0x06);
|
||||
|
||||
writecommand(0xBC);
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(0xFF);
|
||||
writedata(0x60);
|
||||
writedata(0x01);
|
||||
writedata(0x04);
|
||||
|
||||
writecommand(0xC3);
|
||||
writedata(0x13);
|
||||
writecommand(0xC4);
|
||||
writedata(0x13);
|
||||
|
||||
writecommand(0xC9);
|
||||
writedata(0x22);
|
||||
|
||||
writecommand(0xBE);
|
||||
writedata(0x11);
|
||||
|
||||
writecommand(0xE1);
|
||||
writedata(0x10);
|
||||
writedata(0x0E);
|
||||
|
||||
writecommand(0xDF);
|
||||
writedata(0x21);
|
||||
writedata(0x0c);
|
||||
writedata(0x02);
|
||||
|
||||
writecommand(0xF0);
|
||||
writedata(0x45);
|
||||
writedata(0x09);
|
||||
writedata(0x08);
|
||||
writedata(0x08);
|
||||
writedata(0x26);
|
||||
writedata(0x2A);
|
||||
|
||||
writecommand(0xF1);
|
||||
writedata(0x43);
|
||||
writedata(0x70);
|
||||
writedata(0x72);
|
||||
writedata(0x36);
|
||||
writedata(0x37);
|
||||
writedata(0x6F);
|
||||
|
||||
writecommand(0xF2);
|
||||
writedata(0x45);
|
||||
writedata(0x09);
|
||||
writedata(0x08);
|
||||
writedata(0x08);
|
||||
writedata(0x26);
|
||||
writedata(0x2A);
|
||||
|
||||
writecommand(0xF3);
|
||||
writedata(0x43);
|
||||
writedata(0x70);
|
||||
writedata(0x72);
|
||||
writedata(0x36);
|
||||
writedata(0x37);
|
||||
writedata(0x6F);
|
||||
|
||||
writecommand(0xED);
|
||||
writedata(0x1B);
|
||||
writedata(0x0B);
|
||||
|
||||
writecommand(0xAE);
|
||||
writedata(0x77);
|
||||
|
||||
writecommand(0xCD);
|
||||
writedata(0x63);
|
||||
|
||||
writecommand(0x70);
|
||||
writedata(0x07);
|
||||
writedata(0x07);
|
||||
writedata(0x04);
|
||||
writedata(0x0E);
|
||||
writedata(0x0F);
|
||||
writedata(0x09);
|
||||
writedata(0x07);
|
||||
writedata(0x08);
|
||||
writedata(0x03);
|
||||
|
||||
writecommand(0xE8);
|
||||
writedata(0x34);
|
||||
|
||||
writecommand(0x62);
|
||||
writedata(0x18);
|
||||
writedata(0x0D);
|
||||
writedata(0x71);
|
||||
writedata(0xED);
|
||||
writedata(0x70);
|
||||
writedata(0x70);
|
||||
writedata(0x18);
|
||||
writedata(0x0F);
|
||||
writedata(0x71);
|
||||
writedata(0xEF);
|
||||
writedata(0x70);
|
||||
writedata(0x70);
|
||||
|
||||
writecommand(0x63);
|
||||
writedata(0x18);
|
||||
writedata(0x11);
|
||||
writedata(0x71);
|
||||
writedata(0xF1);
|
||||
writedata(0x70);
|
||||
writedata(0x70);
|
||||
writedata(0x18);
|
||||
writedata(0x13);
|
||||
writedata(0x71);
|
||||
writedata(0xF3);
|
||||
writedata(0x70);
|
||||
writedata(0x70);
|
||||
|
||||
writecommand(0x64);
|
||||
writedata(0x28);
|
||||
writedata(0x29);
|
||||
writedata(0xF1);
|
||||
writedata(0x01);
|
||||
writedata(0xF1);
|
||||
writedata(0x00);
|
||||
writedata(0x07);
|
||||
|
||||
writecommand(0x66);
|
||||
writedata(0x3C);
|
||||
writedata(0x00);
|
||||
writedata(0xCD);
|
||||
writedata(0x67);
|
||||
writedata(0x45);
|
||||
writedata(0x45);
|
||||
writedata(0x10);
|
||||
writedata(0x00);
|
||||
writedata(0x00);
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(0x67);
|
||||
writedata(0x00);
|
||||
writedata(0x3C);
|
||||
writedata(0x00);
|
||||
writedata(0x00);
|
||||
writedata(0x00);
|
||||
writedata(0x01);
|
||||
writedata(0x54);
|
||||
writedata(0x10);
|
||||
writedata(0x32);
|
||||
writedata(0x98);
|
||||
|
||||
writecommand(0x74);
|
||||
writedata(0x10);
|
||||
writedata(0x85);
|
||||
writedata(0x80);
|
||||
writedata(0x00);
|
||||
writedata(0x00);
|
||||
writedata(0x4E);
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(0x98);
|
||||
writedata(0x3e);
|
||||
writedata(0x07);
|
||||
|
||||
writecommand(0x35);
|
||||
writecommand(0x21);
|
||||
|
||||
writecommand(0x11);
|
||||
delay(120);
|
||||
writecommand(0x29);
|
||||
delay(20);
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
|
||||
// This is the command sequence that rotates the GC9A01 driver coordinate frame
|
||||
|
||||
rotation = m % 4;
|
||||
|
||||
writecommand(TFT_MADCTL);
|
||||
switch (rotation) {
|
||||
case 0: // Portrait
|
||||
writedata(TFT_MAD_BGR);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
#ifdef CGRAM_OFFSET
|
||||
if (_init_width == 128)
|
||||
{
|
||||
colstart = 2;
|
||||
rowstart = 1;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case 1: // Landscape (Portrait + 90)
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_BGR);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
#ifdef CGRAM_OFFSET
|
||||
if (_init_width == 128)
|
||||
{
|
||||
colstart = 1;
|
||||
rowstart = 2;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case 2: // Inverter portrait
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_BGR);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
#ifdef CGRAM_OFFSET
|
||||
if (_init_width == 128)
|
||||
{
|
||||
colstart = 2;
|
||||
rowstart = 1;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case 3: // Inverted landscape
|
||||
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_BGR);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
#ifdef CGRAM_OFFSET
|
||||
if (_init_width == 128)
|
||||
{
|
||||
colstart = 1;
|
||||
rowstart = 2;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
// Change the width and height if required (defined in portrait mode)
|
||||
// or use the constructor to over-ride defaults
|
||||
#define TFT_WIDTH 320
|
||||
#define TFT_HEIGHT 480
|
||||
|
||||
|
||||
// Delay between some initialisation commands
|
||||
#define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
|
||||
|
||||
|
||||
// Generic commands used by TFT_eSPar.cpp
|
||||
#define TFT_NOP 0x00
|
||||
#define TFT_SWRST 0x01
|
||||
|
||||
#define TFT_SLPIN 0x10
|
||||
#define TFT_SLPOUT 0x11
|
||||
|
||||
#define TFT_INVOFF 0x20
|
||||
#define TFT_INVON 0x21
|
||||
|
||||
#define TFT_DISPOFF 0x28
|
||||
#define TFT_DISPON 0x29
|
||||
|
||||
#define TFT_CASET 0x2A
|
||||
#define TFT_PASET 0x2B
|
||||
#define TFT_RAMWR 0x2C
|
||||
|
||||
#define TFT_RAMRD 0x2E
|
||||
|
||||
#define TFT_MADCTL 0x36
|
||||
|
||||
#define TFT_MAD_MY 0x80
|
||||
#define TFT_MAD_MX 0x40
|
||||
#define TFT_MAD_MV 0x20
|
||||
#define TFT_MAD_ML 0x10
|
||||
#define TFT_MAD_RGB 0x00
|
||||
#define TFT_MAD_BGR 0x08
|
||||
#define TFT_MAD_MH 0x04
|
||||
#define TFT_MAD_SS 0x02
|
||||
#define TFT_MAD_GS 0x01
|
||||
|
||||
#ifdef TFT_RGB_ORDER
|
||||
#if (TFT_RGB_ORDER == 1)
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
|
||||
#else
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
|
||||
#endif
|
||||
#else
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
|
||||
#endif
|
||||
|
||||
#define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read
|
||||
@@ -1,76 +0,0 @@
|
||||
|
||||
// This is the command sequence that initialises the HX8357B driver
|
||||
//
|
||||
// This setup information uses simple 8-bit SPI writecommand() and writedata() functions
|
||||
//
|
||||
// See ST7735_Setup.h file for an alternative format
|
||||
|
||||
|
||||
// Configure HX8357-B display
|
||||
writecommand(0x11);
|
||||
delay(20);
|
||||
writecommand(0xD0);
|
||||
writedata(0x07);
|
||||
writedata(0x42);
|
||||
writedata(0x18);
|
||||
|
||||
writecommand(0xD1);
|
||||
writedata(0x00);
|
||||
writedata(0x07);
|
||||
writedata(0x10);
|
||||
|
||||
writecommand(0xD2);
|
||||
writedata(0x01);
|
||||
writedata(0x02);
|
||||
|
||||
writecommand(0xC0);
|
||||
writedata(0x10);
|
||||
writedata(0x3B);
|
||||
writedata(0x00);
|
||||
writedata(0x02);
|
||||
writedata(0x11);
|
||||
|
||||
writecommand(0xC5);
|
||||
writedata(0x08);
|
||||
|
||||
writecommand(0xC8);
|
||||
writedata(0x00);
|
||||
writedata(0x32);
|
||||
writedata(0x36);
|
||||
writedata(0x45);
|
||||
writedata(0x06);
|
||||
writedata(0x16);
|
||||
writedata(0x37);
|
||||
writedata(0x75);
|
||||
writedata(0x77);
|
||||
writedata(0x54);
|
||||
writedata(0x0C);
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(0x36);
|
||||
writedata(0x0a);
|
||||
|
||||
writecommand(0x3A);
|
||||
writedata(0x55);
|
||||
|
||||
writecommand(0x2A);
|
||||
writedata(0x00);
|
||||
writedata(0x00);
|
||||
writedata(0x01);
|
||||
writedata(0x3F);
|
||||
|
||||
writecommand(0x2B);
|
||||
writedata(0x00);
|
||||
writedata(0x00);
|
||||
writedata(0x01);
|
||||
writedata(0xDF);
|
||||
|
||||
delay(120);
|
||||
writecommand(0x29);
|
||||
|
||||
delay(25);
|
||||
|
||||
// End of HX8357B display configuration
|
||||
|
||||
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
// This is the command sequence that rotates the HX8357C driver coordinate frame
|
||||
|
||||
writecommand(TFT_MADCTL);
|
||||
rotation = m % 8;
|
||||
switch (rotation) {
|
||||
case 0: // Portrait
|
||||
writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MX);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 1: // Landscape (Portrait + 90)
|
||||
writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MV);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
case 2: // Inverter portrait
|
||||
writedata( TFT_MAD_COLOR_ORDER | TFT_MAD_MY);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 3: // Inverted landscape
|
||||
writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_MY);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
case 4: // Portrait
|
||||
writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MX | TFT_MAD_MY);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 5: // Landscape (Portrait + 90)
|
||||
writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MV | TFT_MAD_MX);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
case 6: // Inverter portrait
|
||||
writedata( TFT_MAD_COLOR_ORDER);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 7: // Inverted landscape
|
||||
writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MV | TFT_MAD_MY);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
// Change the width and height if required (defined in portrait mode)
|
||||
// or use the constructor to over-ride defaults
|
||||
#define TFT_WIDTH 320
|
||||
#define TFT_HEIGHT 480
|
||||
|
||||
|
||||
// Delay between some initialisation commands
|
||||
#define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
|
||||
|
||||
|
||||
// Generic commands used by TFT_eSPar.cpp
|
||||
#define TFT_NOP 0x00
|
||||
#define TFT_SWRST 0x01
|
||||
|
||||
#define TFT_SLPIN 0x10
|
||||
#define TFT_SLPOUT 0x11
|
||||
|
||||
#define TFT_INVOFF 0x20
|
||||
#define TFT_INVON 0x21
|
||||
|
||||
#define TFT_DISPOFF 0x28
|
||||
#define TFT_DISPON 0x29
|
||||
|
||||
#define TFT_CASET 0x2A
|
||||
#define TFT_PASET 0x2B
|
||||
#define TFT_RAMWR 0x2C
|
||||
|
||||
#define TFT_RAMRD 0x2E
|
||||
|
||||
#define TFT_MADCTL 0x36
|
||||
|
||||
#define TFT_MAD_MY 0x80
|
||||
#define TFT_MAD_MX 0x40
|
||||
#define TFT_MAD_MV 0x20
|
||||
#define TFT_MAD_ML 0x10
|
||||
#define TFT_MAD_RGB 0x00
|
||||
#define TFT_MAD_BGR 0x08
|
||||
#define TFT_MAD_MH 0x04
|
||||
#define TFT_MAD_SS 0x02
|
||||
#define TFT_MAD_GS 0x01
|
||||
|
||||
#ifdef TFT_RGB_ORDER
|
||||
#if (TFT_RGB_ORDER == 1)
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
|
||||
#else
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
|
||||
#endif
|
||||
#else
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
|
||||
#endif
|
||||
|
||||
#define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read
|
||||
@@ -1,116 +0,0 @@
|
||||
|
||||
// This is the command sequence that initialises the HX8357C driver
|
||||
//
|
||||
// This setup information uses simple 8-bit SPI writecommand() and writedata() functions
|
||||
//
|
||||
// See ST7735_Setup.h file for an alternative format
|
||||
|
||||
|
||||
// Configure HX8357C display
|
||||
|
||||
writecommand(0xB9); // Enable extension command
|
||||
writedata(0xFF);
|
||||
writedata(0x83);
|
||||
writedata(0x57);
|
||||
delay(50);
|
||||
|
||||
writecommand(0xB6); //Set VCOM voltage
|
||||
writedata(0x2C); //0x52 for HSD 3.0"
|
||||
|
||||
writecommand(0x11); // Sleep off
|
||||
delay(200);
|
||||
|
||||
writecommand(0x35); // Tearing effect on
|
||||
writedata(0x00); // Added parameter
|
||||
|
||||
writecommand(0x3A); // Interface pixel format
|
||||
writedata(0x55); // 16 bits per pixel
|
||||
|
||||
//writecommand(0xCC); // Set panel characteristic
|
||||
//writedata(0x09); // S960>S1, G1>G480, R-G-B, normally black
|
||||
|
||||
//writecommand(0xB3); // RGB interface
|
||||
//writedata(0x43);
|
||||
//writedata(0x00);
|
||||
//writedata(0x06);
|
||||
//writedata(0x06);
|
||||
|
||||
writecommand(0xB1); // Power control
|
||||
writedata(0x00);
|
||||
writedata(0x15);
|
||||
writedata(0x0D);
|
||||
writedata(0x0D);
|
||||
writedata(0x83);
|
||||
writedata(0x48);
|
||||
|
||||
|
||||
writecommand(0xC0); // Does this do anything?
|
||||
writedata(0x24);
|
||||
writedata(0x24);
|
||||
writedata(0x01);
|
||||
writedata(0x3C);
|
||||
writedata(0xC8);
|
||||
writedata(0x08);
|
||||
|
||||
writecommand(0xB4); // Display cycle
|
||||
writedata(0x02);
|
||||
writedata(0x40);
|
||||
writedata(0x00);
|
||||
writedata(0x2A);
|
||||
writedata(0x2A);
|
||||
writedata(0x0D);
|
||||
writedata(0x4F);
|
||||
|
||||
writecommand(0xE0); // Gamma curve
|
||||
writedata(0x00);
|
||||
writedata(0x15);
|
||||
writedata(0x1D);
|
||||
writedata(0x2A);
|
||||
writedata(0x31);
|
||||
writedata(0x42);
|
||||
writedata(0x4C);
|
||||
writedata(0x53);
|
||||
writedata(0x45);
|
||||
writedata(0x40);
|
||||
writedata(0x3B);
|
||||
writedata(0x32);
|
||||
writedata(0x2E);
|
||||
writedata(0x28);
|
||||
|
||||
writedata(0x24);
|
||||
writedata(0x03);
|
||||
writedata(0x00);
|
||||
writedata(0x15);
|
||||
writedata(0x1D);
|
||||
writedata(0x2A);
|
||||
writedata(0x31);
|
||||
writedata(0x42);
|
||||
writedata(0x4C);
|
||||
writedata(0x53);
|
||||
writedata(0x45);
|
||||
writedata(0x40);
|
||||
writedata(0x3B);
|
||||
writedata(0x32);
|
||||
|
||||
writedata(0x2E);
|
||||
writedata(0x28);
|
||||
writedata(0x24);
|
||||
writedata(0x03);
|
||||
writedata(0x00);
|
||||
writedata(0x01);
|
||||
|
||||
writecommand(0x36); // MADCTL Memory access control
|
||||
writedata(0x48);
|
||||
delay(20);
|
||||
|
||||
writecommand(0x21); //Display inversion on
|
||||
delay(20);
|
||||
|
||||
writecommand(0x29); // Display on
|
||||
|
||||
delay(120);
|
||||
|
||||
// End of HX8357C display configuration
|
||||
|
||||
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
// This is the command sequence that rotates the HX8357C driver coordinate frame
|
||||
|
||||
writecommand(TFT_MADCTL);
|
||||
rotation = m % 8;
|
||||
switch (rotation) {
|
||||
case 0: // Portrait
|
||||
writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MX);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 1: // Landscape (Portrait + 90)
|
||||
writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MV);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
case 2: // Inverter portrait
|
||||
writedata( TFT_MAD_COLOR_ORDER | TFT_MAD_MY);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 3: // Inverted landscape
|
||||
writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_MY);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
case 4: // Portrait
|
||||
writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MX | TFT_MAD_MY);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 5: // Landscape (Portrait + 90)
|
||||
writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MV | TFT_MAD_MX);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
case 6: // Inverter portrait
|
||||
writedata( TFT_MAD_COLOR_ORDER);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 7: // Inverted landscape
|
||||
writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MV | TFT_MAD_MY);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
// Change the width and height if required (defined in portrait mode)
|
||||
// or use the constructor to over-ride defaults
|
||||
#define TFT_WIDTH 320
|
||||
#define TFT_HEIGHT 480
|
||||
|
||||
|
||||
// Delay between some initialisation commands
|
||||
#define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
|
||||
|
||||
|
||||
// Generic commands used by TFT_eSPar.cpp
|
||||
#define TFT_NOP 0x00
|
||||
#define TFT_SWRST 0x01
|
||||
|
||||
#define TFT_SLPIN 0x10
|
||||
#define TFT_SLPOUT 0x11
|
||||
|
||||
#define TFT_INVOFF 0x20
|
||||
#define TFT_INVON 0x21
|
||||
|
||||
#define TFT_DISPOFF 0x28
|
||||
#define TFT_DISPON 0x29
|
||||
|
||||
#define TFT_CASET 0x2A
|
||||
#define TFT_PASET 0x2B
|
||||
#define TFT_RAMWR 0x2C
|
||||
|
||||
#define TFT_RAMRD 0x2E
|
||||
|
||||
#define TFT_MADCTL 0x36
|
||||
|
||||
#define TFT_MAD_MY 0x80
|
||||
#define TFT_MAD_MX 0x40
|
||||
#define TFT_MAD_MV 0x20
|
||||
#define TFT_MAD_ML 0x10
|
||||
#define TFT_MAD_RGB 0x00
|
||||
#define TFT_MAD_BGR 0x08
|
||||
#define TFT_MAD_MH 0x04
|
||||
#define TFT_MAD_SS 0x02
|
||||
#define TFT_MAD_GS 0x01
|
||||
|
||||
#ifdef TFT_RGB_ORDER
|
||||
#if (TFT_RGB_ORDER == 1)
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
|
||||
#else
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
|
||||
#endif
|
||||
#else
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
|
||||
#endif
|
||||
|
||||
#define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read
|
||||
|
||||
|
||||
#define HX8357_NOP 0x00
|
||||
#define HX8357_SWRESET 0x01
|
||||
#define HX8357_RDDID 0x04
|
||||
#define HX8357_RDDST 0x09
|
||||
|
||||
#define HX8357_RDPOWMODE 0x0A
|
||||
#define HX8357_RDMADCTL 0x0B
|
||||
#define HX8357_RDCOLMOD 0x0C
|
||||
#define HX8357_RDDIM 0x0D
|
||||
#define HX8357_RDDSDR 0x0F
|
||||
|
||||
#define HX8357_SLPIN 0x10
|
||||
#define HX8357_SLPOUT 0x11
|
||||
|
||||
#define HX8357_INVOFF 0x20
|
||||
#define HX8357_INVON 0x21
|
||||
#define HX8357_DISPOFF 0x28
|
||||
#define HX8357_DISPON 0x29
|
||||
|
||||
#define HX8357_CASET 0x2A
|
||||
#define HX8357_PASET 0x2B
|
||||
#define HX8357_RAMWR 0x2C
|
||||
#define HX8357_RAMRD 0x2E
|
||||
|
||||
#define HX8357_TEON 0x35
|
||||
#define HX8357_TEARLINE 0x44
|
||||
#define HX8357_MADCTL 0x36
|
||||
#define HX8357_COLMOD 0x3A
|
||||
|
||||
#define HX8357_SETOSC 0xB0
|
||||
#define HX8357_SETPWR1 0xB1
|
||||
#define HX8357_SETRGB 0xB3
|
||||
#define HX8357D_SETCOM 0xB6
|
||||
|
||||
#define HX8357D_SETCYC 0xB4
|
||||
#define HX8357D_SETC 0xB9
|
||||
|
||||
#define HX8357D_SETSTBA 0xC0
|
||||
|
||||
#define HX8357_SETPANEL 0xCC
|
||||
|
||||
#define HX8357D_SETGAMMA 0xE0
|
||||
@@ -1,118 +0,0 @@
|
||||
|
||||
// This is the command sequence that initialises the HX8357D driver
|
||||
//
|
||||
// This setup information uses simple 8-bit SPI writecommand() and writedata() functions
|
||||
//
|
||||
// See ST7735_Setup.h file for an alternative format
|
||||
|
||||
|
||||
// Configure HX8357D display
|
||||
|
||||
// setextc
|
||||
writecommand(HX8357D_SETC);
|
||||
writedata(0xFF);
|
||||
writedata(0x83);
|
||||
writedata(0x57);
|
||||
delay(300);
|
||||
|
||||
// setRGB which also enables SDO
|
||||
writecommand(HX8357_SETRGB);
|
||||
writedata(0x80); //enable SDO pin!
|
||||
// writedata(0x00); //disable SDO pin!
|
||||
writedata(0x0);
|
||||
writedata(0x06);
|
||||
writedata(0x06);
|
||||
|
||||
writecommand(HX8357D_SETCOM);
|
||||
writedata(0x25); // -1.52V
|
||||
|
||||
writecommand(HX8357_SETOSC);
|
||||
writedata(0x68); // Normal mode 70Hz, Idle mode 55 Hz
|
||||
|
||||
writecommand(HX8357_SETPANEL); //Set Panel
|
||||
writedata(0x05); // BGR, Gate direction swapped
|
||||
|
||||
writecommand(HX8357_SETPWR1);
|
||||
writedata(0x00); // Not deep standby
|
||||
writedata(0x15); //BT
|
||||
writedata(0x1C); //VSPR
|
||||
writedata(0x1C); //VSNR
|
||||
writedata(0x83); //AP
|
||||
writedata(0xAA); //FS
|
||||
|
||||
writecommand(HX8357D_SETSTBA);
|
||||
writedata(0x50); //OPON normal
|
||||
writedata(0x50); //OPON idle
|
||||
writedata(0x01); //STBA
|
||||
writedata(0x3C); //STBA
|
||||
writedata(0x1E); //STBA
|
||||
writedata(0x08); //GEN
|
||||
|
||||
writecommand(HX8357D_SETCYC);
|
||||
writedata(0x02); //NW 0x02
|
||||
writedata(0x40); //RTN
|
||||
writedata(0x00); //DIV
|
||||
writedata(0x2A); //DUM
|
||||
writedata(0x2A); //DUM
|
||||
writedata(0x0D); //GDON
|
||||
writedata(0x78); //GDOFF
|
||||
|
||||
writecommand(HX8357D_SETGAMMA);
|
||||
writedata(0x02);
|
||||
writedata(0x0A);
|
||||
writedata(0x11);
|
||||
writedata(0x1d);
|
||||
writedata(0x23);
|
||||
writedata(0x35);
|
||||
writedata(0x41);
|
||||
writedata(0x4b);
|
||||
writedata(0x4b);
|
||||
writedata(0x42);
|
||||
writedata(0x3A);
|
||||
writedata(0x27);
|
||||
writedata(0x1B);
|
||||
writedata(0x08);
|
||||
writedata(0x09);
|
||||
writedata(0x03);
|
||||
writedata(0x02);
|
||||
writedata(0x0A);
|
||||
writedata(0x11);
|
||||
writedata(0x1d);
|
||||
writedata(0x23);
|
||||
writedata(0x35);
|
||||
writedata(0x41);
|
||||
writedata(0x4b);
|
||||
writedata(0x4b);
|
||||
writedata(0x42);
|
||||
writedata(0x3A);
|
||||
writedata(0x27);
|
||||
writedata(0x1B);
|
||||
writedata(0x08);
|
||||
writedata(0x09);
|
||||
writedata(0x03);
|
||||
writedata(0x00);
|
||||
writedata(0x01);
|
||||
|
||||
writecommand(HX8357_COLMOD);
|
||||
writedata(0x55); // 16-bit
|
||||
|
||||
writecommand(HX8357_MADCTL);
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
|
||||
|
||||
writecommand(HX8357_TEON); // TE off
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(HX8357_TEARLINE); // tear line
|
||||
writedata(0x00);
|
||||
writedata(0x02);
|
||||
|
||||
writecommand(HX8357_SLPOUT); //Exit Sleep
|
||||
delay(150);
|
||||
|
||||
writecommand(HX8357_DISPON); // display on
|
||||
delay(50);
|
||||
|
||||
// End of HX8357D display configuration
|
||||
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
// This is the command sequence that rotates the HX8357D driver coordinate frame
|
||||
|
||||
writecommand(TFT_MADCTL);
|
||||
rotation = m % 4;
|
||||
switch (rotation) {
|
||||
case 0: // Portrait
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 1: // Landscape (Portrait + 90)
|
||||
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
case 2: // Inverter portrait
|
||||
writedata(TFT_MAD_COLOR_ORDER);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 3: // Inverted landscape
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
// Change the width and height if required (defined in portrait mode)
|
||||
// or use the constructor to over-ride defaults
|
||||
#ifndef TFT_WIDTH
|
||||
#define TFT_WIDTH 128
|
||||
#endif
|
||||
#ifndef TFT_HEIGHT
|
||||
#define TFT_HEIGHT 160
|
||||
#endif
|
||||
|
||||
#if (TFT_HEIGHT == 128) && (TFT_WIDTH == 128)
|
||||
#define CGRAM_OFFSET
|
||||
#endif
|
||||
|
||||
// Color definitions for backwards compatibility with old sketches
|
||||
// use colour definitions like TFT_BLACK to make sketches more portable
|
||||
#define ILI9163_BLACK 0x0000 /* 0, 0, 0 */
|
||||
#define ILI9163_NAVY 0x000F /* 0, 0, 128 */
|
||||
#define ILI9163_DARKGREEN 0x03E0 /* 0, 128, 0 */
|
||||
#define ILI9163_DARKCYAN 0x03EF /* 0, 128, 128 */
|
||||
#define ILI9163_MAROON 0x7800 /* 128, 0, 0 */
|
||||
#define ILI9163_PURPLE 0x780F /* 128, 0, 128 */
|
||||
#define ILI9163_OLIVE 0x7BE0 /* 128, 128, 0 */
|
||||
#define ILI9163_LIGHTGREY 0xC618 /* 192, 192, 192 */
|
||||
#define ILI9163_DARKGREY 0x7BEF /* 128, 128, 128 */
|
||||
#define ILI9163_BLUE 0x001F /* 0, 0, 255 */
|
||||
#define ILI9163_GREEN 0x07E0 /* 0, 255, 0 */
|
||||
#define ILI9163_CYAN 0x07FF /* 0, 255, 255 */
|
||||
#define ILI9163_RED 0xF800 /* 255, 0, 0 */
|
||||
#define ILI9163_MAGENTA 0xF81F /* 255, 0, 255 */
|
||||
#define ILI9163_YELLOW 0xFFE0 /* 255, 255, 0 */
|
||||
#define ILI9163_WHITE 0xFFFF /* 255, 255, 255 */
|
||||
#define ILI9163_ORANGE 0xFD20 /* 255, 165, 0 */
|
||||
#define ILI9163_GREENYELLOW 0xAFE5 /* 173, 255, 47 */
|
||||
#define ILI9163_PINK 0xF81F
|
||||
|
||||
|
||||
// Delay between some initialisation commands
|
||||
#define TFT_INIT_DELAY 0x80
|
||||
|
||||
|
||||
// Generic commands used by TFT_eSPI.cpp
|
||||
#define TFT_NOP 0x00
|
||||
#define TFT_SWRST 0x01
|
||||
|
||||
#define TFT_INVOFF 0x20
|
||||
#define TFT_INVON 0x21
|
||||
|
||||
#define TFT_DISPOFF 0x28
|
||||
#define TFT_DISPON 0x29
|
||||
|
||||
#define TFT_CASET 0x2A
|
||||
#define TFT_PASET 0x2B
|
||||
#define TFT_RAMWR 0x2C
|
||||
|
||||
#define TFT_RAMRD 0x2E
|
||||
#define TFT_IDXRD 0x00 //0xDD // ILI9341 only, indexed control register read
|
||||
|
||||
#define TFT_MADCTL 0x36
|
||||
#define TFT_MAD_MY 0x80
|
||||
#define TFT_MAD_MX 0x40
|
||||
#define TFT_MAD_MV 0x20
|
||||
#define TFT_MAD_ML 0x10
|
||||
#define TFT_MAD_BGR 0x08
|
||||
#define TFT_MAD_MH 0x04
|
||||
#define TFT_MAD_RGB 0x00
|
||||
@@ -1,41 +0,0 @@
|
||||
|
||||
// This is the command sequence that initialises the ILI9163 driver
|
||||
//
|
||||
// This setup information is in a format accecpted by the commandList() function
|
||||
// which reduces FLASH space, but on an ESP8266 there is plenty available!
|
||||
//
|
||||
// See ILI9341_Setup.h file for an alternative simpler format
|
||||
|
||||
{
|
||||
// Initialization commands for ILI9163 screens
|
||||
static const uint8_t ILI9163_cmds[] PROGMEM =
|
||||
{
|
||||
17, // 17 commands follow
|
||||
0x01, 0 + TFT_INIT_DELAY, 120, // Software reset
|
||||
0x11, 0 + TFT_INIT_DELAY, 5, // Exit sleep mode
|
||||
0x3A, 1, 0x05, // Set pixel format
|
||||
0x26, 1, 0x04, // Set Gamma curve 3
|
||||
0xF2, 1, 0x01, // Gamma adjustment enabled
|
||||
0xE0, 15, 0x3F, 0x25, 0x1C, 0x1E, 0x20, 0x12, 0x2A, 0x90,
|
||||
0x24, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, // Positive Gamma
|
||||
0xE1, 15, 0x20, 0x20, 0x20, 0x20, 0x05, 0x00, 0x15,0xA7,
|
||||
0x3D, 0x18, 0x25, 0x2A, 0x2B, 0x2B, 0x3A, // Negative Gamma
|
||||
0xB1, 2, 0x08, 0x08, // Frame rate control 1
|
||||
0xB4, 1, 0x07, // Display inversion
|
||||
0xC0, 2, 0x0A, 0x02, // Power control 1
|
||||
0xC1, 1, 0x02, // Power control 2
|
||||
0xC5, 2, 0x50, 0x5B, // Vcom control 1
|
||||
0xC7, 1, 0x40, // Vcom offset
|
||||
0x2A, 4, 0x00, 0x00, 0x00, 0x7F, // Set column address
|
||||
0x2B, 4 + TFT_INIT_DELAY, 0x00, 0x00, 0x00, 0x9F, 250, // Set page address
|
||||
0x36, 1, 0xC8, // Set address mode
|
||||
0x29, 0, // Set display on
|
||||
};
|
||||
|
||||
commandList(ILI9163_cmds);
|
||||
|
||||
#ifdef CGRAM_OFFSET
|
||||
colstart = 0;
|
||||
rowstart = 0;
|
||||
#endif
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
|
||||
// This is the command sequence that rotates the ILI9163 driver coordinate frame
|
||||
|
||||
rotation = m % 4;
|
||||
|
||||
writecommand(TFT_MADCTL);
|
||||
switch (rotation) {
|
||||
case 0:
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_BGR);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
#ifdef CGRAM_OFFSET
|
||||
colstart = 0;
|
||||
rowstart = 0;
|
||||
#endif
|
||||
break;
|
||||
case 1:
|
||||
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_BGR);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
#ifdef CGRAM_OFFSET
|
||||
colstart = 0;
|
||||
rowstart = 0;
|
||||
#endif
|
||||
break;
|
||||
case 2:
|
||||
writedata(TFT_MAD_BGR);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
#ifdef CGRAM_OFFSET
|
||||
colstart = 0;
|
||||
rowstart = 32;
|
||||
#endif
|
||||
break;
|
||||
case 3:
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_BGR);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
#ifdef CGRAM_OFFSET
|
||||
colstart = 32;
|
||||
rowstart = 0;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
// Change the width and height if required (defined in portrait mode)
|
||||
// or use the constructor to over-ride defaults
|
||||
#define TFT_WIDTH 176
|
||||
#define TFT_HEIGHT 220
|
||||
|
||||
// Generic commands used by TFT_eSPI.cpp
|
||||
#define TFT_NOP 0x00
|
||||
#define TFT_SWRST 0x28
|
||||
|
||||
#define TFT_CASET 0
|
||||
#define TFT_PASET 0
|
||||
|
||||
#define TFT_CASET1 ILI9225_HORIZONTAL_WINDOW_ADDR2
|
||||
#define TFT_CASET2 ILI9225_HORIZONTAL_WINDOW_ADDR1
|
||||
|
||||
#define TFT_PASET1 ILI9225_VERTICAL_WINDOW_ADDR2
|
||||
#define TFT_PASET2 ILI9225_VERTICAL_WINDOW_ADDR1
|
||||
|
||||
#define TFT_RAM_ADDR1 ILI9225_RAM_ADDR_SET1
|
||||
#define TFT_RAM_ADDR2 ILI9225_RAM_ADDR_SET2
|
||||
|
||||
#define TFT_RAMWR ILI9225_GRAM_DATA_REG
|
||||
|
||||
#define TFT_MAD_BGR 0x10
|
||||
#define TFT_MAD_RGB 0x00
|
||||
|
||||
#ifdef TFT_RGB_ORDER
|
||||
#if (TFT_RGB_ORDER == 1)
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
|
||||
#else
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
|
||||
#endif
|
||||
#else
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
|
||||
#endif
|
||||
|
||||
// Not used
|
||||
#define TFT_INVOFF 0x00
|
||||
#define TFT_INVON 0x00
|
||||
#define TFT_RAMRD 0x00
|
||||
#define TFT_IDXRD 0x00
|
||||
|
||||
/* ILI9225 Registers */
|
||||
#define ILI9225_DRIVER_OUTPUT_CTRL 0x01 // Driver Output Control
|
||||
#define ILI9225_LCD_AC_DRIVING_CTRL 0x02 // LCD AC Driving Control
|
||||
#define ILI9225_ENTRY_MODE 0x03 // Entry Mode
|
||||
#define ILI9225_DISP_CTRL1 0x07 // Display Control 1
|
||||
#define ILI9225_BLANK_PERIOD_CTRL1 0x08 // Blank Period Control
|
||||
#define ILI9225_FRAME_CYCLE_CTRL 0x0B // Frame Cycle Control
|
||||
#define ILI9225_INTERFACE_CTRL 0x0C // Interface Control
|
||||
#define ILI9225_OSC_CTRL 0x0F // Osc Control
|
||||
#define ILI9225_POWER_CTRL1 0x10 // Power Control 1
|
||||
#define ILI9225_POWER_CTRL2 0x11 // Power Control 2
|
||||
#define ILI9225_POWER_CTRL3 0x12 // Power Control 3
|
||||
#define ILI9225_POWER_CTRL4 0x13 // Power Control 4
|
||||
#define ILI9225_POWER_CTRL5 0x14 // Power Control 5
|
||||
#define ILI9225_VCI_RECYCLING 0x15 // VCI Recycling
|
||||
#define ILI9225_RAM_ADDR_SET1 0x20 // Horizontal GRAM Address Set
|
||||
#define ILI9225_RAM_ADDR_SET2 0x21 // Vertical GRAM Address Set
|
||||
#define ILI9225_GRAM_DATA_REG 0x22 // GRAM Data Register
|
||||
#define ILI9225_GATE_SCAN_CTRL 0x30 // Gate Scan Control Register
|
||||
#define ILI9225_VERTICAL_SCROLL_CTRL1 0x31 // Vertical Scroll Control 1 Register
|
||||
#define ILI9225_VERTICAL_SCROLL_CTRL2 0x32 // Vertical Scroll Control 2 Register
|
||||
#define ILI9225_VERTICAL_SCROLL_CTRL3 0x33 // Vertical Scroll Control 3 Register
|
||||
#define ILI9225_PARTIAL_DRIVING_POS1 0x34 // Partial Driving Position 1 Register
|
||||
#define ILI9225_PARTIAL_DRIVING_POS2 0x35 // Partial Driving Position 2 Register
|
||||
#define ILI9225_HORIZONTAL_WINDOW_ADDR1 0x36 // Horizontal Address Start Position
|
||||
#define ILI9225_HORIZONTAL_WINDOW_ADDR2 0x37 // Horizontal Address End Position
|
||||
#define ILI9225_VERTICAL_WINDOW_ADDR1 0x38 // Vertical Address Start Position
|
||||
#define ILI9225_VERTICAL_WINDOW_ADDR2 0x39 // Vertical Address End Position
|
||||
#define ILI9225_GAMMA_CTRL1 0x50 // Gamma Control 1
|
||||
#define ILI9225_GAMMA_CTRL2 0x51 // Gamma Control 2
|
||||
#define ILI9225_GAMMA_CTRL3 0x52 // Gamma Control 3
|
||||
#define ILI9225_GAMMA_CTRL4 0x53 // Gamma Control 4
|
||||
#define ILI9225_GAMMA_CTRL5 0x54 // Gamma Control 5
|
||||
#define ILI9225_GAMMA_CTRL6 0x55 // Gamma Control 6
|
||||
#define ILI9225_GAMMA_CTRL7 0x56 // Gamma Control 7
|
||||
#define ILI9225_GAMMA_CTRL8 0x57 // Gamma Control 8
|
||||
#define ILI9225_GAMMA_CTRL9 0x58 // Gamma Control 9
|
||||
#define ILI9225_GAMMA_CTRL10 0x59 // Gamma Control 10
|
||||
|
||||
// Delay between some initialisation commands
|
||||
#define TFT_INIT_DELAY 0x00 // Not used unless commandlist invoked
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
// This is the command sequence that initialises the ILI9225 driver
|
||||
|
||||
{
|
||||
writecommand(ILI9225_POWER_CTRL1);
|
||||
writedata(0x00);writedata(0x00);
|
||||
writecommand(ILI9225_POWER_CTRL2);
|
||||
writedata(0x00);writedata(0x00);
|
||||
writecommand(ILI9225_POWER_CTRL3);
|
||||
writedata(0x00);writedata(0x00);
|
||||
writecommand(ILI9225_POWER_CTRL4);
|
||||
writedata(0x00);writedata(0x00);
|
||||
writecommand(ILI9225_POWER_CTRL5);
|
||||
writedata(0x00);writedata(0x00);
|
||||
|
||||
delay(40);
|
||||
|
||||
writecommand(ILI9225_POWER_CTRL2);
|
||||
writedata(0x00);writedata(0x18);
|
||||
writecommand(ILI9225_POWER_CTRL3);
|
||||
writedata(0x61);writedata(0x21);
|
||||
writecommand(ILI9225_POWER_CTRL4);
|
||||
writedata(0x00);writedata(0x6F);
|
||||
writecommand(ILI9225_POWER_CTRL5);
|
||||
writedata(0x49);writedata(0x5F);
|
||||
writecommand(ILI9225_POWER_CTRL1);
|
||||
writedata(0x08);writedata(0x00);
|
||||
|
||||
delay(10);
|
||||
|
||||
writecommand(ILI9225_POWER_CTRL2);
|
||||
writedata(0x10);writedata(0x3B);
|
||||
|
||||
delay(50);
|
||||
|
||||
writecommand(ILI9225_LCD_AC_DRIVING_CTRL);
|
||||
writedata(0x01);writedata(0x00);
|
||||
writecommand(ILI9225_DISP_CTRL1);
|
||||
writedata(0x00);writedata(0x00);
|
||||
writecommand(ILI9225_BLANK_PERIOD_CTRL1);
|
||||
writedata(0x08);writedata(0x08);
|
||||
writecommand(ILI9225_FRAME_CYCLE_CTRL);
|
||||
writedata(0x11);writedata(0x00);
|
||||
writecommand(ILI9225_INTERFACE_CTRL);
|
||||
writedata(0x00);writedata(0x00);
|
||||
writecommand(ILI9225_OSC_CTRL);
|
||||
writedata(0x0D);writedata(0x01);
|
||||
writecommand(ILI9225_VCI_RECYCLING);
|
||||
writedata(0x00);writedata(0x20);
|
||||
writecommand(ILI9225_RAM_ADDR_SET1);
|
||||
writedata(0x00);writedata(0x00);
|
||||
writecommand(ILI9225_RAM_ADDR_SET2);
|
||||
writedata(0x00);writedata(0x00);
|
||||
|
||||
writecommand(ILI9225_GATE_SCAN_CTRL);
|
||||
writedata(0x00);writedata(0x00);
|
||||
writecommand(ILI9225_VERTICAL_SCROLL_CTRL1);
|
||||
writedata(0x00);writedata(0xDB);
|
||||
writecommand(ILI9225_VERTICAL_SCROLL_CTRL2);
|
||||
writedata(0x00);writedata(0x00);
|
||||
writecommand(ILI9225_VERTICAL_SCROLL_CTRL3);
|
||||
writedata(0x00);writedata(0x00);
|
||||
writecommand(ILI9225_PARTIAL_DRIVING_POS1);
|
||||
writedata(0x00);writedata(0xDB);
|
||||
writecommand(ILI9225_PARTIAL_DRIVING_POS2);
|
||||
writedata(0x00);writedata(0x00);
|
||||
writecommand(ILI9225_HORIZONTAL_WINDOW_ADDR1);
|
||||
writedata(0x00);writedata(0xAF);
|
||||
writecommand(ILI9225_HORIZONTAL_WINDOW_ADDR2);
|
||||
writedata(0x00);writedata(0x00);
|
||||
writecommand(ILI9225_VERTICAL_WINDOW_ADDR1);
|
||||
writedata(0x00);writedata(0xDB);
|
||||
writecommand(ILI9225_VERTICAL_WINDOW_ADDR2);
|
||||
writedata(0x00);writedata(0x00);
|
||||
|
||||
/* Set GAMMA curve */
|
||||
writecommand(ILI9225_GAMMA_CTRL1);
|
||||
writedata(0x00);writedata(0x00);
|
||||
writecommand(ILI9225_GAMMA_CTRL2);
|
||||
writedata(0x08);writedata(0x08);
|
||||
writecommand(ILI9225_GAMMA_CTRL3);
|
||||
writedata(0x08);writedata(0x0A);
|
||||
writecommand(ILI9225_GAMMA_CTRL4);
|
||||
writedata(0x00);writedata(0x0A);
|
||||
writecommand(ILI9225_GAMMA_CTRL5);
|
||||
writedata(0x0A);writedata(0x08);
|
||||
writecommand(ILI9225_GAMMA_CTRL6);
|
||||
writedata(0x08);writedata(0x08);
|
||||
writecommand(ILI9225_GAMMA_CTRL7);
|
||||
writedata(0x00);writedata(0x00);
|
||||
writecommand(ILI9225_GAMMA_CTRL8);
|
||||
writedata(0x0A);writedata(0x00);
|
||||
writecommand(ILI9225_GAMMA_CTRL9);
|
||||
writedata(0x07);writedata(0x10);
|
||||
writecommand(ILI9225_GAMMA_CTRL10);
|
||||
writedata(0x07);writedata(0x10);
|
||||
|
||||
writecommand(ILI9225_DISP_CTRL1);
|
||||
writedata(0x00);writedata(0x12);
|
||||
|
||||
delay(50);
|
||||
|
||||
writecommand(ILI9225_DISP_CTRL1);
|
||||
writedata(0x10);writedata(0x17);
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
|
||||
// This is the command sequence that rotates the ILI9225 driver coordinate frame
|
||||
|
||||
rotation = m % 4; // Limit the range of values to 0-3
|
||||
|
||||
switch (rotation) {
|
||||
case 0:
|
||||
writecommand(ILI9225_DRIVER_OUTPUT_CTRL);
|
||||
writedata(0x01);writedata(0x1C);
|
||||
writecommand(ILI9225_ENTRY_MODE);
|
||||
writedata(TFT_MAD_COLOR_ORDER);writedata(0x30);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 1:
|
||||
writecommand(ILI9225_DRIVER_OUTPUT_CTRL);
|
||||
writedata(0x00);writedata(0x1C);
|
||||
writecommand(ILI9225_ENTRY_MODE);
|
||||
writedata(TFT_MAD_COLOR_ORDER);writedata(0x38);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
case 2:
|
||||
writecommand(ILI9225_DRIVER_OUTPUT_CTRL);
|
||||
writedata(0x02);writedata(0x1C);
|
||||
writecommand(ILI9225_ENTRY_MODE);
|
||||
writedata(TFT_MAD_COLOR_ORDER);writedata(0x30);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 3:
|
||||
writecommand(ILI9225_DRIVER_OUTPUT_CTRL);
|
||||
writedata(0x03);writedata(0x1C);
|
||||
writecommand(ILI9225_ENTRY_MODE);
|
||||
writedata(TFT_MAD_COLOR_ORDER);writedata(0x38);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
// Change the width and height if required (defined in portrait mode)
|
||||
// or use the constructor to over-ride defaults
|
||||
#define TFT_WIDTH 320
|
||||
#define TFT_HEIGHT 480
|
||||
|
||||
// For Raspberry Pi ILI9486 only with a modified board to add a write strobe:
|
||||
#if defined (TFT_WR) && defined (RPI_ILI9486_DRIVER)
|
||||
#define RPI_WRITE_STROBE
|
||||
#endif
|
||||
|
||||
// Color definitions for backwards compatibility with old sketches
|
||||
// use colour definitions like TFT_BLACK to make sketches more portable
|
||||
#define ILI9486_BLACK 0x0000 /* 0, 0, 0 */
|
||||
#define ILI9486_NAVY 0x000F /* 0, 0, 128 */
|
||||
#define ILI9486_DARKGREEN 0x03E0 /* 0, 128, 0 */
|
||||
#define ILI9486_DARKCYAN 0x03EF /* 0, 128, 128 */
|
||||
#define ILI9486_MAROON 0x7800 /* 128, 0, 0 */
|
||||
#define ILI9486_PURPLE 0x780F /* 128, 0, 128 */
|
||||
#define ILI9486_OLIVE 0x7BE0 /* 128, 128, 0 */
|
||||
#define ILI9486_LIGHTGREY 0xC618 /* 192, 192, 192 */
|
||||
#define ILI9486_DARKGREY 0x7BEF /* 128, 128, 128 */
|
||||
#define ILI9486_BLUE 0x001F /* 0, 0, 255 */
|
||||
#define ILI9486_GREEN 0x07E0 /* 0, 255, 0 */
|
||||
#define ILI9486_CYAN 0x07FF /* 0, 255, 255 */
|
||||
#define ILI9486_RED 0xF800 /* 255, 0, 0 */
|
||||
#define ILI9486_MAGENTA 0xF81F /* 255, 0, 255 */
|
||||
#define ILI9486_YELLOW 0xFFE0 /* 255, 255, 0 */
|
||||
#define ILI9486_WHITE 0xFFFF /* 255, 255, 255 */
|
||||
#define ILI9486_ORANGE 0xFD20 /* 255, 165, 0 */
|
||||
#define ILI9486_GREENYELLOW 0xAFE5 /* 173, 255, 47 */
|
||||
#define ILI9486_PINK 0xF81F
|
||||
|
||||
|
||||
// Delay between some initialisation commands
|
||||
#define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
|
||||
|
||||
|
||||
// Generic commands used by TFT_eSPI.cpp
|
||||
#define TFT_NOP 0x00
|
||||
#define TFT_SWRST 0x01
|
||||
|
||||
#define TFT_INVOFF 0x20
|
||||
#define TFT_INVON 0x21
|
||||
|
||||
#define TFT_DISPOFF 0x28
|
||||
#define TFT_DISPON 0x29
|
||||
|
||||
#define TFT_CASET 0x2A
|
||||
#define TFT_PASET 0x2B
|
||||
#define TFT_RAMWR 0x2C
|
||||
|
||||
#define TFT_RAMRD 0x2E
|
||||
#define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read
|
||||
|
||||
#define TFT_MADCTL 0x36
|
||||
#define TFT_MAD_MY 0x80
|
||||
#define TFT_MAD_MX 0x40
|
||||
#define TFT_MAD_MV 0x20
|
||||
#define TFT_MAD_ML 0x10
|
||||
#define TFT_MAD_BGR 0x08
|
||||
#define TFT_MAD_MH 0x04
|
||||
#define TFT_MAD_SS 0x02
|
||||
#define TFT_MAD_GS 0x01
|
||||
#define TFT_MAD_RGB 0x00
|
||||
@@ -1,84 +0,0 @@
|
||||
|
||||
// This is the command sequence that initialises the ILI9486 driver
|
||||
//
|
||||
// This setup information uses simple 8-bit SPI writecommand() and writedata() functions
|
||||
//
|
||||
// See ST7735_Setup.h file for an alternative format
|
||||
|
||||
{
|
||||
// From https://github.com/notro/fbtft/blob/master/fb_ili9486.c
|
||||
|
||||
writecommand(0x01); // SW reset
|
||||
delay(120);
|
||||
|
||||
writecommand(0x11); // Sleep out, also SW reset
|
||||
delay(120);
|
||||
|
||||
writecommand(0x3A);
|
||||
#if defined (TFT_PARALLEL_8_BIT) || defined (TFT_PARALLEL_16_BIT) || defined (RPI_DISPLAY_TYPE)
|
||||
writedata(0x55); // 16-bit colour interface
|
||||
#else
|
||||
writedata(0x66); // 18-bit colour interface
|
||||
#endif
|
||||
|
||||
writecommand(0xC0); // 1100.0000 Power Control 1
|
||||
writedata(0x0E); // 0001.0111 ... VRH1
|
||||
writedata(0x0E); // 0001.0101 ... VRH2
|
||||
writecommand(0xC1); // 1100.0001 Power Control 2
|
||||
writedata(0x41); // 0100.0001 . SAP BT
|
||||
writedata(0x00); // 0000.0000 ..... VC
|
||||
writecommand(0xC2); // 1100.0010 Power Control 3
|
||||
writedata(0x55); // nb. was 0x44 0101.0101 . DCA1 . DCA0
|
||||
|
||||
writecommand(0xC5);
|
||||
writedata(0x00);
|
||||
writedata(0x00);
|
||||
writedata(0x00);
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(0xE0);
|
||||
writedata(0x0F);
|
||||
writedata(0x1F);
|
||||
writedata(0x1C);
|
||||
writedata(0x0C);
|
||||
writedata(0x0F);
|
||||
writedata(0x08);
|
||||
writedata(0x48);
|
||||
writedata(0x98);
|
||||
writedata(0x37);
|
||||
writedata(0x0A);
|
||||
writedata(0x13);
|
||||
writedata(0x04);
|
||||
writedata(0x11);
|
||||
writedata(0x0D);
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(0xE1);
|
||||
writedata(0x0F);
|
||||
writedata(0x32);
|
||||
writedata(0x2E);
|
||||
writedata(0x0B);
|
||||
writedata(0x0D);
|
||||
writedata(0x05);
|
||||
writedata(0x47);
|
||||
writedata(0x75);
|
||||
writedata(0x37);
|
||||
writedata(0x06);
|
||||
writedata(0x10);
|
||||
writedata(0x03);
|
||||
writedata(0x24);
|
||||
writedata(0x20);
|
||||
writedata(0x00);
|
||||
|
||||
#if defined (TFT_PARALLEL_8_BIT) || defined (TFT_PARALLEL_16_BIT) || defined (RPI_DISPLAY_TYPE)
|
||||
writecommand(TFT_INVOFF);
|
||||
#else
|
||||
writecommand(TFT_INVON);
|
||||
#endif
|
||||
|
||||
writecommand(0x36);
|
||||
writedata(0x48);
|
||||
|
||||
writecommand(0x29); // display on
|
||||
delay(150);
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
// This is the command sequence that rotates the ILI9486 driver coordinate frame
|
||||
|
||||
writecommand(TFT_MADCTL);
|
||||
rotation = m % 8;
|
||||
switch (rotation) {
|
||||
case 0: // Portrait
|
||||
writedata(TFT_MAD_BGR | TFT_MAD_MX);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 1: // Landscape (Portrait + 90)
|
||||
writedata(TFT_MAD_BGR | TFT_MAD_MV);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
case 2: // Inverter portrait
|
||||
writedata( TFT_MAD_BGR | TFT_MAD_MY);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 3: // Inverted landscape
|
||||
writedata(TFT_MAD_BGR | TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_MY);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
case 4: // Portrait
|
||||
writedata(TFT_MAD_BGR | TFT_MAD_MX | TFT_MAD_MY);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 5: // Landscape (Portrait + 90)
|
||||
writedata(TFT_MAD_BGR | TFT_MAD_MV | TFT_MAD_MX);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
case 6: // Inverter portrait
|
||||
writedata( TFT_MAD_BGR);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 7: // Inverted landscape
|
||||
writedata(TFT_MAD_BGR | TFT_MAD_MV | TFT_MAD_MY);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
// Change the width and height if required (defined in portrait mode)
|
||||
// or use the constructor to over-ride defaults
|
||||
#define TFT_WIDTH 320
|
||||
#define TFT_HEIGHT 480
|
||||
|
||||
|
||||
// Delay between some initialisation commands
|
||||
#define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
|
||||
|
||||
|
||||
// Generic commands used by TFT_eSPI.cpp
|
||||
#define TFT_NOP 0x00
|
||||
#define TFT_SWRST 0x01
|
||||
|
||||
#define TFT_SLPIN 0x10
|
||||
#define TFT_SLPOUT 0x11
|
||||
|
||||
#define TFT_INVOFF 0x20
|
||||
#define TFT_INVON 0x21
|
||||
|
||||
#define TFT_DISPOFF 0x28
|
||||
#define TFT_DISPON 0x29
|
||||
|
||||
#define TFT_CASET 0x2A
|
||||
#define TFT_PASET 0x2B
|
||||
#define TFT_RAMWR 0x2C
|
||||
|
||||
#define TFT_RAMRD 0x2E
|
||||
|
||||
#define TFT_MADCTL 0x36
|
||||
|
||||
#define TFT_MAD_MY 0x80
|
||||
#define TFT_MAD_MX 0x40
|
||||
#define TFT_MAD_MV 0x20
|
||||
#define TFT_MAD_ML 0x10
|
||||
#define TFT_MAD_RGB 0x00
|
||||
#define TFT_MAD_BGR 0x08
|
||||
#define TFT_MAD_MH 0x04
|
||||
#define TFT_MAD_SS 0x02
|
||||
#define TFT_MAD_GS 0x01
|
||||
|
||||
#define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read
|
||||
@@ -1,99 +0,0 @@
|
||||
|
||||
// This is the command sequence that initialises the ILI9488 driver
|
||||
//
|
||||
// This setup information uses simple 8-bit SPI writecommand() and writedata() functions
|
||||
//
|
||||
// See ST7735_Setup.h file for an alternative format
|
||||
|
||||
|
||||
// Configure ILI9488 display
|
||||
|
||||
writecommand(0xE0); // Positive Gamma Control
|
||||
writedata(0x00);
|
||||
writedata(0x03);
|
||||
writedata(0x09);
|
||||
writedata(0x08);
|
||||
writedata(0x16);
|
||||
writedata(0x0A);
|
||||
writedata(0x3F);
|
||||
writedata(0x78);
|
||||
writedata(0x4C);
|
||||
writedata(0x09);
|
||||
writedata(0x0A);
|
||||
writedata(0x08);
|
||||
writedata(0x16);
|
||||
writedata(0x1A);
|
||||
writedata(0x0F);
|
||||
|
||||
writecommand(0XE1); // Negative Gamma Control
|
||||
writedata(0x00);
|
||||
writedata(0x16);
|
||||
writedata(0x19);
|
||||
writedata(0x03);
|
||||
writedata(0x0F);
|
||||
writedata(0x05);
|
||||
writedata(0x32);
|
||||
writedata(0x45);
|
||||
writedata(0x46);
|
||||
writedata(0x04);
|
||||
writedata(0x0E);
|
||||
writedata(0x0D);
|
||||
writedata(0x35);
|
||||
writedata(0x37);
|
||||
writedata(0x0F);
|
||||
|
||||
writecommand(0XC0); // Power Control 1
|
||||
writedata(0x17);
|
||||
writedata(0x15);
|
||||
|
||||
writecommand(0xC1); // Power Control 2
|
||||
writedata(0x41);
|
||||
|
||||
writecommand(0xC5); // VCOM Control
|
||||
writedata(0x00);
|
||||
writedata(0x12);
|
||||
writedata(0x80);
|
||||
|
||||
writecommand(TFT_MADCTL); // Memory Access Control
|
||||
writedata(0x48); // MX, BGR
|
||||
|
||||
writecommand(0x3A); // Pixel Interface Format
|
||||
#if defined (TFT_PARALLEL_8_BIT) || defined (TFT_PARALLEL_16_BIT) || defined (RPI_DISPLAY_TYPE)
|
||||
writedata(0x55); // 16-bit colour for parallel
|
||||
#else
|
||||
writedata(0x66); // 18-bit colour for SPI
|
||||
#endif
|
||||
|
||||
writecommand(0xB0); // Interface Mode Control
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(0xB1); // Frame Rate Control
|
||||
writedata(0xA0);
|
||||
|
||||
writecommand(0xB4); // Display Inversion Control
|
||||
writedata(0x02);
|
||||
|
||||
writecommand(0xB6); // Display Function Control
|
||||
writedata(0x02);
|
||||
writedata(0x02);
|
||||
writedata(0x3B);
|
||||
|
||||
writecommand(0xB7); // Entry Mode Set
|
||||
writedata(0xC6);
|
||||
|
||||
writecommand(0xF7); // Adjust Control 3
|
||||
writedata(0xA9);
|
||||
writedata(0x51);
|
||||
writedata(0x2C);
|
||||
writedata(0x82);
|
||||
|
||||
writecommand(TFT_SLPOUT); //Exit Sleep
|
||||
delay(120);
|
||||
|
||||
writecommand(TFT_DISPON); //Display on
|
||||
delay(25);
|
||||
|
||||
// End of ILI9488 display configuration
|
||||
|
||||
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
// This is the command sequence that rotates the ILI9488 driver coordinate frame
|
||||
|
||||
writecommand(TFT_MADCTL);
|
||||
rotation = m % 4;
|
||||
switch (rotation) {
|
||||
case 0: // Portrait
|
||||
writedata(TFT_MAD_MX | TFT_MAD_BGR);
|
||||
_width = TFT_WIDTH;
|
||||
_height = TFT_HEIGHT;
|
||||
break;
|
||||
case 1: // Landscape (Portrait + 90)
|
||||
writedata(TFT_MAD_MV | TFT_MAD_BGR);
|
||||
_width = TFT_HEIGHT;
|
||||
_height = TFT_WIDTH;
|
||||
break;
|
||||
case 2: // Inverter portrait
|
||||
writedata(TFT_MAD_MY | TFT_MAD_BGR);
|
||||
_width = TFT_WIDTH;
|
||||
_height = TFT_HEIGHT;
|
||||
break;
|
||||
case 3: // Inverted landscape
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_MV | TFT_MAD_BGR);
|
||||
_width = TFT_HEIGHT;
|
||||
_height = TFT_WIDTH;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
// Change the width and height if required (defined in portrait mode)
|
||||
// or use the constructor to over-ride defaults
|
||||
#define TFT_WIDTH 320
|
||||
#define TFT_HEIGHT 480
|
||||
|
||||
|
||||
// Delay between some initialisation commands
|
||||
#define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
|
||||
|
||||
|
||||
// Generic commands used by TFT_eSPI.cpp
|
||||
#define TFT_NOP 0x00
|
||||
#define TFT_SWRST 0x01
|
||||
|
||||
#define TFT_SLPIN 0x10
|
||||
#define TFT_SLPOUT 0x11
|
||||
|
||||
#define TFT_INVOFF 0x20
|
||||
#define TFT_INVON 0x21
|
||||
|
||||
#define TFT_DISPOFF 0x28
|
||||
#define TFT_DISPON 0x29
|
||||
|
||||
#define TFT_CASET 0x2A
|
||||
#define TFT_PASET 0x2B
|
||||
#define TFT_RAMWR 0x2C
|
||||
|
||||
#define TFT_RAMRD 0x2E
|
||||
|
||||
#define TFT_MADCTL 0x36
|
||||
|
||||
#define TFT_MAD_MY 0x80
|
||||
#define TFT_MAD_MX 0x40
|
||||
#define TFT_MAD_MV 0x20
|
||||
#define TFT_MAD_ML 0x10
|
||||
#define TFT_MAD_RGB 0x00
|
||||
#define TFT_MAD_BGR 0x08
|
||||
#define TFT_MAD_MH 0x04
|
||||
#define TFT_MAD_SS 0x02
|
||||
#define TFT_MAD_GS 0x01
|
||||
|
||||
#define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read
|
||||
@@ -1,80 +0,0 @@
|
||||
|
||||
// This is the command sequence that initialises the R61581 driver
|
||||
//
|
||||
// This setup information uses simple 8-bit SPI writecommand() and writedata() functions
|
||||
//
|
||||
// See ST7735_Setup.h file for an alternative format
|
||||
|
||||
|
||||
// Configure R61581 display
|
||||
|
||||
writecommand(TFT_SLPOUT);
|
||||
delay(20);
|
||||
|
||||
writecommand(0xB0);
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(0xD0);
|
||||
writedata(0x07);
|
||||
writedata(0x42);
|
||||
writedata(0x18);
|
||||
|
||||
writecommand(0xD1);
|
||||
writedata(0x00);
|
||||
writedata(0x07);
|
||||
writedata(0x10);
|
||||
|
||||
writecommand(0xD2);
|
||||
writedata(0x01);
|
||||
writedata(0x02);
|
||||
|
||||
writecommand(0xC0);
|
||||
writedata(0x12);
|
||||
writedata(0x3B);
|
||||
writedata(0x00);
|
||||
writedata(0x02);
|
||||
writedata(0x11);
|
||||
|
||||
writecommand(0xC5);
|
||||
writedata(0x03);
|
||||
|
||||
writecommand(0xC8);
|
||||
writedata(0x00);
|
||||
writedata(0x32);
|
||||
writedata(0x36);
|
||||
writedata(0x45);
|
||||
writedata(0x06);
|
||||
writedata(0x16);
|
||||
writedata(0x37);
|
||||
writedata(0x75);
|
||||
writedata(0x77);
|
||||
writedata(0x54);
|
||||
writedata(0x0C);
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(TFT_MADCTL);
|
||||
writedata(0x0A);
|
||||
|
||||
writecommand(0x3A);
|
||||
writedata(0x55);
|
||||
|
||||
writecommand(TFT_CASET);
|
||||
writedata(0x00);
|
||||
writedata(0x00);
|
||||
writedata(0x01);
|
||||
writedata(0x3F);
|
||||
|
||||
writecommand(TFT_PASET);
|
||||
writedata(0x00);
|
||||
writedata(0x00);
|
||||
writedata(0x01);
|
||||
writedata(0xDF);
|
||||
|
||||
delay(120);
|
||||
writecommand(TFT_DISPON);
|
||||
|
||||
delay(25);
|
||||
// End of R61581 display configuration
|
||||
|
||||
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
// This is the command sequence that rotates the R61581 driver coordinate frame
|
||||
|
||||
writecommand(TFT_MADCTL);
|
||||
rotation = m % 4;
|
||||
switch (rotation) {
|
||||
case 0: // Portrait
|
||||
writedata(TFT_MAD_BGR | TFT_MAD_MX);
|
||||
_width = TFT_WIDTH;
|
||||
_height = TFT_HEIGHT;
|
||||
break;
|
||||
case 1: // Landscape (Portrait + 90)
|
||||
writedata(TFT_MAD_MV | TFT_MAD_BGR);
|
||||
_width = TFT_HEIGHT;
|
||||
_height = TFT_WIDTH;
|
||||
break;
|
||||
case 2: // Inverter portrait
|
||||
writedata(TFT_MAD_BGR | TFT_MAD_GS);
|
||||
_width = TFT_WIDTH;
|
||||
_height = TFT_HEIGHT;
|
||||
break;
|
||||
case 3: // Inverted landscape
|
||||
writedata(TFT_MAD_MV | TFT_MAD_BGR | TFT_MAD_MX | TFT_MAD_GS);
|
||||
_width = TFT_HEIGHT;
|
||||
_height = TFT_WIDTH;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
// Change the width and height if required (defined in portrait mode)
|
||||
// or use the constructor to over-ride defaults
|
||||
// RM68120_DRIVER
|
||||
|
||||
#define TFT_WIDTH 480
|
||||
#define TFT_HEIGHT 800
|
||||
|
||||
//Set driver type common to all TBD initialisation options
|
||||
#ifndef RM68120_DRIVER
|
||||
#define RM68120_DRIVER
|
||||
#endif
|
||||
|
||||
// Delay between some initialisation commands
|
||||
#define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
|
||||
|
||||
// Generic commands used by TFT_eSPI.cpp
|
||||
#define TFT_NOP 0x0000
|
||||
#define TFT_SWRST 0x0100
|
||||
|
||||
#define TFT_INVOFF 0x2000
|
||||
#define TFT_INVON 0x2100
|
||||
|
||||
#define TFT_DISPOFF 0x2800
|
||||
#define TFT_DISPON 0x2900
|
||||
|
||||
#define TFT_CASET 0x2A00
|
||||
#define TFT_PASET 0x2B00
|
||||
#define TFT_RAMWR 0x2C00
|
||||
|
||||
#define TFT_RAMRD 0x2E00
|
||||
#define TFT_IDXRD 0xDD00 // ILI9341 only, indexed control register read
|
||||
|
||||
#define TFT_MADCTL 0x3600
|
||||
#define TFT_MAD_MY 0x80
|
||||
#define TFT_MAD_MX 0x40
|
||||
#define TFT_MAD_MV 0x20
|
||||
#define TFT_MAD_ML 0x10
|
||||
#define TFT_MAD_BGR 0x08
|
||||
#define TFT_MAD_RGB 0x00
|
||||
#define TFT_MAD_MH 0x04
|
||||
#define TFT_MAD_H_FLIP 0x02
|
||||
#define TFT_MAD_V_FLIP 0x01
|
||||
|
||||
#ifdef TFT_RGB_ORDER
|
||||
#if (TFT_RGB_ORDER == 1)
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
|
||||
#else
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
|
||||
#endif
|
||||
#else
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
|
||||
#endif
|
||||
@@ -1,269 +0,0 @@
|
||||
// Initialisation for RM68120
|
||||
|
||||
//ENABLE PAGE 1
|
||||
writeRegister8(0xF000, 0x55);
|
||||
writeRegister8(0xF001, 0xAA);
|
||||
writeRegister8(0xF002, 0x52);
|
||||
writeRegister8(0xF003, 0x08);
|
||||
writeRegister8(0xF004, 0x01);
|
||||
|
||||
//GAMMA SETING RED
|
||||
writeRegister8(0xD400, 0x00);
|
||||
writeRegister8(0xD401, 0x00);
|
||||
writeRegister8(0xD402, 0x1b);
|
||||
writeRegister8(0xD403, 0x44);
|
||||
writeRegister8(0xD404, 0x62);
|
||||
writeRegister8(0xD405, 0x00);
|
||||
writeRegister8(0xD406, 0x7b);
|
||||
writeRegister8(0xD407, 0xa1);
|
||||
writeRegister8(0xD408, 0xc0);
|
||||
writeRegister8(0xD409, 0xee);
|
||||
writeRegister8(0xD40A, 0x55);
|
||||
writeRegister8(0xD40B, 0x10);
|
||||
writeRegister8(0xD40C, 0x2c);
|
||||
writeRegister8(0xD40D, 0x43);
|
||||
writeRegister8(0xD40E, 0x57);
|
||||
writeRegister8(0xD40F, 0x55);
|
||||
writeRegister8(0xD410, 0x68);
|
||||
writeRegister8(0xD411, 0x78);
|
||||
writeRegister8(0xD412, 0x87);
|
||||
writeRegister8(0xD413, 0x94);
|
||||
writeRegister8(0xD414, 0x55);
|
||||
writeRegister8(0xD415, 0xa0);
|
||||
writeRegister8(0xD416, 0xac);
|
||||
writeRegister8(0xD417, 0xb6);
|
||||
writeRegister8(0xD418, 0xc1);
|
||||
writeRegister8(0xD419, 0x55);
|
||||
writeRegister8(0xD41A, 0xcb);
|
||||
writeRegister8(0xD41B, 0xcd);
|
||||
writeRegister8(0xD41C, 0xd6);
|
||||
writeRegister8(0xD41D, 0xdf);
|
||||
writeRegister8(0xD41E, 0x95);
|
||||
writeRegister8(0xD41F, 0xe8);
|
||||
writeRegister8(0xD420, 0xf1);
|
||||
writeRegister8(0xD421, 0xfa);
|
||||
writeRegister8(0xD422, 0x02);
|
||||
writeRegister8(0xD423, 0xaa);
|
||||
writeRegister8(0xD424, 0x0b);
|
||||
writeRegister8(0xD425, 0x13);
|
||||
writeRegister8(0xD426, 0x1d);
|
||||
writeRegister8(0xD427, 0x26);
|
||||
writeRegister8(0xD428, 0xaa);
|
||||
writeRegister8(0xD429, 0x30);
|
||||
writeRegister8(0xD42A, 0x3c);
|
||||
writeRegister8(0xD42B, 0x4A);
|
||||
writeRegister8(0xD42C, 0x63);
|
||||
writeRegister8(0xD42D, 0xea);
|
||||
writeRegister8(0xD42E, 0x79);
|
||||
writeRegister8(0xD42F, 0xa6);
|
||||
writeRegister8(0xD430, 0xd0);
|
||||
writeRegister8(0xD431, 0x20);
|
||||
writeRegister8(0xD432, 0x0f);
|
||||
writeRegister8(0xD433, 0x8e);
|
||||
writeRegister8(0xD434, 0xff);
|
||||
|
||||
//GAMMA SETING GREEN
|
||||
writeRegister8(0xD500, 0x00);
|
||||
writeRegister8(0xD501, 0x00);
|
||||
writeRegister8(0xD502, 0x1b);
|
||||
writeRegister8(0xD503, 0x44);
|
||||
writeRegister8(0xD504, 0x62);
|
||||
writeRegister8(0xD505, 0x00);
|
||||
writeRegister8(0xD506, 0x7b);
|
||||
writeRegister8(0xD507, 0xa1);
|
||||
writeRegister8(0xD508, 0xc0);
|
||||
writeRegister8(0xD509, 0xee);
|
||||
writeRegister8(0xD50A, 0x55);
|
||||
writeRegister8(0xD50B, 0x10);
|
||||
writeRegister8(0xD50C, 0x2c);
|
||||
writeRegister8(0xD50D, 0x43);
|
||||
writeRegister8(0xD50E, 0x57);
|
||||
writeRegister8(0xD50F, 0x55);
|
||||
writeRegister8(0xD510, 0x68);
|
||||
writeRegister8(0xD511, 0x78);
|
||||
writeRegister8(0xD512, 0x87);
|
||||
writeRegister8(0xD513, 0x94);
|
||||
writeRegister8(0xD514, 0x55);
|
||||
writeRegister8(0xD515, 0xa0);
|
||||
writeRegister8(0xD516, 0xac);
|
||||
writeRegister8(0xD517, 0xb6);
|
||||
writeRegister8(0xD518, 0xc1);
|
||||
writeRegister8(0xD519, 0x55);
|
||||
writeRegister8(0xD51A, 0xcb);
|
||||
writeRegister8(0xD51B, 0xcd);
|
||||
writeRegister8(0xD51C, 0xd6);
|
||||
writeRegister8(0xD51D, 0xdf);
|
||||
writeRegister8(0xD51E, 0x95);
|
||||
writeRegister8(0xD51F, 0xe8);
|
||||
writeRegister8(0xD520, 0xf1);
|
||||
writeRegister8(0xD521, 0xfa);
|
||||
writeRegister8(0xD522, 0x02);
|
||||
writeRegister8(0xD523, 0xaa);
|
||||
writeRegister8(0xD524, 0x0b);
|
||||
writeRegister8(0xD525, 0x13);
|
||||
writeRegister8(0xD526, 0x1d);
|
||||
writeRegister8(0xD527, 0x26);
|
||||
writeRegister8(0xD528, 0xaa);
|
||||
writeRegister8(0xD529, 0x30);
|
||||
writeRegister8(0xD52A, 0x3c);
|
||||
writeRegister8(0xD52B, 0x4a);
|
||||
writeRegister8(0xD52C, 0x63);
|
||||
writeRegister8(0xD52D, 0xea);
|
||||
writeRegister8(0xD52E, 0x79);
|
||||
writeRegister8(0xD52F, 0xa6);
|
||||
writeRegister8(0xD530, 0xd0);
|
||||
writeRegister8(0xD531, 0x20);
|
||||
writeRegister8(0xD532, 0x0f);
|
||||
writeRegister8(0xD533, 0x8e);
|
||||
writeRegister8(0xD534, 0xff);
|
||||
|
||||
//GAMMA SETING BLUE
|
||||
writeRegister8(0xD600, 0x00);
|
||||
writeRegister8(0xD601, 0x00);
|
||||
writeRegister8(0xD602, 0x1b);
|
||||
writeRegister8(0xD603, 0x44);
|
||||
writeRegister8(0xD604, 0x62);
|
||||
writeRegister8(0xD605, 0x00);
|
||||
writeRegister8(0xD606, 0x7b);
|
||||
writeRegister8(0xD607, 0xa1);
|
||||
writeRegister8(0xD608, 0xc0);
|
||||
writeRegister8(0xD609, 0xee);
|
||||
writeRegister8(0xD60A, 0x55);
|
||||
writeRegister8(0xD60B, 0x10);
|
||||
writeRegister8(0xD60C, 0x2c);
|
||||
writeRegister8(0xD60D, 0x43);
|
||||
writeRegister8(0xD60E, 0x57);
|
||||
writeRegister8(0xD60F, 0x55);
|
||||
writeRegister8(0xD610, 0x68);
|
||||
writeRegister8(0xD611, 0x78);
|
||||
writeRegister8(0xD612, 0x87);
|
||||
writeRegister8(0xD613, 0x94);
|
||||
writeRegister8(0xD614, 0x55);
|
||||
writeRegister8(0xD615, 0xa0);
|
||||
writeRegister8(0xD616, 0xac);
|
||||
writeRegister8(0xD617, 0xb6);
|
||||
writeRegister8(0xD618, 0xc1);
|
||||
writeRegister8(0xD619, 0x55);
|
||||
writeRegister8(0xD61A, 0xcb);
|
||||
writeRegister8(0xD61B, 0xcd);
|
||||
writeRegister8(0xD61C, 0xd6);
|
||||
writeRegister8(0xD61D, 0xdf);
|
||||
writeRegister8(0xD61E, 0x95);
|
||||
writeRegister8(0xD61F, 0xe8);
|
||||
writeRegister8(0xD620, 0xf1);
|
||||
writeRegister8(0xD621, 0xfa);
|
||||
writeRegister8(0xD622, 0x02);
|
||||
writeRegister8(0xD623, 0xaa);
|
||||
writeRegister8(0xD624, 0x0b);
|
||||
writeRegister8(0xD625, 0x13);
|
||||
writeRegister8(0xD626, 0x1d);
|
||||
writeRegister8(0xD627, 0x26);
|
||||
writeRegister8(0xD628, 0xaa);
|
||||
writeRegister8(0xD629, 0x30);
|
||||
writeRegister8(0xD62A, 0x3c);
|
||||
writeRegister8(0xD62B, 0x4A);
|
||||
writeRegister8(0xD62C, 0x63);
|
||||
writeRegister8(0xD62D, 0xea);
|
||||
writeRegister8(0xD62E, 0x79);
|
||||
writeRegister8(0xD62F, 0xa6);
|
||||
writeRegister8(0xD630, 0xd0);
|
||||
writeRegister8(0xD631, 0x20);
|
||||
writeRegister8(0xD632, 0x0f);
|
||||
writeRegister8(0xD633, 0x8e);
|
||||
writeRegister8(0xD634, 0xff);
|
||||
|
||||
//AVDD VOLTAGE SETTING
|
||||
writeRegister8(0xB000, 0x05);
|
||||
writeRegister8(0xB001, 0x05);
|
||||
writeRegister8(0xB002, 0x05);
|
||||
//AVEE VOLTAGE SETTING
|
||||
writeRegister8(0xB100, 0x05);
|
||||
writeRegister8(0xB101, 0x05);
|
||||
writeRegister8(0xB102, 0x05);
|
||||
|
||||
//AVDD Boosting
|
||||
writeRegister8(0xB600, 0x34);
|
||||
writeRegister8(0xB601, 0x34);
|
||||
writeRegister8(0xB603, 0x34);
|
||||
//AVEE Boosting
|
||||
writeRegister8(0xB700, 0x24);
|
||||
writeRegister8(0xB701, 0x24);
|
||||
writeRegister8(0xB702, 0x24);
|
||||
//VCL Boosting
|
||||
writeRegister8(0xB800, 0x24);
|
||||
writeRegister8(0xB801, 0x24);
|
||||
writeRegister8(0xB802, 0x24);
|
||||
//VGLX VOLTAGE SETTING
|
||||
writeRegister8(0xBA00, 0x14);
|
||||
writeRegister8(0xBA01, 0x14);
|
||||
writeRegister8(0xBA02, 0x14);
|
||||
//VCL Boosting
|
||||
writeRegister8(0xB900, 0x24);
|
||||
writeRegister8(0xB901, 0x24);
|
||||
writeRegister8(0xB902, 0x24);
|
||||
//Gamma Voltage
|
||||
writeRegister8(0xBc00, 0x00);
|
||||
writeRegister8(0xBc01, 0xa0);//vgmp=5.0
|
||||
writeRegister8(0xBc02, 0x00);
|
||||
writeRegister8(0xBd00, 0x00);
|
||||
writeRegister8(0xBd01, 0xa0);//vgmn=5.0
|
||||
writeRegister8(0xBd02, 0x00);
|
||||
//VCOM Setting
|
||||
writeRegister8(0xBe01, 0x3d);//3
|
||||
|
||||
//ENABLE PAGE 0
|
||||
writeRegister8(0xF000, 0x55);
|
||||
writeRegister8(0xF001, 0xAA);
|
||||
writeRegister8(0xF002, 0x52);
|
||||
writeRegister8(0xF003, 0x08);
|
||||
writeRegister8(0xF004, 0x00);
|
||||
//Vivid Color Function Control
|
||||
writeRegister8(0xB400, 0x10);
|
||||
//Z-INVERSION
|
||||
writeRegister8(0xBC00, 0x05);
|
||||
writeRegister8(0xBC01, 0x05);
|
||||
writeRegister8(0xBC02, 0x05);
|
||||
//*************** add on 20111021**********************//
|
||||
writeRegister8(0xB700, 0x22);//GATE EQ CONTROL
|
||||
writeRegister8(0xB701, 0x22);//GATE EQ CONTROL
|
||||
writeRegister8(0xC80B, 0x2A);//DISPLAY TIMING CONTROL
|
||||
writeRegister8(0xC80C, 0x2A);//DISPLAY TIMING CONTROL
|
||||
writeRegister8(0xC80F, 0x2A);//DISPLAY TIMING CONTROL
|
||||
writeRegister8(0xC810, 0x2A);//DISPLAY TIMING CONTROL
|
||||
//*************** add on 20111021**********************//
|
||||
//PWM_ENH_OE =1
|
||||
writeRegister8(0xd000, 0x01);
|
||||
//DM_SEL =1
|
||||
writeRegister8(0xb300, 0x10);
|
||||
//VBPDA=07h
|
||||
writeRegister8(0xBd02, 0x07);
|
||||
//VBPDb=07h
|
||||
writeRegister8(0xBe02, 0x07);
|
||||
//VBPDc=07h
|
||||
writeRegister8(0xBf02, 0x07);
|
||||
|
||||
//ENABLE PAGE 2
|
||||
writeRegister8(0xF000, 0x55);
|
||||
writeRegister8(0xF001, 0xAA);
|
||||
writeRegister8(0xF002, 0x52);
|
||||
writeRegister8(0xF003, 0x08);
|
||||
writeRegister8(0xF004, 0x02);
|
||||
//SDREG0 =0
|
||||
writeRegister8(0xc301, 0xa9);
|
||||
//DS=14
|
||||
writeRegister8(0xfe01, 0x94);
|
||||
//OSC =60h
|
||||
writeRegister8(0xf600, 0x60);
|
||||
//TE ON
|
||||
writeRegister8(0x3500, 0x00);
|
||||
writeRegister8(0xFFFF, 0xFF);
|
||||
|
||||
//SLEEP OUT
|
||||
writecommand(0x1100);
|
||||
delay(100);
|
||||
//DISPLY ON
|
||||
writecommand(0x2900);
|
||||
delay(100);
|
||||
|
||||
writeRegister16(0x3A00, 0x55);
|
||||
writeRegister8(0x3600, TFT_MAD_COLOR_ORDER);
|
||||
@@ -1,29 +0,0 @@
|
||||
|
||||
// This is the command sequence that rotates the RM68120 driver coordinate frame
|
||||
|
||||
rotation = m % 4; // Limit the range of values to 0-3
|
||||
uint8_t reg = 0;
|
||||
|
||||
switch (rotation) {
|
||||
case 0:
|
||||
reg = TFT_MAD_COLOR_ORDER;
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 1:
|
||||
reg = TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_COLOR_ORDER;
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
case 2:
|
||||
reg = TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER;
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 3:
|
||||
reg = TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_COLOR_ORDER;
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
}
|
||||
writeRegister16(TFT_MADCTL, reg);
|
||||
@@ -1,42 +0,0 @@
|
||||
// Change the width and height if required (defined in portrait mode)
|
||||
// or use the constructor to over-ride defaults
|
||||
#define TFT_WIDTH 320
|
||||
#define TFT_HEIGHT 480
|
||||
|
||||
|
||||
// Delay between some initialisation commands
|
||||
#define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
|
||||
|
||||
|
||||
// Generic commands used by TFT_eSPI.cpp
|
||||
#define TFT_NOP 0x00
|
||||
#define TFT_SWRST 0x01
|
||||
|
||||
#define TFT_SLPIN 0x10
|
||||
#define TFT_SLPOUT 0x11
|
||||
|
||||
#define TFT_INVOFF 0x20
|
||||
#define TFT_INVON 0x21
|
||||
|
||||
#define TFT_DISPOFF 0x28
|
||||
#define TFT_DISPON 0x29
|
||||
|
||||
#define TFT_CASET 0x2A
|
||||
#define TFT_PASET 0x2B
|
||||
#define TFT_RAMWR 0x2C
|
||||
|
||||
#define TFT_RAMRD 0x2E
|
||||
|
||||
#define TFT_MADCTL 0x36
|
||||
|
||||
#define TFT_MAD_MY 0x80
|
||||
#define TFT_MAD_MX 0x40
|
||||
#define TFT_MAD_MV 0x20
|
||||
#define TFT_MAD_ML 0x10
|
||||
#define TFT_MAD_RGB 0x00
|
||||
#define TFT_MAD_BGR 0x08
|
||||
#define TFT_MAD_MH 0x04
|
||||
#define TFT_MAD_SS 0x02
|
||||
#define TFT_MAD_GS 0x01
|
||||
|
||||
#define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read
|
||||
@@ -1,77 +0,0 @@
|
||||
|
||||
// This is the command sequence that initialises the RM68140 driver
|
||||
//
|
||||
// This setup information uses simple 8-bit SPI writecommand() and writedata() functions
|
||||
//
|
||||
// See ST7735_Setup.h file for an alternative format
|
||||
|
||||
|
||||
// Configure RM68140 display
|
||||
|
||||
writecommand(TFT_SLPOUT);
|
||||
delay(20);
|
||||
|
||||
writecommand(0xD0);
|
||||
writedata(0x07);
|
||||
writedata(0x42);
|
||||
writedata(0x18);
|
||||
|
||||
writecommand(0xD1);
|
||||
writedata(0x00);
|
||||
writedata(0x07);
|
||||
writedata(0x10);
|
||||
|
||||
writecommand(0xD2);
|
||||
writedata(0x01);
|
||||
writedata(0x02);
|
||||
|
||||
writecommand(0xC0);
|
||||
writedata(0x10);
|
||||
writedata(0x3B);
|
||||
writedata(0x00);
|
||||
writedata(0x02);
|
||||
writedata(0x11);
|
||||
|
||||
writecommand(0xC5);
|
||||
writedata(0x03);
|
||||
|
||||
writecommand(0xC8);
|
||||
writedata(0x00);
|
||||
writedata(0x32);
|
||||
writedata(0x36);
|
||||
writedata(0x45);
|
||||
writedata(0x06);
|
||||
writedata(0x16);
|
||||
writedata(0x37);
|
||||
writedata(0x75);
|
||||
writedata(0x77);
|
||||
writedata(0x54);
|
||||
writedata(0x0C);
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(TFT_MADCTL);
|
||||
writedata(0x0A);
|
||||
|
||||
writecommand(0x3A);
|
||||
writedata(0x55);
|
||||
|
||||
writecommand(TFT_CASET);
|
||||
writedata(0x00);
|
||||
writedata(0x00);
|
||||
writedata(0x01);
|
||||
writedata(0x3F);
|
||||
|
||||
writecommand(TFT_PASET);
|
||||
writedata(0x00);
|
||||
writedata(0x00);
|
||||
writedata(0x01);
|
||||
writedata(0xDF);
|
||||
|
||||
delay(120);
|
||||
writecommand(TFT_DISPON);
|
||||
|
||||
delay(25);
|
||||
// End of RM68140 display configuration
|
||||
|
||||
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
// This is the command sequence that rotates the RM68140 driver coordinate frame
|
||||
|
||||
|
||||
writecommand(TFT_MADCTL);
|
||||
rotation = m % 4;
|
||||
switch (rotation) {
|
||||
case 0: // Portrait
|
||||
writedata(TFT_MAD_BGR);
|
||||
writecommand(0xB6);
|
||||
writedata(0);
|
||||
writedata(0x22);
|
||||
writedata(0x3B);
|
||||
_width = TFT_WIDTH;
|
||||
_height = TFT_HEIGHT;
|
||||
break;
|
||||
case 1: // Landscape (Portrait + 90)
|
||||
writedata(TFT_MAD_MV | TFT_MAD_BGR);
|
||||
writecommand(0xB6);
|
||||
writedata(0);
|
||||
writedata(0x02);
|
||||
writedata(0x3B);
|
||||
_width = TFT_HEIGHT;
|
||||
_height = TFT_WIDTH;
|
||||
break;
|
||||
case 2: // Inverter portrait
|
||||
writedata(TFT_MAD_BGR);
|
||||
writecommand(0xB6);
|
||||
writedata(0);
|
||||
writedata(0x42);
|
||||
writedata(0x3B);
|
||||
_width = TFT_WIDTH;
|
||||
_height = TFT_HEIGHT;
|
||||
break;
|
||||
case 3: // Inverted landscape
|
||||
writedata(TFT_MAD_MV | TFT_MAD_BGR);
|
||||
writecommand(0xB6);
|
||||
writedata(0);
|
||||
writedata(0x62);
|
||||
writedata(0x3B);
|
||||
_width = TFT_HEIGHT;
|
||||
_height = TFT_WIDTH;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
// Change the width and height if required (defined in portrait mode)
|
||||
// or use the constructor to over-ride defaults
|
||||
#define TFT_WIDTH 128
|
||||
#define TFT_HEIGHT 160
|
||||
|
||||
|
||||
// Color definitions for backwards compatibility with old sketches
|
||||
// use colour definitions like TFT_BLACK to make sketches more portable
|
||||
#define S6D02A1_BLACK 0x0000 /* 0, 0, 0 */
|
||||
#define S6D02A1_NAVY 0x000F /* 0, 0, 128 */
|
||||
#define S6D02A1_DARKGREEN 0x03E0 /* 0, 128, 0 */
|
||||
#define S6D02A1_DARKCYAN 0x03EF /* 0, 128, 128 */
|
||||
#define S6D02A1_MAROON 0x7800 /* 128, 0, 0 */
|
||||
#define S6D02A1_PURPLE 0x780F /* 128, 0, 128 */
|
||||
#define S6D02A1_OLIVE 0x7BE0 /* 128, 128, 0 */
|
||||
#define S6D02A1_LIGHTGREY 0xC618 /* 192, 192, 192 */
|
||||
#define S6D02A1_DARKGREY 0x7BEF /* 128, 128, 128 */
|
||||
#define S6D02A1_BLUE 0x001F /* 0, 0, 255 */
|
||||
#define S6D02A1_GREEN 0x07E0 /* 0, 255, 0 */
|
||||
#define S6D02A1_CYAN 0x07FF /* 0, 255, 255 */
|
||||
#define S6D02A1_RED 0xF800 /* 255, 0, 0 */
|
||||
#define S6D02A1_MAGENTA 0xF81F /* 255, 0, 255 */
|
||||
#define S6D02A1_YELLOW 0xFFE0 /* 255, 255, 0 */
|
||||
#define S6D02A1_WHITE 0xFFFF /* 255, 255, 255 */
|
||||
#define S6D02A1_ORANGE 0xFD20 /* 255, 165, 0 */
|
||||
#define S6D02A1_GREENYELLOW 0xAFE5 /* 173, 255, 47 */
|
||||
#define S6D02A1_PINK 0xF81F
|
||||
|
||||
|
||||
// Delay between some initialisation commands
|
||||
#define TFT_INIT_DELAY 0x80
|
||||
|
||||
|
||||
// Generic commands used by TFT_eSPI.cpp
|
||||
#define TFT_NOP 0x00
|
||||
#define TFT_SWRST 0x01
|
||||
|
||||
#define TFT_INVOFF 0x20
|
||||
#define TFT_INVON 0x21
|
||||
|
||||
#define TFT_DISPOFF 0x28
|
||||
#define TFT_DISPON 0x29
|
||||
|
||||
#define TFT_CASET 0x2A
|
||||
#define TFT_PASET 0x2B
|
||||
#define TFT_RAMWR 0x2C
|
||||
|
||||
#define TFT_RAMRD 0x2E
|
||||
#define TFT_IDXRD 0x00 //0xDD // ILI9341 only, indexed control register read
|
||||
|
||||
#define TFT_MADCTL 0x36
|
||||
#define TFT_MAD_MY 0x80
|
||||
#define TFT_MAD_MX 0x40
|
||||
#define TFT_MAD_MV 0x20
|
||||
#define TFT_MAD_ML 0x10
|
||||
#define TFT_MAD_BGR 0x08
|
||||
#define TFT_MAD_MH 0x04
|
||||
#define TFT_MAD_RGB 0x00
|
||||
@@ -1,47 +0,0 @@
|
||||
|
||||
// This is the command sequence that initialises the S6D02A1 driver
|
||||
//
|
||||
// This setup information is in a format accecpted by the commandList() function
|
||||
// which reduces FLASH space, but on an ESP8266 there is plenty available!
|
||||
//
|
||||
// See ILI9341_Setup.h file for an alternative simpler format
|
||||
|
||||
{
|
||||
// Initialization commands for S6D02A1 screens
|
||||
static const uint8_t S6D02A1_cmds[] PROGMEM =
|
||||
{
|
||||
29,
|
||||
0xf0, 2, 0x5a, 0x5a, // Excommand2
|
||||
0xfc, 2, 0x5a, 0x5a, // Excommand3
|
||||
0x26, 1, 0x01, // Gamma set
|
||||
0xfa, 15, 0x02, 0x1f, 0x00, 0x10, 0x22, 0x30, 0x38, 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x3d, 0x02, 0x01, // Positive gamma control
|
||||
0xfb, 15, 0x21, 0x00, 0x02, 0x04, 0x07, 0x0a, 0x0b, 0x0c, 0x0c, 0x16, 0x1e, 0x30, 0x3f, 0x01, 0x02, // Negative gamma control
|
||||
0xfd, 11, 0x00, 0x00, 0x00, 0x17, 0x10, 0x00, 0x01, 0x01, 0x00, 0x1f, 0x1f, // Analog parameter control
|
||||
0xf4, 15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x07, 0x00, 0x3C, 0x36, 0x00, 0x3C, 0x36, 0x00, // Power control
|
||||
0xf5, 13, 0x00, 0x70, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x66, 0x06, // VCOM control
|
||||
0xf6, 11, 0x02, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x02, 0x00, 0x06, 0x01, 0x00, // Source control
|
||||
0xf2, 17, 0x00, 0x01, 0x03, 0x08, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x04, 0x08, 0x08, //Display control
|
||||
0xf8, 1, 0x11, // Gate control
|
||||
0xf7, 4, 0xc8, 0x20, 0x00, 0x00, // Interface control
|
||||
0xf3, 2, 0x00, 0x00, // Power sequence control
|
||||
0x11, TFT_INIT_DELAY, 50, // Wake
|
||||
0xf3, 2+TFT_INIT_DELAY, 0x00, 0x01, 50, // Power sequence control
|
||||
0xf3, 2+TFT_INIT_DELAY, 0x00, 0x03, 50, // Power sequence control
|
||||
0xf3, 2+TFT_INIT_DELAY, 0x00, 0x07, 50, // Power sequence control
|
||||
0xf3, 2+TFT_INIT_DELAY, 0x00, 0x0f, 50, // Power sequence control
|
||||
0xf4, 15+TFT_INIT_DELAY, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x07, 0x00, 0x3C, 0x36, 0x00, 0x3C, 0x36, 0x00, 50, // Power control
|
||||
0xf3, 2+TFT_INIT_DELAY, 0x00, 0x1f, 50, // Power sequence control
|
||||
0xf3, 2+TFT_INIT_DELAY, 0x00, 0x7f, 50, // Power sequence control
|
||||
0xf3, 2+TFT_INIT_DELAY, 0x00, 0xff, 50, // Power sequence control
|
||||
0xfd, 11, 0x00, 0x00, 0x00, 0x17, 0x10, 0x00, 0x00, 0x01, 0x00, 0x16, 0x16, // Analog parameter control
|
||||
0xf4, 15, 0x00, 0x09, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x07, 0x00, 0x3C, 0x36, 0x00, 0x3C, 0x36, 0x00, // Power control
|
||||
0x36, 1, 0xC8, // Memory access data control
|
||||
0x35, 1, 0x00, // Tearing effect line on
|
||||
0x3a, 1+TFT_INIT_DELAY, 0x05, 150, // Interface pixel control
|
||||
0x29, 0, // Display on
|
||||
0x2c, 0 // Memory write
|
||||
};
|
||||
|
||||
commandList(S6D02A1_cmds);
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
|
||||
// This is the command sequence that rotates the S6D02A1 driver coordinate frame
|
||||
|
||||
rotation = m % 4;
|
||||
|
||||
writecommand(TFT_MADCTL);
|
||||
switch (rotation) {
|
||||
case 0:
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_BGR);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 1:
|
||||
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_BGR);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
case 2:
|
||||
writedata(TFT_MAD_BGR);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 3:
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_BGR);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
#ifndef TFT_WIDTH
|
||||
#define TFT_WIDTH 128
|
||||
#endif
|
||||
#ifndef TFT_HEIGHT
|
||||
#define TFT_HEIGHT 128
|
||||
#endif
|
||||
|
||||
// Delay between some initialisation commands
|
||||
#define TFT_INIT_DELAY 0x80
|
||||
|
||||
// Generic commands used by TFT_eSPI.cpp
|
||||
#define TFT_NOP 0x00
|
||||
#define TFT_SWRST TFT_NOP
|
||||
#define TFT_CASET 0x15 // SETCOLUMN
|
||||
#define TFT_PASET 0x75 // SETROW
|
||||
#define TFT_RAMWR 0x5C // WRITERAM
|
||||
#define TFT_RAMRD 0x5D // READRAM
|
||||
#define TFT_IDXRD TFT_NOP
|
||||
#define TFT_INVOFF 0xA6 // NORMALDISPLAY
|
||||
#define TFT_INVON 0xA7 // INVERTDISPLAY
|
||||
@@ -1,35 +0,0 @@
|
||||
{
|
||||
writecommand(0xFD); // COMMANDLOCK
|
||||
writedata(0x12);
|
||||
writecommand(0xFD); // COMMANDLOCK
|
||||
writedata(0xB1);
|
||||
writecommand(0xAE); // DISPLAYOFF
|
||||
writecommand(0xB3); // CLOCKDIV
|
||||
writedata(0xF1);
|
||||
writecommand(0xCA); // MUXRATIO
|
||||
writedata(127);
|
||||
writecommand(0xA2); // DISPLAYOFFSET
|
||||
writedata(0x00);
|
||||
writecommand(0xB5); // SETGPIO
|
||||
writedata(0x00);
|
||||
writecommand(0xAB); // FUNCTIONSELECT
|
||||
writedata(0x01);
|
||||
writecommand(0xB1); // PRECHARGE
|
||||
writedata(0x32);
|
||||
writecommand(0xBE); // VCOMH
|
||||
writedata(0x05);
|
||||
writecommand(0xA6); // NORMALDISPLAY
|
||||
writecommand(0xC1); // CONTRASTABC
|
||||
writedata(0xC8);
|
||||
writedata(0x80);
|
||||
writedata(0xC8);
|
||||
writecommand(0xC7); // CONTRASTMASTER
|
||||
writedata(0x0F);
|
||||
writecommand(0xB4); // SETVSL
|
||||
writedata(0xA0);
|
||||
writedata(0xB5);
|
||||
writedata(0x55);
|
||||
writecommand(0xB6); // PRECHARGE2
|
||||
writedata(0x01);
|
||||
writecommand(0xAF); // DISPLAYON
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
|
||||
// This is the command sequence that rotates the SSD1351 driver coordinate frame
|
||||
|
||||
rotation = m % 4; // Limit the range of values to 0-3
|
||||
|
||||
uint8_t madctl = 0x64;
|
||||
|
||||
switch (rotation) {
|
||||
case 0:
|
||||
madctl |= 0x10;
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 1:
|
||||
madctl |= 0x13;
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
case 2:
|
||||
madctl |= 0x02;
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 3:
|
||||
madctl |= 0x01;
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
}
|
||||
|
||||
writecommand(0xA0); // SETREMAP
|
||||
writedata(madctl);
|
||||
writecommand(0xA1); // STARTLINE
|
||||
writedata(rotation < 2 ? TFT_HEIGHT : 0);
|
||||
@@ -1,59 +0,0 @@
|
||||
// Change the width and height if required (defined in portrait mode)
|
||||
// or use the constructor to over-ride defaults
|
||||
#if defined (SSD1963_480_DRIVER)
|
||||
#define TFT_WIDTH 272
|
||||
#define TFT_HEIGHT 480
|
||||
#elif defined (SSD1963_800_DRIVER)
|
||||
#define TFT_WIDTH 480
|
||||
#define TFT_HEIGHT 800
|
||||
#elif defined (SSD1963_800ALT_DRIVER)
|
||||
#define TFT_WIDTH 480
|
||||
#define TFT_HEIGHT 800
|
||||
#elif defined (SSD1963_800BD_DRIVER)
|
||||
#define TFT_WIDTH 480
|
||||
#define TFT_HEIGHT 800
|
||||
#endif
|
||||
|
||||
//Set driver type common to all initialisation options
|
||||
#ifndef SSD1963_DRIVER
|
||||
#define SSD1963_DRIVER
|
||||
#endif
|
||||
|
||||
// Delay between some initialisation commands
|
||||
#define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
|
||||
|
||||
// Generic commands used by TFT_eSPI.cpp
|
||||
#define TFT_NOP 0x00
|
||||
#define TFT_SWRST 0x01
|
||||
|
||||
#define TFT_INVOFF 0x20
|
||||
#define TFT_INVON 0x21
|
||||
|
||||
#define TFT_DISPOFF 0x28
|
||||
#define TFT_DISPON 0x29
|
||||
|
||||
#define TFT_CASET 0x2A
|
||||
#define TFT_PASET 0x2B
|
||||
#define TFT_RAMWR 0x2C
|
||||
|
||||
#define TFT_RAMRD 0x2E
|
||||
#define TFT_IDXRD 0xDD // ILI9341 only, indexed control register read
|
||||
|
||||
#define TFT_MADCTL 0x36
|
||||
#define TFT_MAD_MY 0x80
|
||||
#define TFT_MAD_MX 0x40
|
||||
#define TFT_MAD_MV 0x20
|
||||
#define TFT_MAD_ML 0x10
|
||||
#define TFT_MAD_BGR 0x08
|
||||
#define TFT_MAD_MH 0x04
|
||||
#define TFT_MAD_RGB 0x00
|
||||
|
||||
#ifdef TFT_RGB_ORDER
|
||||
#if (TFT_RGB_ORDER == 1)
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
|
||||
#else
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
|
||||
#endif
|
||||
#else
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
|
||||
#endif
|
||||
@@ -1,398 +0,0 @@
|
||||
#if defined (SSD1963_480_DRIVER)
|
||||
|
||||
writecommand(0xE2); //PLL multiplier, set PLL clock to 120M
|
||||
writedata(0x23); //N=0x36 for 6.5M, 0x23 for 10M crystal
|
||||
writedata(0x02);
|
||||
writedata(0x54);
|
||||
writecommand(0xE0); // PLL enable
|
||||
writedata(0x01);
|
||||
|
||||
delay(10);
|
||||
|
||||
writecommand(0xE0);
|
||||
writedata(0x03);
|
||||
|
||||
delay(10);
|
||||
|
||||
writecommand(0x01); // software reset
|
||||
|
||||
delay(100);
|
||||
|
||||
writecommand(0xE6); //PLL setting for PCLK, depends on resolution
|
||||
writedata(0x01);
|
||||
writedata(0x1F);
|
||||
writedata(0xFF);
|
||||
|
||||
writecommand(0xB0); //LCD SPECIFICATION
|
||||
writedata(0x20);
|
||||
writedata(0x00);
|
||||
writedata(0x01); //Set HDP 479
|
||||
writedata(0xDF);
|
||||
writedata(0x01); //Set VDP 271
|
||||
writedata(0x0F);
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(0xB4); //HSYNC
|
||||
writedata(0x02); //Set HT 531
|
||||
writedata(0x13);
|
||||
writedata(0x00); //Set HPS 8
|
||||
writedata(0x08);
|
||||
writedata(0x2B); //Set HPW 43
|
||||
writedata(0x00); //Set LPS 2
|
||||
writedata(0x02);
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(0xB6); //VSYNC
|
||||
writedata(0x01); //Set VT 288
|
||||
writedata(0x20);
|
||||
writedata(0x00); //Set VPS 4
|
||||
writedata(0x04);
|
||||
writedata(0x0c); //Set VPW 12
|
||||
writedata(0x00); //Set FPS 2
|
||||
writedata(0x02);
|
||||
|
||||
writecommand(0xBA);
|
||||
writedata(0x0F); //GPIO[3:0] out 1
|
||||
|
||||
writecommand(0xB8);
|
||||
writedata(0x07); //GPIO3=input, GPIO[2:0]=output
|
||||
writedata(0x01); //GPIO0 normal
|
||||
|
||||
writecommand(0x36); //rotation
|
||||
writedata(0x21 | TFT_MAD_COLOR_ORDER);
|
||||
|
||||
writecommand(0xF0); //pixel data interface
|
||||
writedata(0x00); //8-bit bus
|
||||
|
||||
delay(1);
|
||||
|
||||
writecommand(0xB8);
|
||||
writedata(0x0f); //GPIO is controlled by host GPIO[3:0]=output GPIO[0]=1 LCD ON GPIO[0]=1 LCD OFF
|
||||
writedata(0x01); //GPIO0 normal
|
||||
|
||||
writecommand(0xBA);
|
||||
writedata(0x01); //GPIO[0] out 1 --- LCD display on/off control PIN
|
||||
|
||||
writecommand(0x2A);
|
||||
writedata(0);
|
||||
writedata(0);
|
||||
writedata((271 & 0xFF00)>>8);
|
||||
writedata(271 & 0xFF);
|
||||
|
||||
writecommand(0x2B);
|
||||
writedata(0);
|
||||
writedata(0);
|
||||
writedata((479 & 0xFF00)>>8);
|
||||
writedata(479 & 0xFF);
|
||||
|
||||
writecommand(0x2C);
|
||||
|
||||
writecommand(0x29); //display on
|
||||
|
||||
writecommand(0xBE); //set PWM for B/L
|
||||
writedata(0x06);
|
||||
writedata(0xf0);
|
||||
writedata(0x01);
|
||||
writedata(0xf0);
|
||||
writedata(0x00);
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(0xd0);
|
||||
writedata(0x0d);
|
||||
|
||||
writecommand(0x2C);
|
||||
|
||||
#elif defined (SSD1963_800_DRIVER)
|
||||
|
||||
writecommand(0xE2); //PLL multiplier, set PLL clock to 120M
|
||||
writedata(0x1E); //N=0x36 for 6.5M, 0x23 for 10M crystal
|
||||
writedata(0x02);
|
||||
writedata(0x54);
|
||||
writecommand(0xE0); // PLL enable
|
||||
writedata(0x01);
|
||||
|
||||
delay(10);
|
||||
|
||||
writecommand(0xE0);
|
||||
writedata(0x03);
|
||||
|
||||
delay(10);
|
||||
|
||||
writecommand(0x01); // software reset
|
||||
|
||||
delay(100);
|
||||
|
||||
writecommand(0xE6); //PLL setting for PCLK, depends on resolution
|
||||
writedata(0x03);
|
||||
writedata(0xFF);
|
||||
writedata(0xFF);
|
||||
|
||||
writecommand(0xB0); //LCD SPECIFICATION
|
||||
writedata(0x20);
|
||||
writedata(0x00);
|
||||
writedata(0x03); //Set HDP 799
|
||||
writedata(0x1F);
|
||||
writedata(0x01); //Set VDP 479
|
||||
writedata(0xDF);
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(0xB4); //HSYNC
|
||||
writedata(0x03); //Set HT 928
|
||||
writedata(0xA0);
|
||||
writedata(0x00); //Set HPS 46
|
||||
writedata(0x2E);
|
||||
writedata(0x30); //Set HPW 48
|
||||
writedata(0x00); //Set LPS 15
|
||||
writedata(0x0F);
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(0xB6); //VSYNC
|
||||
writedata(0x02); //Set VT 525
|
||||
writedata(0x0D);
|
||||
writedata(0x00); //Set VPS 16
|
||||
writedata(0x10);
|
||||
writedata(0x10); //Set VPW 16
|
||||
writedata(0x00); //Set FPS 8
|
||||
writedata(0x08);
|
||||
|
||||
writecommand(0xBA);
|
||||
writedata(0x0F); //GPIO[3:0] out 1
|
||||
|
||||
writecommand(0xB8);
|
||||
writedata(0x07); //GPIO3=input, GPIO[2:0]=output
|
||||
writedata(0x01); //GPIO0 normal
|
||||
|
||||
writecommand(0x36); //rotation
|
||||
writedata(0x21 | TFT_MAD_COLOR_ORDER);
|
||||
|
||||
writecommand(0xF0); //pixel data interface
|
||||
writedata(0x00); //8-bit bus
|
||||
|
||||
delay(1);
|
||||
|
||||
writecommand(0xB8);
|
||||
writedata(0x0f); //GPIO is controlled by host GPIO[3:0]=output GPIO[0]=1 LCD ON GPIO[0]=1 LCD OFF
|
||||
writedata(0x01); //GPIO0 normal
|
||||
|
||||
writecommand(0xBA);
|
||||
writedata(0x01); //GPIO[0] out 1 --- LCD display on/off control PIN
|
||||
|
||||
writecommand(0x2A);
|
||||
writedata(0);
|
||||
writedata(0);
|
||||
writedata((479 & 0xFF00)>>8);
|
||||
writedata(479 & 0xFF);
|
||||
|
||||
writecommand(0x2B);
|
||||
writedata(0);
|
||||
writedata(0);
|
||||
writedata((799 & 0xFF00)>>8);
|
||||
writedata(799 & 0xFF);
|
||||
|
||||
writecommand(0x2C);
|
||||
|
||||
writecommand(0x29); //display on
|
||||
|
||||
writecommand(0xBE); //set PWM for B/L
|
||||
writedata(0x06);
|
||||
writedata(0xf0);
|
||||
writedata(0x01);
|
||||
writedata(0xf0);
|
||||
writedata(0x00);
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(0xd0);
|
||||
writedata(0x0d);
|
||||
|
||||
writecommand(0x2C);
|
||||
|
||||
#elif defined (SSD1963_800ALT_DRIVER)
|
||||
|
||||
writecommand(0xE2); //PLL multiplier, set PLL clock to 120M
|
||||
writedata(0x23); //N=0x36 for 6.5M, 0x23 for 10M crystal
|
||||
writedata(0x02);
|
||||
writedata(0x04);
|
||||
writecommand(0xE0); // PLL enable
|
||||
writedata(0x01);
|
||||
|
||||
delay(10);
|
||||
|
||||
writecommand(0xE0);
|
||||
writedata(0x03);
|
||||
|
||||
delay(10);
|
||||
|
||||
writecommand(0x01); // software reset
|
||||
|
||||
delay(100);
|
||||
|
||||
writecommand(0xE6); //PLL setting for PCLK, depends on resolution
|
||||
writedata(0x04);
|
||||
writedata(0x93);
|
||||
writedata(0xE0);
|
||||
|
||||
writecommand(0xB0); //LCD SPECIFICATION
|
||||
writedata(0x00); // 0x24
|
||||
writedata(0x00);
|
||||
writedata(0x03); //Set HDP 799
|
||||
writedata(0x1F);
|
||||
writedata(0x01); //Set VDP 479
|
||||
writedata(0xDF);
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(0xB4); //HSYNC
|
||||
writedata(0x03); //Set HT 928
|
||||
writedata(0xA0);
|
||||
writedata(0x00); //Set HPS 46
|
||||
writedata(0x2E);
|
||||
writedata(0x30); //Set HPW 48
|
||||
writedata(0x00); //Set LPS 15
|
||||
writedata(0x0F);
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(0xB6); //VSYNC
|
||||
writedata(0x02); //Set VT 525
|
||||
writedata(0x0D);
|
||||
writedata(0x00); //Set VPS 16
|
||||
writedata(0x10);
|
||||
writedata(0x10); //Set VPW 16
|
||||
writedata(0x00); //Set FPS 8
|
||||
writedata(0x08);
|
||||
|
||||
writecommand(0xBA);
|
||||
writedata(0x05); //GPIO[3:0] out 1
|
||||
|
||||
writecommand(0xB8);
|
||||
writedata(0x07); //GPIO3=input, GPIO[2:0]=output
|
||||
writedata(0x01); //GPIO0 normal
|
||||
|
||||
writecommand(0x36); //rotation
|
||||
writedata(0x21 | TFT_MAD_COLOR_ORDER); // -- Set rotation
|
||||
|
||||
writecommand(0xF0); //pixel data interface
|
||||
writedata(0x00); //8-bit bus
|
||||
|
||||
delay(10);
|
||||
|
||||
writecommand(0x2A);
|
||||
writedata(0);
|
||||
writedata(0);
|
||||
writedata((479 & 0xFF00)>>8);
|
||||
writedata(479 & 0xFF);
|
||||
|
||||
writecommand(0x2B);
|
||||
writedata(0);
|
||||
writedata(0);
|
||||
writedata((799 & 0xFF00)>>8);
|
||||
writedata(799 & 0xFF);
|
||||
|
||||
writecommand(0x2C);
|
||||
|
||||
writecommand(0x29); //display on
|
||||
|
||||
writecommand(0xBE); //set PWM for B/L
|
||||
writedata(0x06);
|
||||
writedata(0xF0);
|
||||
writedata(0x01);
|
||||
writedata(0xF0);
|
||||
writedata(0x00);
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(0xD0);
|
||||
writedata(0x0D);
|
||||
|
||||
writecommand(0x2C);
|
||||
|
||||
#elif defined (SSD1963_800BD_DRIVER) // Copied from Buy Display code
|
||||
|
||||
writecommand(0xE2); //PLL multiplier, set PLL clock to 120M
|
||||
writedata(0x23); //N=0x36 for 6.5M, 0x23 for 10M crystal
|
||||
writedata(0x02);
|
||||
writedata(0x54);
|
||||
|
||||
writecommand(0xE0); // PLL enable
|
||||
writedata(0x01);
|
||||
|
||||
delay(10);
|
||||
|
||||
writecommand(0xE0);
|
||||
writedata(0x03);
|
||||
|
||||
delay(10);
|
||||
|
||||
writecommand(0x01); // software reset
|
||||
|
||||
delay(100);
|
||||
|
||||
writecommand(0xE6); //PLL setting for PCLK, depends on resolution
|
||||
writedata(0x03);
|
||||
writedata(0x33);
|
||||
writedata(0x33);
|
||||
|
||||
writecommand(0xB0); //LCD SPECIFICATION
|
||||
writedata(0x20);
|
||||
writedata(0x00);
|
||||
writedata(799 >> 8); //Set HDP 799
|
||||
writedata(799 & 0xFF);
|
||||
writedata(479 >> 8); //Set VDP 479
|
||||
writedata(479 & 0xFF);
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(0xB4); //HSYNC
|
||||
writedata(0x04); //Set HT
|
||||
writedata(0x1F);
|
||||
writedata(0x00); //Set HPS
|
||||
writedata(0xD2);
|
||||
writedata(0x00); //Set HPW
|
||||
writedata(0x00); //Set LPS
|
||||
writedata(0x00);
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(0xB6); //VSYNC
|
||||
writedata(0x02); //Set VT
|
||||
writedata(0x0C);
|
||||
writedata(0x00); //Set VPS
|
||||
writedata(0x22);
|
||||
writedata(0x00); //Set VPW
|
||||
writedata(0x00); //Set FPS
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(0xB8);
|
||||
writedata(0x0F); //GPIO3=input, GPIO[2:0]=output
|
||||
writedata(0x01); //GPIO0 normal
|
||||
|
||||
writecommand(0xBA);
|
||||
writedata(0x01); //GPIO[0] out 1 --- LCD display on/off control PIN
|
||||
|
||||
writecommand(0x36); //rotation
|
||||
writedata(0x21 | TFT_MAD_COLOR_ORDER); //set to rotate
|
||||
|
||||
//writecommand(0x003A); //Set the current pixel format for RGB image data
|
||||
//writedata(0x0050); //16-bit/pixel
|
||||
|
||||
writecommand(0xF0); //pixel data interface
|
||||
writedata(0x00); //000 = 8-bit bus, 011 = 16-bit, 110 = 9-bit
|
||||
|
||||
writecommand(0xBC);
|
||||
writedata(0x40); //contrast value
|
||||
writedata(0x80); //brightness value
|
||||
writedata(0x40); //saturation value
|
||||
writedata(0x01); //Post Processor Enable
|
||||
|
||||
|
||||
delay(10);
|
||||
|
||||
writecommand(0x29); //display on
|
||||
|
||||
writecommand(0xBE); //set PWM for B/L
|
||||
writedata(0x06);
|
||||
writedata(0x80);
|
||||
writedata(0x01);
|
||||
writedata(0xF0);
|
||||
writedata(0x00);
|
||||
writedata(0x00);
|
||||
|
||||
writecommand(0xD0);
|
||||
writedata(0x0D);
|
||||
|
||||
#endif
|
||||
@@ -1,29 +0,0 @@
|
||||
|
||||
// This is the command sequence that rotates the SSD1963 driver coordinate frame
|
||||
|
||||
rotation = m % 4; // Limit the range of values to 0-3
|
||||
|
||||
writecommand(TFT_MADCTL);
|
||||
switch (rotation) {
|
||||
case 0:
|
||||
writedata(0x21 | TFT_MAD_COLOR_ORDER);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 1:
|
||||
writedata(0x00 | TFT_MAD_COLOR_ORDER);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
case 2:
|
||||
writedata(0x22 | TFT_MAD_COLOR_ORDER);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 3:
|
||||
writedata(0x03 | TFT_MAD_COLOR_ORDER);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -1,179 +0,0 @@
|
||||
// Change the width and height if required (defined in portrait mode)
|
||||
// or use the constructor to over-ride defaults
|
||||
#ifndef TFT_WIDTH
|
||||
#define TFT_WIDTH 128
|
||||
#endif
|
||||
#ifndef TFT_HEIGHT
|
||||
#define TFT_HEIGHT 160
|
||||
#endif
|
||||
|
||||
|
||||
// Enumerate the different configurations
|
||||
#define INITR_GREENTAB 0x0
|
||||
#define INITR_REDTAB 0x1
|
||||
#define INITR_BLACKTAB 0x2 // Display with no offsets
|
||||
#define INITR_GREENTAB2 0x3 // Use if you get random pixels on two edges of green tab display
|
||||
#define INITR_GREENTAB3 0x4 // Use if you get random pixels on edge(s) of 128x128 screen
|
||||
#define INITR_GREENTAB128 0x5 // Use if you only get part of 128x128 screen in rotation 0 & 1
|
||||
#define INITR_GREENTAB160x80 0x6 // Use if you only get part of 128x128 screen in rotation 0 & 1
|
||||
#define INITR_REDTAB160x80 0x7 // Added for https://www.aliexpress.com/item/ShengYang-1pcs-IPS-0-96-inch-7P-SPI-HD-65K-Full-Color-OLED-Module-ST7735-Drive/32918394604.html
|
||||
#define INITR_ROBOTLCD 0x8
|
||||
#define INITB 0xB
|
||||
|
||||
|
||||
// Setup the tab color that will be used by the library setRotation() and setup command list
|
||||
#if defined (ST7735_INITB)
|
||||
#define TAB_COLOUR INITB
|
||||
|
||||
#elif defined (ST7735_GREENTAB)
|
||||
#define TAB_COLOUR INITR_GREENTAB
|
||||
#define CGRAM_OFFSET
|
||||
|
||||
#elif defined (ST7735_GREENTAB2)
|
||||
#define TAB_COLOUR INITR_GREENTAB2
|
||||
#define CGRAM_OFFSET
|
||||
|
||||
#elif defined (ST7735_GREENTAB3)
|
||||
#define TAB_COLOUR INITR_GREENTAB3
|
||||
#define CGRAM_OFFSET
|
||||
|
||||
#elif defined (ST7735_GREENTAB128)
|
||||
#define TAB_COLOUR INITR_GREENTAB128
|
||||
#define CGRAM_OFFSET
|
||||
|
||||
#elif defined (ST7735_GREENTAB160x80)
|
||||
#define TAB_COLOUR INITR_GREENTAB160x80
|
||||
#define CGRAM_OFFSET
|
||||
|
||||
#elif defined (ST7735_ROBOTLCD)
|
||||
#define TAB_COLOUR INITR_ROBOTLCD
|
||||
#define CGRAM_OFFSET
|
||||
|
||||
#elif defined (ST7735_REDTAB160x80)
|
||||
#define TAB_COLOUR INITR_REDTAB160x80
|
||||
#define CGRAM_OFFSET
|
||||
|
||||
#elif defined (ST7735_REDTAB)
|
||||
#define TAB_COLOUR INITR_REDTAB
|
||||
|
||||
#elif defined (ST7735_BLACKTAB)
|
||||
#define TAB_COLOUR INITR_BLACKTAB
|
||||
|
||||
#else // Make sure it is not undefined
|
||||
#define TAB_COLOUR INITR_BLACKTAB
|
||||
#endif
|
||||
|
||||
|
||||
// Color definitions for backwards compatibility with old sketches
|
||||
// use colour definitions like TFT_BLACK to make sketches more portable
|
||||
#define ST7735_BLACK 0x0000 /* 0, 0, 0 */
|
||||
#define ST7735_NAVY 0x000F /* 0, 0, 128 */
|
||||
#define ST7735_DARKGREEN 0x03E0 /* 0, 128, 0 */
|
||||
#define ST7735_DARKCYAN 0x03EF /* 0, 128, 128 */
|
||||
#define ST7735_MAROON 0x7800 /* 128, 0, 0 */
|
||||
#define ST7735_PURPLE 0x780F /* 128, 0, 128 */
|
||||
#define ST7735_OLIVE 0x7BE0 /* 128, 128, 0 */
|
||||
#define ST7735_LIGHTGREY 0xC618 /* 192, 192, 192 */
|
||||
#define ST7735_DARKGREY 0x7BEF /* 128, 128, 128 */
|
||||
#define ST7735_BLUE 0x001F /* 0, 0, 255 */
|
||||
#define ST7735_GREEN 0x07E0 /* 0, 255, 0 */
|
||||
#define ST7735_CYAN 0x07FF /* 0, 255, 255 */
|
||||
#define ST7735_RED 0xF800 /* 255, 0, 0 */
|
||||
#define ST7735_MAGENTA 0xF81F /* 255, 0, 255 */
|
||||
#define ST7735_YELLOW 0xFFE0 /* 255, 255, 0 */
|
||||
#define ST7735_WHITE 0xFFFF /* 255, 255, 255 */
|
||||
#define ST7735_ORANGE 0xFD20 /* 255, 165, 0 */
|
||||
#define ST7735_GREENYELLOW 0xAFE5 /* 173, 255, 47 */
|
||||
#define ST7735_PINK 0xF81F
|
||||
|
||||
|
||||
// Delay between some initialisation commands
|
||||
#define TFT_INIT_DELAY 0x80
|
||||
|
||||
|
||||
// Generic commands used by TFT_eSPI.cpp
|
||||
#define TFT_NOP 0x00
|
||||
#define TFT_SWRST 0x01
|
||||
|
||||
#define TFT_INVOFF 0x20
|
||||
#define TFT_INVON 0x21
|
||||
|
||||
#define TFT_DISPOFF 0x28
|
||||
#define TFT_DISPON 0x29
|
||||
|
||||
#define TFT_CASET 0x2A
|
||||
#define TFT_PASET 0x2B
|
||||
#define TFT_RAMWR 0x2C
|
||||
|
||||
#define TFT_RAMRD 0x2E
|
||||
#define TFT_IDXRD 0x00 //0xDD // ILI9341 only, indexed control register read
|
||||
|
||||
#define TFT_MADCTL 0x36
|
||||
#define TFT_MAD_MY 0x80
|
||||
#define TFT_MAD_MX 0x40
|
||||
#define TFT_MAD_MV 0x20
|
||||
#define TFT_MAD_ML 0x10
|
||||
#define TFT_MAD_BGR 0x08
|
||||
#define TFT_MAD_MH 0x04
|
||||
#define TFT_MAD_RGB 0x00
|
||||
|
||||
#ifndef TFT_RGB_ORDER
|
||||
#if defined(ST7735_BLACKTAB) || defined(ST7735_GREENTAB2) || defined(ST7735_INITB)
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
|
||||
#else
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
|
||||
#endif
|
||||
#else
|
||||
#if (TFT_RGB_ORDER == 1)
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
|
||||
#else
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// ST7735 specific commands used in init
|
||||
#define ST7735_NOP 0x00
|
||||
#define ST7735_SWRESET 0x01
|
||||
#define ST7735_RDDID 0x04
|
||||
#define ST7735_RDDST 0x09
|
||||
|
||||
#define ST7735_SLPIN 0x10
|
||||
#define ST7735_SLPOUT 0x11
|
||||
#define ST7735_PTLON 0x12
|
||||
#define ST7735_NORON 0x13
|
||||
|
||||
#define ST7735_INVOFF 0x20
|
||||
#define ST7735_INVON 0x21
|
||||
#define ST7735_DISPOFF 0x28
|
||||
#define ST7735_DISPON 0x29
|
||||
#define ST7735_CASET 0x2A
|
||||
#define ST7735_RASET 0x2B // PASET
|
||||
#define ST7735_RAMWR 0x2C
|
||||
#define ST7735_RAMRD 0x2E
|
||||
|
||||
#define ST7735_PTLAR 0x30
|
||||
#define ST7735_COLMOD 0x3A
|
||||
#define ST7735_MADCTL 0x36
|
||||
|
||||
#define ST7735_FRMCTR1 0xB1
|
||||
#define ST7735_FRMCTR2 0xB2
|
||||
#define ST7735_FRMCTR3 0xB3
|
||||
#define ST7735_INVCTR 0xB4
|
||||
#define ST7735_DISSET5 0xB6
|
||||
|
||||
#define ST7735_PWCTR1 0xC0
|
||||
#define ST7735_PWCTR2 0xC1
|
||||
#define ST7735_PWCTR3 0xC2
|
||||
#define ST7735_PWCTR4 0xC3
|
||||
#define ST7735_PWCTR5 0xC4
|
||||
#define ST7735_VMCTR1 0xC5
|
||||
|
||||
#define ST7735_RDID1 0xDA
|
||||
#define ST7735_RDID2 0xDB
|
||||
#define ST7735_RDID3 0xDC
|
||||
#define ST7735_RDID4 0xDD
|
||||
|
||||
#define ST7735_PWCTR6 0xFC
|
||||
|
||||
#define ST7735_GMCTRP1 0xE0
|
||||
#define ST7735_GMCTRN1 0xE1
|
||||
@@ -1,218 +0,0 @@
|
||||
|
||||
// This is the command sequence that initialises the ST7735 driver
|
||||
//
|
||||
// This setup information is in a format accepted by the commandList() function
|
||||
// which reduces FLASH space, but on an ESP8266 there is plenty available!
|
||||
//
|
||||
// See ILI9341_Setup.h file for an alternative simpler format
|
||||
|
||||
{
|
||||
// Initialization commands for ST7735 screens
|
||||
static const uint8_t PROGMEM
|
||||
Bcmd[] = { // Initialization commands for 7735B screens
|
||||
18, // 18 commands in list:
|
||||
ST7735_SWRESET, TFT_INIT_DELAY, // 1: Software reset, no args, w/delay
|
||||
50, // 50 ms delay
|
||||
ST7735_SLPOUT , TFT_INIT_DELAY, // 2: Out of sleep mode, no args, w/delay
|
||||
255, // 255 = 500 ms delay
|
||||
ST7735_COLMOD , 1+TFT_INIT_DELAY, // 3: Set color mode, 1 arg + delay:
|
||||
0x05, // 16-bit color
|
||||
10, // 10 ms delay
|
||||
ST7735_FRMCTR1, 3+TFT_INIT_DELAY, // 4: Frame rate control, 3 args + delay:
|
||||
0x00, // fastest refresh
|
||||
0x06, // 6 lines front porch
|
||||
0x03, // 3 lines back porch
|
||||
10, // 10 ms delay
|
||||
ST7735_MADCTL , 1 , // 5: Memory access ctrl (directions), 1 arg:
|
||||
0x40 | TFT_MAD_COLOR_ORDER, // Row addr/col addr, bottom to top refresh
|
||||
ST7735_DISSET5, 2 , // 6: Display settings #5, 2 args, no delay:
|
||||
0x15, // 1 clk cycle nonoverlap, 2 cycle gate
|
||||
// rise, 3 cycle osc equalize
|
||||
0x02, // Fix on VTL
|
||||
ST7735_INVCTR , 1 , // 7: Display inversion control, 1 arg:
|
||||
0x0, // Line inversion
|
||||
ST7735_PWCTR1 , 2+TFT_INIT_DELAY, // 8: Power control, 2 args + delay:
|
||||
0x02, // GVDD = 4.7V
|
||||
0x70, // 1.0uA
|
||||
10, // 10 ms delay
|
||||
ST7735_PWCTR2 , 1 , // 9: Power control, 1 arg, no delay:
|
||||
0x05, // VGH = 14.7V, VGL = -7.35V
|
||||
ST7735_PWCTR3 , 2 , // 10: Power control, 2 args, no delay:
|
||||
0x01, // Opamp current small
|
||||
0x02, // Boost frequency
|
||||
ST7735_VMCTR1 , 2+TFT_INIT_DELAY, // 11: Power control, 2 args + delay:
|
||||
0x3C, // VCOMH = 4V
|
||||
0x38, // VCOML = -1.1V
|
||||
10, // 10 ms delay
|
||||
ST7735_PWCTR6 , 2 , // 12: Power control, 2 args, no delay:
|
||||
0x11, 0x15,
|
||||
ST7735_GMCTRP1,16 , // 13: Magical unicorn dust, 16 args, no delay:
|
||||
0x09, 0x16, 0x09, 0x20, // (seriously though, not sure what
|
||||
0x21, 0x1B, 0x13, 0x19, // these config values represent)
|
||||
0x17, 0x15, 0x1E, 0x2B,
|
||||
0x04, 0x05, 0x02, 0x0E,
|
||||
ST7735_GMCTRN1,16+TFT_INIT_DELAY, // 14: Sparkles and rainbows, 16 args + delay:
|
||||
0x0B, 0x14, 0x08, 0x1E, // (ditto)
|
||||
0x22, 0x1D, 0x18, 0x1E,
|
||||
0x1B, 0x1A, 0x24, 0x2B,
|
||||
0x06, 0x06, 0x02, 0x0F,
|
||||
10, // 10 ms delay
|
||||
ST7735_CASET , 4 , // 15: Column addr set, 4 args, no delay:
|
||||
0x00, 0x02, // XSTART = 2
|
||||
0x00, 0x81, // XEND = 129
|
||||
ST7735_RASET , 4 , // 16: Row addr set, 4 args, no delay:
|
||||
0x00, 0x02, // XSTART = 1
|
||||
0x00, 0x81, // XEND = 160
|
||||
ST7735_NORON , TFT_INIT_DELAY, // 17: Normal display on, no args, w/delay
|
||||
10, // 10 ms delay
|
||||
ST7735_DISPON , TFT_INIT_DELAY, // 18: Main screen turn on, no args, w/delay
|
||||
255 }, // 255 = 500 ms delay
|
||||
|
||||
Rcmd1[] = { // Init for 7735R, part 1 (red or green tab)
|
||||
15, // 15 commands in list:
|
||||
ST7735_SWRESET, TFT_INIT_DELAY, // 1: Software reset, 0 args, w/delay
|
||||
150, // 150 ms delay
|
||||
ST7735_SLPOUT , TFT_INIT_DELAY, // 2: Out of sleep mode, 0 args, w/delay
|
||||
255, // 500 ms delay
|
||||
ST7735_FRMCTR1, 3 , // 3: Frame rate ctrl - normal mode, 3 args:
|
||||
0x01, 0x2C, 0x2D, // Rate = fosc/(1x2+40) * (LINE+2C+2D)
|
||||
ST7735_FRMCTR2, 3 , // 4: Frame rate control - idle mode, 3 args:
|
||||
0x01, 0x2C, 0x2D, // Rate = fosc/(1x2+40) * (LINE+2C+2D)
|
||||
ST7735_FRMCTR3, 6 , // 5: Frame rate ctrl - partial mode, 6 args:
|
||||
0x01, 0x2C, 0x2D, // Dot inversion mode
|
||||
0x01, 0x2C, 0x2D, // Line inversion mode
|
||||
ST7735_INVCTR , 1 , // 6: Display inversion ctrl, 1 arg, no delay:
|
||||
0x07, // No inversion
|
||||
ST7735_PWCTR1 , 3 , // 7: Power control, 3 args, no delay:
|
||||
0xA2,
|
||||
0x02, // -4.6V
|
||||
0x84, // AUTO mode
|
||||
ST7735_PWCTR2 , 1 , // 8: Power control, 1 arg, no delay:
|
||||
0xC5, // VGH25 = 2.4C VGSEL = -10 VGH = 3 * AVDD
|
||||
ST7735_PWCTR3 , 2 , // 9: Power control, 2 args, no delay:
|
||||
0x0A, // Opamp current small
|
||||
0x00, // Boost frequency
|
||||
ST7735_PWCTR4 , 2 , // 10: Power control, 2 args, no delay:
|
||||
0x8A, // BCLK/2, Opamp current small & Medium low
|
||||
0x2A,
|
||||
ST7735_PWCTR5 , 2 , // 11: Power control, 2 args, no delay:
|
||||
0x8A, 0xEE,
|
||||
ST7735_VMCTR1 , 1 , // 12: Power control, 1 arg, no delay:
|
||||
0x0E,
|
||||
ST7735_INVOFF , 0 , // 13: Don't invert display, no args, no delay
|
||||
ST7735_MADCTL , 1 , // 14: Memory access control (directions), 1 arg:
|
||||
0xC0 | TFT_MAD_COLOR_ORDER, // row addr/col addr, bottom to top refresh
|
||||
ST7735_COLMOD , 1 , // 15: set color mode, 1 arg, no delay:
|
||||
0x05 }, // 16-bit color
|
||||
|
||||
Rcmd2green[] = { // Init for 7735R, part 2 (green tab only)
|
||||
2, // 2 commands in list:
|
||||
ST7735_CASET , 4 , // 1: Column addr set, 4 args, no delay:
|
||||
0x00, 0x02, // XSTART = 0
|
||||
0x00, 0x7F+0x02, // XEND = 127
|
||||
ST7735_RASET , 4 , // 2: Row addr set, 4 args, no delay:
|
||||
0x00, 0x01, // XSTART = 0
|
||||
0x00, 0x9F+0x01 }, // XEND = 159
|
||||
|
||||
Rcmd2red[] = { // Init for 7735R, part 2 (red tab only)
|
||||
2, // 2 commands in list:
|
||||
ST7735_CASET , 4 , // 1: Column addr set, 4 args, no delay:
|
||||
0x00, 0x00, // XSTART = 0
|
||||
0x00, 0x7F, // XEND = 127
|
||||
ST7735_RASET , 4 , // 2: Row addr set, 4 args, no delay:
|
||||
0x00, 0x00, // XSTART = 0
|
||||
0x00, 0x9F }, // XEND = 159
|
||||
|
||||
// Frame control init for RobotLCD, taken from https://github.com/arduino-libraries/TFT, Adafruit_ST7735.cpp l. 263, commit 61b8a7e
|
||||
Rcmd3RobotLCD[] = {
|
||||
3,
|
||||
ST7735_FRMCTR1, 2 , // 1: Frame rate ctrl - normal mode, 2 args
|
||||
0x0B, 0x14,
|
||||
ST7735_FRMCTR2, 2 , // 2: Frame rate ctrl - idle mode, 2 args
|
||||
0x0B, 0x14,
|
||||
ST7735_FRMCTR3, 4 , // 3: Frame rate ctrl - partial mode, 4 args
|
||||
0x0B, 0x14,
|
||||
0x0B, 0x14 },
|
||||
|
||||
Rcmd3[] = { // Init for 7735R, part 3 (red or green tab)
|
||||
4, // 4 commands in list:
|
||||
ST7735_GMCTRP1, 16 , // 1: 16 args, no delay:
|
||||
0x02, 0x1c, 0x07, 0x12,
|
||||
0x37, 0x32, 0x29, 0x2d,
|
||||
0x29, 0x25, 0x2B, 0x39,
|
||||
0x00, 0x01, 0x03, 0x10,
|
||||
ST7735_GMCTRN1, 16 , // 2: 16 args, no delay:
|
||||
0x03, 0x1d, 0x07, 0x06,
|
||||
0x2E, 0x2C, 0x29, 0x2D,
|
||||
0x2E, 0x2E, 0x37, 0x3F,
|
||||
0x00, 0x00, 0x02, 0x10,
|
||||
ST7735_NORON , TFT_INIT_DELAY, // 3: Normal display on, no args, w/delay
|
||||
10, // 10 ms delay
|
||||
ST7735_DISPON , TFT_INIT_DELAY, // 4: Main screen turn on, no args w/delay
|
||||
100 }; // 100 ms delay
|
||||
|
||||
if (tabcolor == INITB)
|
||||
{
|
||||
commandList(Bcmd);
|
||||
}
|
||||
else
|
||||
{
|
||||
commandList(Rcmd1);
|
||||
|
||||
if (tabcolor == INITR_GREENTAB)
|
||||
{
|
||||
commandList(Rcmd2green);
|
||||
colstart = 2;
|
||||
rowstart = 1;
|
||||
}
|
||||
else if (tabcolor == INITR_GREENTAB2)
|
||||
{
|
||||
commandList(Rcmd2green);
|
||||
writecommand(ST7735_MADCTL);
|
||||
writedata(0xC0 | TFT_MAD_COLOR_ORDER);
|
||||
colstart = 2;
|
||||
rowstart = 1;
|
||||
}
|
||||
else if (tabcolor == INITR_GREENTAB3)
|
||||
{
|
||||
commandList(Rcmd2green);
|
||||
colstart = 2;
|
||||
rowstart = 3;
|
||||
}
|
||||
else if (tabcolor == INITR_GREENTAB128)
|
||||
{
|
||||
commandList(Rcmd2green);
|
||||
colstart = 0;
|
||||
rowstart = 32;
|
||||
}
|
||||
else if (tabcolor == INITR_GREENTAB160x80)
|
||||
{
|
||||
commandList(Rcmd2green);
|
||||
writecommand(TFT_INVON);
|
||||
colstart = 26;
|
||||
rowstart = 1;
|
||||
}
|
||||
else if (tabcolor == INITR_ROBOTLCD)
|
||||
{
|
||||
commandList(Rcmd2green);
|
||||
commandList(Rcmd3RobotLCD);
|
||||
}
|
||||
else if (tabcolor == INITR_REDTAB160x80)
|
||||
{
|
||||
commandList(Rcmd2green);
|
||||
colstart = 24;
|
||||
rowstart = 0;
|
||||
}
|
||||
else if (tabcolor == INITR_REDTAB)
|
||||
{
|
||||
commandList(Rcmd2red);
|
||||
}
|
||||
else if (tabcolor == INITR_BLACKTAB)
|
||||
{
|
||||
writecommand(ST7735_MADCTL);
|
||||
writedata(0xC0 | TFT_MAD_COLOR_ORDER);
|
||||
}
|
||||
|
||||
commandList(Rcmd3);
|
||||
}
|
||||
}
|
||||
@@ -1,132 +0,0 @@
|
||||
|
||||
// This is the command sequence that rotates the ST7735 driver coordinate frame
|
||||
|
||||
rotation = m % 4; // Limit the range of values to 0-3
|
||||
|
||||
writecommand(TFT_MADCTL);
|
||||
switch (rotation) {
|
||||
case 0:
|
||||
if (tabcolor == INITR_BLACKTAB) {
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
|
||||
} else if(tabcolor == INITR_GREENTAB2) {
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
|
||||
colstart = 2;
|
||||
rowstart = 1;
|
||||
} else if(tabcolor == INITR_GREENTAB3) {
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
|
||||
colstart = 2;
|
||||
rowstart = 3;
|
||||
} else if(tabcolor == INITR_GREENTAB128) {
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_MH | TFT_MAD_COLOR_ORDER);
|
||||
colstart = 0;
|
||||
rowstart = 32;
|
||||
} else if(tabcolor == INITR_GREENTAB160x80) {
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_MH | TFT_MAD_COLOR_ORDER);
|
||||
colstart = 26;
|
||||
rowstart = 1;
|
||||
} else if(tabcolor == INITR_REDTAB160x80) {
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_MH | TFT_MAD_COLOR_ORDER);
|
||||
colstart = 24;
|
||||
rowstart = 0;
|
||||
} else if(tabcolor == INITB) {
|
||||
writedata(TFT_MAD_MX | TFT_MAD_COLOR_ORDER);
|
||||
} else {
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
|
||||
}
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 1:
|
||||
if (tabcolor == INITR_BLACKTAB) {
|
||||
writedata(TFT_MAD_MY | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
|
||||
} else if(tabcolor == INITR_GREENTAB2) {
|
||||
writedata(TFT_MAD_MY | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
|
||||
colstart = 1;
|
||||
rowstart = 2;
|
||||
} else if(tabcolor == INITR_GREENTAB3) {
|
||||
writedata(TFT_MAD_MY | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
|
||||
colstart = 3;
|
||||
rowstart = 2;
|
||||
} else if(tabcolor == INITR_GREENTAB128) {
|
||||
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
|
||||
colstart = 32;
|
||||
rowstart = 0;
|
||||
} else if(tabcolor == INITR_GREENTAB160x80) {
|
||||
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
|
||||
colstart = 1;
|
||||
rowstart = 26;
|
||||
} else if(tabcolor == INITR_REDTAB160x80) {
|
||||
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
|
||||
colstart = 0;
|
||||
rowstart = 24;
|
||||
} else if(tabcolor == INITB) {
|
||||
writedata(TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
|
||||
} else {
|
||||
writedata(TFT_MAD_MY | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
|
||||
}
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
case 2:
|
||||
if (tabcolor == INITR_BLACKTAB) {
|
||||
writedata(TFT_MAD_COLOR_ORDER);
|
||||
} else if(tabcolor == INITR_GREENTAB2) {
|
||||
writedata(TFT_MAD_COLOR_ORDER);
|
||||
colstart = 2;
|
||||
rowstart = 1;
|
||||
} else if(tabcolor == INITR_GREENTAB3) {
|
||||
writedata(TFT_MAD_COLOR_ORDER);
|
||||
colstart = 2;
|
||||
rowstart = 1;
|
||||
} else if(tabcolor == INITR_GREENTAB128) {
|
||||
writedata(TFT_MAD_COLOR_ORDER);
|
||||
colstart = 0;
|
||||
rowstart = 0;
|
||||
} else if(tabcolor == INITR_GREENTAB160x80) {
|
||||
writedata(TFT_MAD_COLOR_ORDER);
|
||||
colstart = 26;
|
||||
rowstart = 1;
|
||||
} else if(tabcolor == INITR_REDTAB160x80) {
|
||||
writedata(TFT_MAD_COLOR_ORDER);
|
||||
colstart = 24;
|
||||
rowstart = 0;
|
||||
} else if(tabcolor == INITB) {
|
||||
writedata(TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
|
||||
} else {
|
||||
writedata(TFT_MAD_COLOR_ORDER);
|
||||
}
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 3:
|
||||
if (tabcolor == INITR_BLACKTAB) {
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
|
||||
} else if(tabcolor == INITR_GREENTAB2) {
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
|
||||
colstart = 1;
|
||||
rowstart = 2;
|
||||
} else if(tabcolor == INITR_GREENTAB3) {
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
|
||||
colstart = 1;
|
||||
rowstart = 2;
|
||||
} else if(tabcolor == INITR_GREENTAB128) {
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
|
||||
colstart = 0;
|
||||
rowstart = 0;
|
||||
} else if(tabcolor == INITR_GREENTAB160x80) {
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
|
||||
colstart = 1;
|
||||
rowstart = 26;
|
||||
} else if(tabcolor == INITR_REDTAB160x80) {
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
|
||||
colstart = 0;
|
||||
rowstart = 24;
|
||||
} else if(tabcolor == INITB) {
|
||||
writedata(TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
|
||||
} else {
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
|
||||
}
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
}
|
||||
@@ -1,178 +0,0 @@
|
||||
// Change the width and height if required (defined in portrait mode)
|
||||
// or use the constructor to over-ride defaults
|
||||
#ifndef TFT_WIDTH
|
||||
#define TFT_WIDTH 240
|
||||
#endif
|
||||
#ifndef TFT_HEIGHT
|
||||
#define TFT_HEIGHT 320
|
||||
#endif
|
||||
|
||||
#if (TFT_HEIGHT == 240) && (TFT_WIDTH == 240)
|
||||
#ifndef CGRAM_OFFSET
|
||||
#define CGRAM_OFFSET
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Adafruit 1.44 TFT support
|
||||
#if (TFT_HEIGHT == 240) && (TFT_WIDTH == 135)
|
||||
#ifndef CGRAM_OFFSET
|
||||
#define CGRAM_OFFSET
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Adafruit 1.69 round corner TFT support
|
||||
#if (TFT_HEIGHT == 280) && (TFT_WIDTH == 240)
|
||||
#ifndef CGRAM_OFFSET
|
||||
#define CGRAM_OFFSET
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// 1.47" 172x320 Round Rectangle Color IPS TFT Display
|
||||
#if (TFT_HEIGHT == 320) && (TFT_WIDTH == 172)
|
||||
#ifndef CGRAM_OFFSET
|
||||
#define CGRAM_OFFSET
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (TFT_HEIGHT == 320) && (TFT_WIDTH == 170)
|
||||
#ifndef CGRAM_OFFSET
|
||||
#define CGRAM_OFFSET
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (TFT_HEIGHT == 300) && (TFT_WIDTH == 240)
|
||||
#ifndef CGRAM_OFFSET
|
||||
#define CGRAM_OFFSET
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Delay between some initialisation commands
|
||||
#define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
|
||||
|
||||
|
||||
// Generic commands used by TFT_eSPI.cpp
|
||||
#define TFT_NOP 0x00
|
||||
#define TFT_SWRST 0x01
|
||||
|
||||
#define TFT_SLPIN 0x10
|
||||
#define TFT_SLPOUT 0x11
|
||||
#define TFT_NORON 0x13
|
||||
|
||||
#define TFT_INVOFF 0x20
|
||||
#define TFT_INVON 0x21
|
||||
#define TFT_DISPOFF 0x28
|
||||
#define TFT_DISPON 0x29
|
||||
#define TFT_CASET 0x2A
|
||||
#define TFT_PASET 0x2B
|
||||
#define TFT_RAMWR 0x2C
|
||||
#define TFT_RAMRD 0x2E
|
||||
#define TFT_MADCTL 0x36
|
||||
#define TFT_COLMOD 0x3A
|
||||
|
||||
// Flags for TFT_MADCTL
|
||||
#define TFT_MAD_MY 0x80
|
||||
#define TFT_MAD_MX 0x40
|
||||
#define TFT_MAD_MV 0x20
|
||||
#define TFT_MAD_ML 0x10
|
||||
#define TFT_MAD_RGB 0x00
|
||||
#define TFT_MAD_BGR 0x08
|
||||
#define TFT_MAD_MH 0x04
|
||||
#define TFT_MAD_SS 0x02
|
||||
#define TFT_MAD_GS 0x01
|
||||
|
||||
#ifdef TFT_RGB_ORDER
|
||||
#if (TFT_RGB_ORDER == 1)
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
|
||||
#else
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
|
||||
#endif
|
||||
#else
|
||||
#ifdef CGRAM_OFFSET
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
|
||||
#else
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read
|
||||
|
||||
#define ST_CMD_DELAY 0x80 // special signifier for command lists
|
||||
#define ST7789_240x240_XSTART 0
|
||||
#define ST7789_240x240_YSTART 0
|
||||
|
||||
// ST7789 specific commands used in init
|
||||
#define ST7789_NOP 0x00
|
||||
#define ST7789_SWRESET 0x01
|
||||
#define ST7789_RDDID 0x04
|
||||
#define ST7789_RDDST 0x09
|
||||
|
||||
#define ST7789_RDDPM 0x0A // Read display power mode
|
||||
#define ST7789_RDD_MADCTL 0x0B // Read display MADCTL
|
||||
#define ST7789_RDD_COLMOD 0x0C // Read display pixel format
|
||||
#define ST7789_RDDIM 0x0D // Read display image mode
|
||||
#define ST7789_RDDSM 0x0E // Read display signal mode
|
||||
#define ST7789_RDDSR 0x0F // Read display self-diagnostic result (ST7789V)
|
||||
|
||||
#define ST7789_SLPIN 0x10
|
||||
#define ST7789_SLPOUT 0x11
|
||||
#define ST7789_PTLON 0x12
|
||||
#define ST7789_NORON 0x13
|
||||
|
||||
#define ST7789_INVOFF 0x20
|
||||
#define ST7789_INVON 0x21
|
||||
#define ST7789_GAMSET 0x26 // Gamma set
|
||||
#define ST7789_DISPOFF 0x28
|
||||
#define ST7789_DISPON 0x29
|
||||
#define ST7789_CASET 0x2A
|
||||
#define ST7789_RASET 0x2B
|
||||
#define ST7789_RAMWR 0x2C
|
||||
#define ST7789_RGBSET 0x2D // Color setting for 4096, 64K and 262K colors
|
||||
#define ST7789_RAMRD 0x2E
|
||||
|
||||
#define ST7789_PTLAR 0x30
|
||||
#define ST7789_VSCRDEF 0x33 // Vertical scrolling definition (ST7789V)
|
||||
#define ST7789_TEOFF 0x34 // Tearing effect line off
|
||||
#define ST7789_TEON 0x35 // Tearing effect line on
|
||||
#define ST7789_MADCTL 0x36 // Memory data access control
|
||||
#define ST7789_IDMOFF 0x38 // Idle mode off
|
||||
#define ST7789_IDMON 0x39 // Idle mode on
|
||||
#define ST7789_RAMWRC 0x3C // Memory write continue (ST7789V)
|
||||
#define ST7789_RAMRDC 0x3E // Memory read continue (ST7789V)
|
||||
#define ST7789_COLMOD 0x3A
|
||||
|
||||
#define ST7789_RAMCTRL 0xB0 // RAM control
|
||||
#define ST7789_RGBCTRL 0xB1 // RGB control
|
||||
#define ST7789_PORCTRL 0xB2 // Porch control
|
||||
#define ST7789_FRCTRL1 0xB3 // Frame rate control
|
||||
#define ST7789_PARCTRL 0xB5 // Partial mode control
|
||||
#define ST7789_GCTRL 0xB7 // Gate control
|
||||
#define ST7789_GTADJ 0xB8 // Gate on timing adjustment
|
||||
#define ST7789_DGMEN 0xBA // Digital gamma enable
|
||||
#define ST7789_VCOMS 0xBB // VCOMS setting
|
||||
#define ST7789_LCMCTRL 0xC0 // LCM control
|
||||
#define ST7789_IDSET 0xC1 // ID setting
|
||||
#define ST7789_VDVVRHEN 0xC2 // VDV and VRH command enable
|
||||
#define ST7789_VRHS 0xC3 // VRH set
|
||||
#define ST7789_VDVSET 0xC4 // VDV setting
|
||||
#define ST7789_VCMOFSET 0xC5 // VCOMS offset set
|
||||
#define ST7789_FRCTR2 0xC6 // FR Control 2
|
||||
#define ST7789_CABCCTRL 0xC7 // CABC control
|
||||
#define ST7789_REGSEL1 0xC8 // Register value section 1
|
||||
#define ST7789_REGSEL2 0xCA // Register value section 2
|
||||
#define ST7789_PWMFRSEL 0xCC // PWM frequency selection
|
||||
#define ST7789_PWCTRL1 0xD0 // Power control 1
|
||||
#define ST7789_VAPVANEN 0xD2 // Enable VAP/VAN signal output
|
||||
#define ST7789_CMD2EN 0xDF // Command 2 enable
|
||||
#define ST7789_PVGAMCTRL 0xE0 // Positive voltage gamma control
|
||||
#define ST7789_NVGAMCTRL 0xE1 // Negative voltage gamma control
|
||||
#define ST7789_DGMLUTR 0xE2 // Digital gamma look-up table for red
|
||||
#define ST7789_DGMLUTB 0xE3 // Digital gamma look-up table for blue
|
||||
#define ST7789_GATECTRL 0xE4 // Gate control
|
||||
#define ST7789_SPI2EN 0xE7 // SPI2 enable
|
||||
#define ST7789_PWCTRL2 0xE8 // Power control 2
|
||||
#define ST7789_EQCTRL 0xE9 // Equalize time control
|
||||
#define ST7789_PROMCTRL 0xEC // Program control
|
||||
#define ST7789_PROMEN 0xFA // Program mode enable
|
||||
#define ST7789_NVMSET 0xFC // NVM setting
|
||||
#define ST7789_PROMACT 0xFE // Program action
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
|
||||
// This is the command sequence that initialises the ST7789 driver
|
||||
|
||||
// Configure ST7789 display
|
||||
|
||||
{
|
||||
static const uint8_t PROGMEM
|
||||
st7789[] = {
|
||||
8,
|
||||
TFT_SLPOUT, TFT_INIT_DELAY, 255,
|
||||
TFT_COLMOD, 1+TFT_INIT_DELAY, 0x55, 10,
|
||||
TFT_MADCTL, 1, 0x00,
|
||||
TFT_CASET, 4, 0x00, 0x00, 0x00, 0xF0,
|
||||
TFT_PASET, 4, 0x00, 0x00, 0x00, 0xF0,
|
||||
TFT_INVON, TFT_INIT_DELAY, 10,
|
||||
TFT_NORON, TFT_INIT_DELAY, 10,
|
||||
TFT_DISPON, TFT_INIT_DELAY, 255
|
||||
};
|
||||
|
||||
commandList(st7789);
|
||||
}
|
||||
// End of ST7789 display configuration
|
||||
@@ -1,140 +0,0 @@
|
||||
// This is the command sequence that rotates the ST7789 driver coordinate frame
|
||||
|
||||
writecommand(TFT_MADCTL);
|
||||
rotation = m % 4;
|
||||
switch (rotation) {
|
||||
case 0: // Portrait
|
||||
#ifdef CGRAM_OFFSET
|
||||
if (_init_width == 135)
|
||||
{
|
||||
colstart = 52;
|
||||
rowstart = 40;
|
||||
}
|
||||
else if(_init_height == 280)
|
||||
{
|
||||
colstart = 0;
|
||||
rowstart = 20;
|
||||
}
|
||||
else if(_init_width == 172)
|
||||
{
|
||||
colstart = 34;
|
||||
rowstart = 0;
|
||||
}
|
||||
else if(_init_width == 170)
|
||||
{
|
||||
colstart = 35;
|
||||
rowstart = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
colstart = 0;
|
||||
rowstart = 0;
|
||||
}
|
||||
#endif
|
||||
writedata(TFT_MAD_COLOR_ORDER);
|
||||
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
|
||||
case 1: // Landscape (Portrait + 90)
|
||||
#ifdef CGRAM_OFFSET
|
||||
if (_init_width == 135)
|
||||
{
|
||||
colstart = 40;
|
||||
rowstart = 53;
|
||||
}
|
||||
else if(_init_height == 280)
|
||||
{
|
||||
colstart = 20;
|
||||
rowstart = 0;
|
||||
}
|
||||
else if(_init_width == 172)
|
||||
{
|
||||
colstart = 0;
|
||||
rowstart = 34;
|
||||
}
|
||||
else if(_init_width == 170)
|
||||
{
|
||||
colstart = 0;
|
||||
rowstart = 35;
|
||||
}
|
||||
else
|
||||
{
|
||||
colstart = 0;
|
||||
rowstart = 0;
|
||||
}
|
||||
#endif
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
|
||||
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
|
||||
case 2: // Inverter portrait
|
||||
#ifdef CGRAM_OFFSET
|
||||
if (_init_width == 135)
|
||||
{
|
||||
colstart = 53;
|
||||
rowstart = 40;
|
||||
}
|
||||
else if(_init_height == 280)
|
||||
{
|
||||
colstart = 0;
|
||||
rowstart = 20;
|
||||
}
|
||||
else if(_init_width == 172)
|
||||
{
|
||||
colstart = 34;
|
||||
rowstart = 0;
|
||||
}
|
||||
else if(_init_width == 170)
|
||||
{
|
||||
colstart = 35;
|
||||
rowstart = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
colstart = 0;
|
||||
rowstart = 80;
|
||||
}
|
||||
#endif
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
|
||||
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 3: // Inverted landscape
|
||||
#ifdef CGRAM_OFFSET
|
||||
if (_init_width == 135)
|
||||
{
|
||||
colstart = 40;
|
||||
rowstart = 52;
|
||||
}
|
||||
else if(_init_height == 280)
|
||||
{
|
||||
colstart = 20;
|
||||
rowstart = 0;
|
||||
}
|
||||
else if(_init_width == 172)
|
||||
{
|
||||
colstart = 0;
|
||||
rowstart = 34;
|
||||
}
|
||||
else if(_init_width == 170)
|
||||
{
|
||||
colstart = 0;
|
||||
rowstart = 35;
|
||||
}
|
||||
else
|
||||
{
|
||||
colstart = 80;
|
||||
rowstart = 0;
|
||||
}
|
||||
#endif
|
||||
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
|
||||
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
}
|
||||
@@ -1,175 +0,0 @@
|
||||
// Change the width and height if required (defined in portrait mode)
|
||||
// or use the constructor to over-ride defaults
|
||||
#ifndef TFT_WIDTH
|
||||
#define TFT_WIDTH 240
|
||||
#endif
|
||||
#ifndef TFT_HEIGHT
|
||||
#define TFT_HEIGHT 320
|
||||
#endif
|
||||
|
||||
#if (TFT_HEIGHT == 240) && (TFT_WIDTH == 240)
|
||||
#ifndef CGRAM_OFFSET
|
||||
#define CGRAM_OFFSET
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Adafruit 1.44 TFT support
|
||||
#if (TFT_HEIGHT == 240) && (TFT_WIDTH == 135)
|
||||
#ifndef CGRAM_OFFSET
|
||||
#define CGRAM_OFFSET
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Adafruit 1.69 round corner TFT support
|
||||
#if (TFT_HEIGHT == 280) && (TFT_WIDTH == 240)
|
||||
#ifndef CGRAM_OFFSET
|
||||
#define CGRAM_OFFSET
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// 1.47" 172x320 Round Rectangle Color IPS TFT Display
|
||||
#if (TFT_HEIGHT == 320) && (TFT_WIDTH == 172)
|
||||
#ifndef CGRAM_OFFSET
|
||||
#define CGRAM_OFFSET
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (TFT_HEIGHT == 320) && (TFT_WIDTH == 170)
|
||||
#ifndef CGRAM_OFFSET
|
||||
#define CGRAM_OFFSET
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (TFT_HEIGHT == 300) && (TFT_WIDTH == 240)
|
||||
#ifndef CGRAM_OFFSET
|
||||
#define CGRAM_OFFSET
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Delay between some initialisation commands
|
||||
#define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
|
||||
|
||||
|
||||
// Generic commands used by TFT_eSPI.cpp
|
||||
#define TFT_NOP 0x00
|
||||
#define TFT_SWRST 0x01
|
||||
|
||||
#define TFT_SLPIN 0x10
|
||||
#define TFT_SLPOUT 0x11
|
||||
#define TFT_NORON 0x13
|
||||
|
||||
#define TFT_INVOFF 0x20
|
||||
#define TFT_INVON 0x21
|
||||
#define TFT_DISPOFF 0x28
|
||||
#define TFT_DISPON 0x29
|
||||
#define TFT_CASET 0x2A
|
||||
#define TFT_PASET 0x2B
|
||||
#define TFT_RAMWR 0x2C
|
||||
#define TFT_RAMRD 0x2E
|
||||
#define TFT_MADCTL 0x36
|
||||
#define TFT_COLMOD 0x3A
|
||||
|
||||
// Flags for TFT_MADCTL
|
||||
#define TFT_MAD_MY 0x80
|
||||
#define TFT_MAD_MX 0x40
|
||||
#define TFT_MAD_MV 0x20
|
||||
#define TFT_MAD_ML 0x10
|
||||
#define TFT_MAD_RGB 0x00
|
||||
#define TFT_MAD_BGR 0x08
|
||||
#define TFT_MAD_MH 0x04
|
||||
#define TFT_MAD_SS 0x02
|
||||
#define TFT_MAD_GS 0x01
|
||||
|
||||
#ifdef TFT_RGB_ORDER
|
||||
#if (TFT_RGB_ORDER == 1)
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
|
||||
#else
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
|
||||
#endif
|
||||
#else
|
||||
#ifdef CGRAM_OFFSET
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
|
||||
#else
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read
|
||||
|
||||
// ST7789 specific commands used in init
|
||||
#define ST7789_NOP 0x00
|
||||
#define ST7789_SWRESET 0x01
|
||||
#define ST7789_RDDID 0x04
|
||||
#define ST7789_RDDST 0x09
|
||||
|
||||
#define ST7789_RDDPM 0x0A // Read display power mode
|
||||
#define ST7789_RDD_MADCTL 0x0B // Read display MADCTL
|
||||
#define ST7789_RDD_COLMOD 0x0C // Read display pixel format
|
||||
#define ST7789_RDDIM 0x0D // Read display image mode
|
||||
#define ST7789_RDDSM 0x0E // Read display signal mode
|
||||
#define ST7789_RDDSR 0x0F // Read display self-diagnostic result (ST7789V)
|
||||
|
||||
#define ST7789_SLPIN 0x10
|
||||
#define ST7789_SLPOUT 0x11
|
||||
#define ST7789_PTLON 0x12
|
||||
#define ST7789_NORON 0x13
|
||||
|
||||
#define ST7789_INVOFF 0x20
|
||||
#define ST7789_INVON 0x21
|
||||
#define ST7789_GAMSET 0x26 // Gamma set
|
||||
#define ST7789_DISPOFF 0x28
|
||||
#define ST7789_DISPON 0x29
|
||||
#define ST7789_CASET 0x2A
|
||||
#define ST7789_RASET 0x2B
|
||||
#define ST7789_RAMWR 0x2C
|
||||
#define ST7789_RGBSET 0x2D // Color setting for 4096, 64K and 262K colors
|
||||
#define ST7789_RAMRD 0x2E
|
||||
|
||||
#define ST7789_PTLAR 0x30
|
||||
#define ST7789_VSCRDEF 0x33 // Vertical scrolling definition (ST7789V)
|
||||
#define ST7789_TEOFF 0x34 // Tearing effect line off
|
||||
#define ST7789_TEON 0x35 // Tearing effect line on
|
||||
#define ST7789_MADCTL 0x36 // Memory data access control
|
||||
#define ST7789_VSCRSADD 0x37 // Vertical screoll address
|
||||
#define ST7789_IDMOFF 0x38 // Idle mode off
|
||||
#define ST7789_IDMON 0x39 // Idle mode on
|
||||
#define ST7789_RAMWRC 0x3C // Memory write continue (ST7789V)
|
||||
#define ST7789_RAMRDC 0x3E // Memory read continue (ST7789V)
|
||||
#define ST7789_COLMOD 0x3A
|
||||
|
||||
#define ST7789_RAMCTRL 0xB0 // RAM control
|
||||
#define ST7789_RGBCTRL 0xB1 // RGB control
|
||||
#define ST7789_PORCTRL 0xB2 // Porch control
|
||||
#define ST7789_FRCTRL1 0xB3 // Frame rate control
|
||||
#define ST7789_PARCTRL 0xB5 // Partial mode control
|
||||
#define ST7789_GCTRL 0xB7 // Gate control
|
||||
#define ST7789_GTADJ 0xB8 // Gate on timing adjustment
|
||||
#define ST7789_DGMEN 0xBA // Digital gamma enable
|
||||
#define ST7789_VCOMS 0xBB // VCOMS setting
|
||||
#define ST7789_LCMCTRL 0xC0 // LCM control
|
||||
#define ST7789_IDSET 0xC1 // ID setting
|
||||
#define ST7789_VDVVRHEN 0xC2 // VDV and VRH command enable
|
||||
#define ST7789_VRHS 0xC3 // VRH set
|
||||
#define ST7789_VDVSET 0xC4 // VDV setting
|
||||
#define ST7789_VCMOFSET 0xC5 // VCOMS offset set
|
||||
#define ST7789_FRCTR2 0xC6 // FR Control 2
|
||||
#define ST7789_CABCCTRL 0xC7 // CABC control
|
||||
#define ST7789_REGSEL1 0xC8 // Register value section 1
|
||||
#define ST7789_REGSEL2 0xCA // Register value section 2
|
||||
#define ST7789_PWMFRSEL 0xCC // PWM frequency selection
|
||||
#define ST7789_PWCTRL1 0xD0 // Power control 1
|
||||
#define ST7789_VAPVANEN 0xD2 // Enable VAP/VAN signal output
|
||||
#define ST7789_CMD2EN 0xDF // Command 2 enable
|
||||
#define ST7789_PVGAMCTRL 0xE0 // Positive voltage gamma control
|
||||
#define ST7789_NVGAMCTRL 0xE1 // Negative voltage gamma control
|
||||
#define ST7789_DGMLUTR 0xE2 // Digital gamma look-up table for red
|
||||
#define ST7789_DGMLUTB 0xE3 // Digital gamma look-up table for blue
|
||||
#define ST7789_GATECTRL 0xE4 // Gate control
|
||||
#define ST7789_SPI2EN 0xE7 // SPI2 enable
|
||||
#define ST7789_PWCTRL2 0xE8 // Power control 2
|
||||
#define ST7789_EQCTRL 0xE9 // Equalize time control
|
||||
#define ST7789_PROMCTRL 0xEC // Program control
|
||||
#define ST7789_PROMEN 0xFA // Program mode enable
|
||||
#define ST7789_NVMSET 0xFC // NVM setting
|
||||
#define ST7789_PROMACT 0xFE // Program action
|
||||
|
||||
@@ -1,238 +0,0 @@
|
||||
|
||||
// This is the command sequence that initialises the ST7789 driver
|
||||
//
|
||||
// This setup information uses simple 8-bit SPI writecommand() and writedata() functions
|
||||
//
|
||||
// See ST7735_Setup.h file for an alternative format
|
||||
|
||||
#ifndef INIT_SEQUENCE_3
|
||||
{
|
||||
fillScreen(TFT_RED);
|
||||
writecommand(ST7789_SLPOUT); // Sleep out
|
||||
delay(120);
|
||||
|
||||
writecommand(ST7789_NORON); // Normal display mode on
|
||||
|
||||
//------------------------------display and color format setting--------------------------------//
|
||||
writecommand(ST7789_MADCTL);
|
||||
//writedata(0x00);
|
||||
writedata(TFT_MAD_COLOR_ORDER);
|
||||
|
||||
// JLX240 display datasheet
|
||||
writecommand(0xB6);
|
||||
writedata(0x0A);
|
||||
writedata(0x82);
|
||||
|
||||
writecommand(ST7789_RAMCTRL);
|
||||
writedata(0x00);
|
||||
writedata(0xE0); // 5 to 6-bit conversion: r0 = r5, b0 = b5
|
||||
|
||||
writecommand(ST7789_COLMOD);
|
||||
writedata(0x55);
|
||||
delay(10);
|
||||
|
||||
//--------------------------------ST7789V Frame rate setting----------------------------------//
|
||||
writecommand(ST7789_PORCTRL);
|
||||
writedata(0x0c);
|
||||
writedata(0x0c);
|
||||
writedata(0x00);
|
||||
writedata(0x33);
|
||||
writedata(0x33);
|
||||
|
||||
writecommand(ST7789_GCTRL); // Voltages: VGH / VGL
|
||||
writedata(0x35);
|
||||
|
||||
//---------------------------------ST7789V Power setting--------------------------------------//
|
||||
writecommand(ST7789_VCOMS);
|
||||
writedata(0x28); // JLX240 display datasheet
|
||||
|
||||
writecommand(ST7789_LCMCTRL);
|
||||
writedata(0x0C);
|
||||
|
||||
writecommand(ST7789_VDVVRHEN);
|
||||
writedata(0x01);
|
||||
writedata(0xFF);
|
||||
|
||||
writecommand(ST7789_VRHS); // voltage VRHS
|
||||
writedata(0x10);
|
||||
|
||||
writecommand(ST7789_VDVSET);
|
||||
writedata(0x20);
|
||||
|
||||
writecommand(ST7789_FRCTR2);
|
||||
writedata(0x0f);
|
||||
|
||||
writecommand(ST7789_PWCTRL1);
|
||||
writedata(0xa4);
|
||||
writedata(0xa1);
|
||||
|
||||
//--------------------------------ST7789V gamma setting---------------------------------------//
|
||||
writecommand(ST7789_PVGAMCTRL);
|
||||
writedata(0xd0);
|
||||
writedata(0x00);
|
||||
writedata(0x02);
|
||||
writedata(0x07);
|
||||
writedata(0x0a);
|
||||
writedata(0x28);
|
||||
writedata(0x32);
|
||||
writedata(0x44);
|
||||
writedata(0x42);
|
||||
writedata(0x06);
|
||||
writedata(0x0e);
|
||||
writedata(0x12);
|
||||
writedata(0x14);
|
||||
writedata(0x17);
|
||||
|
||||
writecommand(ST7789_NVGAMCTRL);
|
||||
writedata(0xd0);
|
||||
writedata(0x00);
|
||||
writedata(0x02);
|
||||
writedata(0x07);
|
||||
writedata(0x0a);
|
||||
writedata(0x28);
|
||||
writedata(0x31);
|
||||
writedata(0x54);
|
||||
writedata(0x47);
|
||||
writedata(0x0e);
|
||||
writedata(0x1c);
|
||||
writedata(0x17);
|
||||
writedata(0x1b);
|
||||
writedata(0x1e);
|
||||
|
||||
writecommand(ST7789_INVON);
|
||||
|
||||
writecommand(ST7789_CASET); // Column address set
|
||||
writedata(0x00);
|
||||
writedata(0x00);
|
||||
writedata(0x00);
|
||||
writedata(0xEF); // 239
|
||||
|
||||
writecommand(ST7789_RASET); // Row address set
|
||||
writedata(0x00);
|
||||
writedata(0x00);
|
||||
writedata(0x01);
|
||||
writedata(0x3F); // 319
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
end_tft_write();
|
||||
delay(120);
|
||||
begin_tft_write();
|
||||
|
||||
writecommand(ST7789_DISPON); //Display on
|
||||
delay(120);
|
||||
|
||||
#ifdef TFT_BL
|
||||
// Turn on the back-light LED
|
||||
digitalWrite(TFT_BL, HIGH);
|
||||
pinMode(TFT_BL, OUTPUT);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
// TTGO ESP32 S3 T-Display
|
||||
{
|
||||
writecommand(ST7789_SLPOUT); // Sleep out
|
||||
delay(120);
|
||||
|
||||
writecommand(ST7789_NORON); // Normal display mode on
|
||||
|
||||
//------------------------------display and color format setting--------------------------------//
|
||||
writecommand(ST7789_MADCTL);
|
||||
writedata(TFT_MAD_COLOR_ORDER);
|
||||
|
||||
// writecommand(ST7789_RAMCTRL);
|
||||
// writedata(0x00);
|
||||
// writedata(0xE0); // 5 to 6-bit conversion: r0 = r5, b0 = b5
|
||||
|
||||
writecommand(ST7789_COLMOD);
|
||||
writedata(0x55);
|
||||
delay(10);
|
||||
|
||||
//--------------------------------ST7789V Frame rate setting----------------------------------//
|
||||
writecommand(ST7789_PORCTRL);
|
||||
writedata(0x0b);
|
||||
writedata(0x0b);
|
||||
writedata(0x00);
|
||||
writedata(0x33);
|
||||
writedata(0x33);
|
||||
|
||||
writecommand(ST7789_GCTRL); // Voltages: VGH / VGL
|
||||
writedata(0x75);
|
||||
|
||||
//---------------------------------ST7789V Power setting--------------------------------------//
|
||||
writecommand(ST7789_VCOMS);
|
||||
writedata(0x28); // JLX240 display datasheet
|
||||
|
||||
writecommand(ST7789_LCMCTRL);
|
||||
writedata(0x2C);
|
||||
|
||||
writecommand(ST7789_VDVVRHEN);
|
||||
writedata(0x01);
|
||||
|
||||
writecommand(ST7789_VRHS); // voltage VRHS
|
||||
writedata(0x1F);
|
||||
|
||||
writecommand(ST7789_FRCTR2);
|
||||
writedata(0x13);
|
||||
|
||||
writecommand(ST7789_PWCTRL1);
|
||||
writedata(0xa7);
|
||||
|
||||
writecommand(ST7789_PWCTRL1);
|
||||
writedata(0xa4);
|
||||
writedata(0xa1);
|
||||
|
||||
writecommand(0xD6);
|
||||
writedata(0xa1);
|
||||
|
||||
//--------------------------------ST7789V gamma setting---------------------------------------//
|
||||
writecommand(ST7789_PVGAMCTRL);
|
||||
writedata(0xf0);
|
||||
writedata(0x05);
|
||||
writedata(0x0a);
|
||||
writedata(0x06);
|
||||
writedata(0x06);
|
||||
writedata(0x03);
|
||||
writedata(0x2b);
|
||||
writedata(0x32);
|
||||
writedata(0x43);
|
||||
writedata(0x36);
|
||||
writedata(0x11);
|
||||
writedata(0x10);
|
||||
writedata(0x2b);
|
||||
writedata(0x32);
|
||||
|
||||
writecommand(ST7789_NVGAMCTRL);
|
||||
writedata(0xf0);
|
||||
writedata(0x08);
|
||||
writedata(0x0c);
|
||||
writedata(0x0b);
|
||||
writedata(0x09);
|
||||
writedata(0x24);
|
||||
writedata(0x2b);
|
||||
writedata(0x22);
|
||||
writedata(0x43);
|
||||
writedata(0x38);
|
||||
writedata(0x15);
|
||||
writedata(0x16);
|
||||
writedata(0x2f);
|
||||
writedata(0x37);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
end_tft_write();
|
||||
delay(120);
|
||||
begin_tft_write();
|
||||
|
||||
writecommand(ST7789_DISPON); //Display on
|
||||
delay(120);
|
||||
|
||||
#ifdef TFT_BL
|
||||
// Turn on the back-light LED
|
||||
digitalWrite(TFT_BL, HIGH);
|
||||
pinMode(TFT_BL, OUTPUT);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
@@ -1,140 +0,0 @@
|
||||
// This is the command sequence that rotates the ST7789 driver coordinate frame
|
||||
|
||||
writecommand(TFT_MADCTL);
|
||||
rotation = m % 4;
|
||||
switch (rotation) {
|
||||
case 0: // Portrait
|
||||
#ifdef CGRAM_OFFSET
|
||||
if (_init_width == 135)
|
||||
{
|
||||
colstart = 52;
|
||||
rowstart = 40;
|
||||
}
|
||||
else if(_init_height == 280)
|
||||
{
|
||||
colstart = 0;
|
||||
rowstart = 20;
|
||||
}
|
||||
else if(_init_width == 172)
|
||||
{
|
||||
colstart = 34;
|
||||
rowstart = 0;
|
||||
}
|
||||
else if(_init_width == 170)
|
||||
{
|
||||
colstart = 35;
|
||||
rowstart = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
colstart = 0;
|
||||
rowstart = 0;
|
||||
}
|
||||
#endif
|
||||
writedata(TFT_MAD_COLOR_ORDER);
|
||||
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
|
||||
case 1: // Landscape (Portrait + 90)
|
||||
#ifdef CGRAM_OFFSET
|
||||
if (_init_width == 135)
|
||||
{
|
||||
colstart = 40;
|
||||
rowstart = 53;
|
||||
}
|
||||
else if(_init_height == 280)
|
||||
{
|
||||
colstart = 20;
|
||||
rowstart = 0;
|
||||
}
|
||||
else if(_init_width == 172)
|
||||
{
|
||||
colstart = 0;
|
||||
rowstart = 34;
|
||||
}
|
||||
else if(_init_width == 170)
|
||||
{
|
||||
colstart = 0;
|
||||
rowstart = 35;
|
||||
}
|
||||
else
|
||||
{
|
||||
colstart = 0;
|
||||
rowstart = 0;
|
||||
}
|
||||
#endif
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
|
||||
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
|
||||
case 2: // Inverter portrait
|
||||
#ifdef CGRAM_OFFSET
|
||||
if (_init_width == 135)
|
||||
{
|
||||
colstart = 53;
|
||||
rowstart = 40;
|
||||
}
|
||||
else if(_init_height == 280)
|
||||
{
|
||||
colstart = 0;
|
||||
rowstart = 20;
|
||||
}
|
||||
else if(_init_width == 172)
|
||||
{
|
||||
colstart = 34;
|
||||
rowstart = 0;
|
||||
}
|
||||
else if(_init_width == 170)
|
||||
{
|
||||
colstart = 35;
|
||||
rowstart = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
colstart = 0;
|
||||
rowstart = 80;
|
||||
}
|
||||
#endif
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
|
||||
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 3: // Inverted landscape
|
||||
#ifdef CGRAM_OFFSET
|
||||
if (_init_width == 135)
|
||||
{
|
||||
colstart = 40;
|
||||
rowstart = 52;
|
||||
}
|
||||
else if(_init_height == 280)
|
||||
{
|
||||
colstart = 20;
|
||||
rowstart = 0;
|
||||
}
|
||||
else if(_init_width == 172)
|
||||
{
|
||||
colstart = 0;
|
||||
rowstart = 34;
|
||||
}
|
||||
else if(_init_width == 170)
|
||||
{
|
||||
colstart = 0;
|
||||
rowstart = 35;
|
||||
}
|
||||
else
|
||||
{
|
||||
colstart = 80;
|
||||
rowstart = 0;
|
||||
}
|
||||
#endif
|
||||
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
|
||||
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
}
|
||||
@@ -1,107 +0,0 @@
|
||||
// Change the width and height if required (defined in portrait mode)
|
||||
// or use the constructor to over-ride defaults
|
||||
#ifndef TFT_WIDTH
|
||||
#define TFT_WIDTH 320
|
||||
#endif
|
||||
|
||||
#ifndef TFT_HEIGHT
|
||||
#define TFT_HEIGHT 480
|
||||
#endif
|
||||
|
||||
// Generic commands used by TFT_eSPI.cpp
|
||||
#define TFT_NOP 0x00
|
||||
#define TFT_SWRST 0x01
|
||||
|
||||
#define TFT_INVOFF 0x20
|
||||
#define TFT_INVON 0x21
|
||||
|
||||
#define TFT_DISPOFF 0x28
|
||||
#define TFT_DISPON 0x29
|
||||
|
||||
#define TFT_CASET 0x2A
|
||||
#define TFT_PASET 0x2B
|
||||
#define TFT_RAMWR 0x2C
|
||||
#define TFT_RAMRD 0x2E
|
||||
|
||||
#define TFT_MADCTL 0x36
|
||||
#define TFT_MAD_MY 0x80
|
||||
#define TFT_MAD_MX 0x40
|
||||
#define TFT_MAD_MV 0x20
|
||||
#define TFT_MAD_ML 0x10
|
||||
#define TFT_MAD_BGR 0x08
|
||||
#define TFT_MAD_MH 0x04
|
||||
#define TFT_MAD_RGB 0x00
|
||||
|
||||
#ifdef TFT_RGB_ORDER
|
||||
#if (TFT_RGB_ORDER == 1)
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
|
||||
#else
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
|
||||
#endif
|
||||
#else
|
||||
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
|
||||
#endif
|
||||
|
||||
// ST7796 specific commands
|
||||
#define ST7796_NOP 0x00
|
||||
#define ST7796_SWRESET 0x01
|
||||
#define ST7796_RDDID 0x04
|
||||
#define ST7796_RDDST 0x09
|
||||
|
||||
#define ST7796_SLPIN 0x10
|
||||
#define ST7796_SLPOUT 0x11
|
||||
#define ST7796_PTLON 0x12
|
||||
#define ST7796_NORON 0x13
|
||||
|
||||
#define ST7796_RDMODE 0x0A
|
||||
#define ST7796_RDMADCTL 0x0B
|
||||
#define ST7796_RDPIXFMT 0x0C
|
||||
#define ST7796_RDIMGFMT 0x0A
|
||||
#define ST7796_RDSELFDIAG 0x0F
|
||||
|
||||
#define ST7796_INVOFF 0x20
|
||||
#define ST7796_INVON 0x21
|
||||
|
||||
#define ST7796_DISPOFF 0x28
|
||||
#define ST7796_DISPON 0x29
|
||||
|
||||
#define ST7796_CASET 0x2A
|
||||
#define ST7796_PASET 0x2B
|
||||
#define ST7796_RAMWR 0x2C
|
||||
#define ST7796_RAMRD 0x2E
|
||||
|
||||
#define ST7796_PTLAR 0x30
|
||||
#define ST7796_VSCRDEF 0x33
|
||||
#define ST7796_MADCTL 0x36
|
||||
#define ST7796_VSCRSADD 0x37
|
||||
#define ST7796_PIXFMT 0x3A
|
||||
|
||||
#define ST7796_WRDISBV 0x51
|
||||
#define ST7796_RDDISBV 0x52
|
||||
#define ST7796_WRCTRLD 0x53
|
||||
|
||||
#define ST7796_FRMCTR1 0xB1
|
||||
#define ST7796_FRMCTR2 0xB2
|
||||
#define ST7796_FRMCTR3 0xB3
|
||||
#define ST7796_INVCTR 0xB4
|
||||
#define ST7796_DFUNCTR 0xB6
|
||||
|
||||
#define ST7796_PWCTR1 0xC0
|
||||
#define ST7796_PWCTR2 0xC1
|
||||
#define ST7796_PWCTR3 0xC2
|
||||
|
||||
#define ST7796_VMCTR1 0xC5
|
||||
#define ST7796_VMCOFF 0xC6
|
||||
|
||||
#define ST7796_RDID4 0xD3
|
||||
|
||||
#define ST7796_GMCTRP1 0xE0
|
||||
#define ST7796_GMCTRN1 0xE1
|
||||
|
||||
#define ST7796_MADCTL_MY 0x80
|
||||
#define ST7796_MADCTL_MX 0x40
|
||||
#define ST7796_MADCTL_MV 0x20
|
||||
#define ST7796_MADCTL_ML 0x10
|
||||
#define ST7796_MADCTL_RGB 0x00
|
||||
#define ST7796_MADCTL_BGR 0x08
|
||||
#define ST7796_MADCTL_MH 0x04
|
||||
@@ -1,107 +0,0 @@
|
||||
|
||||
// This is the command sequence that initialises the ST7796 driver
|
||||
//
|
||||
// This setup information uses simple 8-bit SPI writecommand() and writedata() functions
|
||||
//
|
||||
// See ST7735_Setup.h file for an alternative format
|
||||
|
||||
#define TFT_INIT_DELAY 0
|
||||
{
|
||||
delay(120);
|
||||
|
||||
writecommand(0x01); //Software reset
|
||||
delay(120);
|
||||
|
||||
writecommand(0x11); //Sleep exit
|
||||
delay(120);
|
||||
|
||||
writecommand(0xF0); //Command Set control
|
||||
writedata(0xC3); //Enable extension command 2 partI
|
||||
|
||||
writecommand(0xF0); //Command Set control
|
||||
writedata(0x96); //Enable extension command 2 partII
|
||||
|
||||
writecommand(0x36); //Memory Data Access Control MX, MY, RGB mode
|
||||
writedata(0x48); //X-Mirror, Top-Left to right-Buttom, RGB
|
||||
|
||||
writecommand(0x3A); //Interface Pixel Format
|
||||
writedata(0x55); //Control interface color format set to 16
|
||||
|
||||
|
||||
writecommand(0xB4); //Column inversion
|
||||
writedata(0x01); //1-dot inversion
|
||||
|
||||
writecommand(0xB6); //Display Function Control
|
||||
writedata(0x80); //Bypass
|
||||
writedata(0x02); //Source Output Scan from S1 to S960, Gate Output scan from G1 to G480, scan cycle=2
|
||||
writedata(0x3B); //LCD Drive Line=8*(59+1)
|
||||
|
||||
|
||||
writecommand(0xE8); //Display Output Ctrl Adjust
|
||||
writedata(0x40);
|
||||
writedata(0x8A);
|
||||
writedata(0x00);
|
||||
writedata(0x00);
|
||||
writedata(0x29); //Source eqaulizing period time= 22.5 us
|
||||
writedata(0x19); //Timing for "Gate start"=25 (Tclk)
|
||||
writedata(0xA5); //Timing for "Gate End"=37 (Tclk), Gate driver EQ function ON
|
||||
writedata(0x33);
|
||||
|
||||
writecommand(0xC1); //Power control2
|
||||
writedata(0x06); //VAP(GVDD)=3.85+( vcom+vcom offset), VAN(GVCL)=-3.85+( vcom+vcom offset)
|
||||
|
||||
writecommand(0xC2); //Power control 3
|
||||
writedata(0xA7); //Source driving current level=low, Gamma driving current level=High
|
||||
|
||||
writecommand(0xC5); //VCOM Control
|
||||
writedata(0x18); //VCOM=0.9
|
||||
|
||||
delay(120);
|
||||
|
||||
//ST7796 Gamma Sequence
|
||||
writecommand(0xE0); //Gamma"+"
|
||||
writedata(0xF0);
|
||||
writedata(0x09);
|
||||
writedata(0x0b);
|
||||
writedata(0x06);
|
||||
writedata(0x04);
|
||||
writedata(0x15);
|
||||
writedata(0x2F);
|
||||
writedata(0x54);
|
||||
writedata(0x42);
|
||||
writedata(0x3C);
|
||||
writedata(0x17);
|
||||
writedata(0x14);
|
||||
writedata(0x18);
|
||||
writedata(0x1B);
|
||||
|
||||
writecommand(0xE1); //Gamma"-"
|
||||
writedata(0xE0);
|
||||
writedata(0x09);
|
||||
writedata(0x0B);
|
||||
writedata(0x06);
|
||||
writedata(0x04);
|
||||
writedata(0x03);
|
||||
writedata(0x2B);
|
||||
writedata(0x43);
|
||||
writedata(0x42);
|
||||
writedata(0x3B);
|
||||
writedata(0x16);
|
||||
writedata(0x14);
|
||||
writedata(0x17);
|
||||
writedata(0x1B);
|
||||
|
||||
delay(120);
|
||||
|
||||
writecommand(0xF0); //Command Set control
|
||||
writedata(0x3C); //Disable extension command 2 partI
|
||||
|
||||
writecommand(0xF0); //Command Set control
|
||||
writedata(0x69); //Disable extension command 2 partII
|
||||
|
||||
end_tft_write();
|
||||
delay(120);
|
||||
begin_tft_write();
|
||||
|
||||
writecommand(0x29); //Display on
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
|
||||
// This is the command sequence that rotates the ST7796 driver coordinate frame
|
||||
|
||||
rotation = m % 8; // Limit the range of values to 0-7
|
||||
|
||||
writecommand(TFT_MADCTL);
|
||||
switch (rotation) {
|
||||
case 0:
|
||||
writedata(TFT_MAD_MX | TFT_MAD_COLOR_ORDER);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
#ifdef CGRAM_OFFSET
|
||||
if (_init_width == 222)
|
||||
{
|
||||
colstart = 49;
|
||||
rowstart = 0;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case 1:
|
||||
writedata(TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
#ifdef CGRAM_OFFSET
|
||||
if (_init_width == 222)
|
||||
{
|
||||
colstart = 0;
|
||||
rowstart = 49;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case 2:
|
||||
writedata(TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
#ifdef CGRAM_OFFSET
|
||||
if (_init_width == 222)
|
||||
{
|
||||
colstart = 49;
|
||||
rowstart = 0;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case 3:
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
#ifdef CGRAM_OFFSET
|
||||
if (_init_width == 222)
|
||||
{
|
||||
colstart = 0;
|
||||
rowstart = 49;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
// These next rotations are for bottom up BMP drawing
|
||||
case 4:
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 5:
|
||||
writedata(TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_COLOR_ORDER);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
case 6:
|
||||
writedata(TFT_MAD_COLOR_ORDER);
|
||||
_width = _init_width;
|
||||
_height = _init_height;
|
||||
break;
|
||||
case 7:
|
||||
writedata(TFT_MAD_MY | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
|
||||
_width = _init_height;
|
||||
_height = _init_width;
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -1,570 +0,0 @@
|
||||
// This is a Processing sketch, see https://processing.org/ to download the IDE
|
||||
|
||||
// Select the font, size and character ranges in the user configuration section
|
||||
// of this sketch, which starts at line 120. Instructions start at line 50.
|
||||
|
||||
|
||||
/*
|
||||
Software License Agreement (FreeBSD License)
|
||||
|
||||
Copyright (c) 2018 Bodmer (https://github.com/Bodmer)
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation are those
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// This is a processing sketch to create font files for the TFT_eSPI library:
|
||||
|
||||
// https://github.com/Bodmer/TFT_eSPI
|
||||
|
||||
// Coded by Bodmer January 2018, updated 10/2/19
|
||||
// Version 0.8
|
||||
|
||||
// >>>>>>>>>>>>>>>>>>>> INSTRUCTIONS <<<<<<<<<<<<<<<<<<<<
|
||||
|
||||
// See comments below in code for specifying the font parameters (point size,
|
||||
// unicode blocks to include etc.). Ranges of characters (glyphs) and specific
|
||||
// individual glyphs can be included in the created "*.vlw" font file.
|
||||
|
||||
// Created fonts are saved in the sketches "FontFiles" folder. Press Ctrl+K to
|
||||
// see that folder location.
|
||||
|
||||
// 16-bit Unicode point codes in the range 0x0000 - 0xFFFF are supported.
|
||||
// Codes 0-31 are control codes such as "tab" and "carraige return" etc.
|
||||
// and 32 is a "space", these should NOT be included.
|
||||
|
||||
// The sketch will convert True Type (a .ttf or .otf file) file stored in the
|
||||
// sketches "Data" folder as well as your computers' system fonts.
|
||||
|
||||
// To maximise rendering performance and the memory consumed only include the characters
|
||||
// you will use. Characters at the start of the file will render faster than those at
|
||||
// the end due to the buffering and file seeking overhead.
|
||||
|
||||
// The inclusion of "non-existant" characters in a font may give unpredicatable results
|
||||
// when rendering with the TFT_eSPI library. The Processing sketch window that pops up
|
||||
// to show the font characters will print "boxes" (also known as Tofu!) for non existant
|
||||
// characters.
|
||||
|
||||
// Once created the files must be loaded into the ESP32 or ESP8266 SPIFFS memory
|
||||
// using the Arduino IDE plugin detailed here:
|
||||
// https://github.com/esp8266/arduino-esp8266fs-plugin
|
||||
// https://github.com/me-no-dev/arduino-esp32fs-plugin
|
||||
|
||||
// When the sketch is run it will generate a file called "System_Font_List.txt" in the
|
||||
// sketch "FontFiles" folder, press Ctrl+K to see it. Open the file in a text editor to
|
||||
// view it. This list provides the font reference number needed below to locate that
|
||||
// font on your system.
|
||||
|
||||
// The sketch also lists all the available system fonts to the console, you can increase
|
||||
// the console line count (in preferences.txt) to stop some fonts scrolling out of view.
|
||||
// See link in File>Preferences to locate "preferences.txt" file. You must close
|
||||
// Processing then edit the file lines. If Processing is not closed first then the
|
||||
// edits will be overwritten by defaults! Edit "preferences.txt" as follows for
|
||||
// 3000 lines, then save, then run Processing again:
|
||||
|
||||
// console.length=3000; // Line 4 in file
|
||||
// console.scrollback.lines=3000; // Line 7 in file
|
||||
|
||||
|
||||
// Useful links:
|
||||
/*
|
||||
|
||||
https://en.wikipedia.org/wiki/Unicode_font
|
||||
|
||||
https://www.gnu.org/software/freefont/
|
||||
https://www.gnu.org/software/freefont/sources/
|
||||
https://www.gnu.org/software/freefont/ranges/
|
||||
http://savannah.gnu.org/projects/freefont/
|
||||
|
||||
http://www.google.com/get/noto/
|
||||
|
||||
https://github.com/Bodmer/TFT_eSPI
|
||||
https://github.com/esp8266/arduino-esp8266fs-plugin
|
||||
https://github.com/me-no-dev/arduino-esp32fs-plugin
|
||||
|
||||
>>>>>>>>>>>>>>>>>>>> END OF INSTRUCTIONS <<<<<<<<<<<<<<<<<<<< */
|
||||
|
||||
|
||||
import java.awt.Desktop; // Required to allow sketch to open file windows
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// >>>>>>>>>> USER CONFIGURED PARAMETERS START HERE <<<<<<<<<<
|
||||
|
||||
// Use font number or name, -1 for fontNumber means use fontName below, a value >=0 means use system font number from list.
|
||||
// When the sketch is run it will generate a file called "systemFontList.txt" in the sketch folder, press Ctrl+K to see it.
|
||||
// Open the "systemFontList.txt" in a text editor to view the font files and reference numbers for your system.
|
||||
|
||||
int fontNumber = -1; // << Use [Number] in brackets from the fonts listed.
|
||||
|
||||
// OR use font name for ttf files placed in the "Data" folder or the font number seen in IDE Console for system fonts
|
||||
// the font numbers are listed when the sketch is run.
|
||||
// | 1 2 | Maximum filename size for SPIFFS is 31 including leading /
|
||||
// 1234567890123456789012345 and added point size and .vlw extension, so max is 25
|
||||
String fontName = "Final-Frontier"; // Manually crop the filename length later after creation if needed
|
||||
// Note: SPIFFS does NOT accept underscore in a filename!
|
||||
String fontType = ".ttf";
|
||||
//String fontType = ".otf";
|
||||
|
||||
|
||||
// Define the font size in points for the TFT_eSPI font file
|
||||
int fontSize = 28;
|
||||
|
||||
// Font size to use in the Processing sketch display window that pops up (can be different to above)
|
||||
int displayFontSize = 28;
|
||||
|
||||
// Create a C header (.h file) ready to be used or copied in your sketch folder
|
||||
boolean createHeaderFile = true;
|
||||
|
||||
// Automaticely open the folder with created files when done
|
||||
boolean openFolder = true;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Next we specify which unicode blocks from the the Basic Multilingual Plane (BMP) are included in the final font file. //
|
||||
// Note: The ttf/otf font file MAY NOT contain all possible Unicode characters, refer to the fonts online documentation. //
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static final int[] unicodeBlocks = {
|
||||
// The list below has been created from the table here: https://en.wikipedia.org/wiki/Unicode_block
|
||||
// Remove // at start of lines below to include that unicode block, different code ranges can also be specified by
|
||||
// editing the start and end-of-range values. Multiple lines from the list below can be included, limited only by
|
||||
// the final font file size!
|
||||
|
||||
// Block range, //Block name, Code points, Assigned characters, Scripts
|
||||
// First, last, //Range is inclusive of first and last codes
|
||||
0x0021, 0x007E, //Basic Latin, 128, 128, Latin (52 characters), Common (76 characters)
|
||||
//0x0080, 0x00FF, //Latin-1 Supplement, 128, 128, Latin (64 characters), Common (64 characters)
|
||||
//0x0100, 0x017F, //Latin Extended-A, 128, 128, Latin
|
||||
//0x0180, 0x024F, //Latin Extended-B, 208, 208, Latin
|
||||
//0x0250, 0x02AF, //IPA Extensions, 96, 96, Latin
|
||||
//0x02B0, 0x02FF, //Spacing Modifier Letters, 80, 80, Bopomofo (2 characters), Latin (14 characters), Common (64 characters)
|
||||
//0x0300, 0x036F, //Combining Diacritical Marks, 112, 112, Inherited
|
||||
//0x0370, 0x03FF, //Greek and Coptic, 144, 135, Coptic (14 characters), Greek (117 characters), Common (4 characters)
|
||||
//0x0400, 0x04FF, //Cyrillic, 256, 256, Cyrillic (254 characters), Inherited (2 characters)
|
||||
//0x0500, 0x052F, //Cyrillic Supplement, 48, 48, Cyrillic
|
||||
//0x0530, 0x058F, //Armenian, 96, 89, Armenian (88 characters), Common (1 character)
|
||||
//0x0590, 0x05FF, //Hebrew, 112, 87, Hebrew
|
||||
//0x0600, 0x06FF, //Arabic, 256, 255, Arabic (237 characters), Common (6 characters), Inherited (12 characters)
|
||||
//0x0700, 0x074F, //Syriac, 80, 77, Syriac
|
||||
//0x0750, 0x077F, //Arabic Supplement, 48, 48, Arabic
|
||||
//0x0780, 0x07BF, //Thaana, 64, 50, Thaana
|
||||
//0x07C0, 0x07FF, //NKo, 64, 59, Nko
|
||||
//0x0800, 0x083F, //Samaritan, 64, 61, Samaritan
|
||||
//0x0840, 0x085F, //Mandaic, 32, 29, Mandaic
|
||||
//0x0860, 0x086F, //Syriac Supplement, 16, 11, Syriac
|
||||
//0x08A0, 0x08FF, //Arabic Extended-A, 96, 73, Arabic (72 characters), Common (1 character)
|
||||
//0x0900, 0x097F, //Devanagari, 128, 128, Devanagari (124 characters), Common (2 characters), Inherited (2 characters)
|
||||
//0x0980, 0x09FF, //Bengali, 128, 95, Bengali
|
||||
//0x0A00, 0x0A7F, //Gurmukhi, 128, 79, Gurmukhi
|
||||
//0x0A80, 0x0AFF, //Gujarati, 128, 91, Gujarati
|
||||
//0x0B00, 0x0B7F, //Oriya, 128, 90, Oriya
|
||||
//0x0B80, 0x0BFF, //Tamil, 128, 72, Tamil
|
||||
//0x0C00, 0x0C7F, //Telugu, 128, 96, Telugu
|
||||
//0x0C80, 0x0CFF, //Kannada, 128, 88, Kannada
|
||||
//0x0D00, 0x0D7F, //Malayalam, 128, 117, Malayalam
|
||||
//0x0D80, 0x0DFF, //Sinhala, 128, 90, Sinhala
|
||||
//0x0E00, 0x0E7F, //Thai, 128, 87, Thai (86 characters), Common (1 character)
|
||||
//0x0E80, 0x0EFF, //Lao, 128, 67, Lao
|
||||
//0x0F00, 0x0FFF, //Tibetan, 256, 211, Tibetan (207 characters), Common (4 characters)
|
||||
//0x1000, 0x109F, //Myanmar, 160, 160, Myanmar
|
||||
//0x10A0, 0x10FF, //Georgian, 96, 88, Georgian (87 characters), Common (1 character)
|
||||
//0x1100, 0x11FF, //Hangul Jamo, 256, 256, Hangul
|
||||
//0x1200, 0x137F, //Ethiopic, 384, 358, Ethiopic
|
||||
//0x1380, 0x139F, //Ethiopic Supplement, 32, 26, Ethiopic
|
||||
//0x13A0, 0x13FF, //Cherokee, 96, 92, Cherokee
|
||||
//0x1400, 0x167F, //Unified Canadian Aboriginal Syllabics, 640, 640, Canadian Aboriginal
|
||||
//0x1680, 0x169F, //Ogham, 32, 29, Ogham
|
||||
//0x16A0, 0x16FF, //Runic, 96, 89, Runic (86 characters), Common (3 characters)
|
||||
//0x1700, 0x171F, //Tagalog, 32, 20, Tagalog
|
||||
//0x1720, 0x173F, //Hanunoo, 32, 23, Hanunoo (21 characters), Common (2 characters)
|
||||
//0x1740, 0x175F, //Buhid, 32, 20, Buhid
|
||||
//0x1760, 0x177F, //Tagbanwa, 32, 18, Tagbanwa
|
||||
//0x1780, 0x17FF, //Khmer, 128, 114, Khmer
|
||||
//0x1800, 0x18AF, //Mongolian, 176, 156, Mongolian (153 characters), Common (3 characters)
|
||||
//0x18B0, 0x18FF, //Unified Canadian Aboriginal Syllabics Extended, 80, 70, Canadian Aboriginal
|
||||
//0x1900, 0x194F, //Limbu, 80, 68, Limbu
|
||||
//0x1950, 0x197F, //Tai Le, 48, 35, Tai Le
|
||||
//0x1980, 0x19DF, //New Tai Lue, 96, 83, New Tai Lue
|
||||
//0x19E0, 0x19FF, //Khmer Symbols, 32, 32, Khmer
|
||||
//0x1A00, 0x1A1F, //Buginese, 32, 30, Buginese
|
||||
//0x1A20, 0x1AAF, //Tai Tham, 144, 127, Tai Tham
|
||||
//0x1AB0, 0x1AFF, //Combining Diacritical Marks Extended, 80, 15, Inherited
|
||||
//0x1B00, 0x1B7F, //Balinese, 128, 121, Balinese
|
||||
//0x1B80, 0x1BBF, //Sundanese, 64, 64, Sundanese
|
||||
//0x1BC0, 0x1BFF, //Batak, 64, 56, Batak
|
||||
//0x1C00, 0x1C4F, //Lepcha, 80, 74, Lepcha
|
||||
//0x1C50, 0x1C7F, //Ol Chiki, 48, 48, Ol Chiki
|
||||
//0x1C80, 0x1C8F, //Cyrillic Extended-C, 16, 9, Cyrillic
|
||||
//0x1CC0, 0x1CCF, //Sundanese Supplement, 16, 8, Sundanese
|
||||
//0x1CD0, 0x1CFF, //Vedic Extensions, 48, 42, Common (15 characters), Inherited (27 characters)
|
||||
//0x1D00, 0x1D7F, //Phonetic Extensions, 128, 128, Cyrillic (2 characters), Greek (15 characters), Latin (111 characters)
|
||||
//0x1D80, 0x1DBF, //Phonetic Extensions Supplement, 64, 64, Greek (1 character), Latin (63 characters)
|
||||
//0x1DC0, 0x1DFF, //Combining Diacritical Marks Supplement, 64, 63, Inherited
|
||||
//0x1E00, 0x1EFF, //Latin Extended Additional, 256, 256, Latin
|
||||
//0x1F00, 0x1FFF, //Greek Extended, 256, 233, Greek
|
||||
//0x2000, 0x206F, //General Punctuation, 112, 111, Common (109 characters), Inherited (2 characters)
|
||||
//0x2070, 0x209F, //Superscripts and Subscripts, 48, 42, Latin (15 characters), Common (27 characters)
|
||||
//0x20A0, 0x20CF, //Currency Symbols, 48, 32, Common
|
||||
//0x20D0, 0x20FF, //Combining Diacritical Marks for Symbols, 48, 33, Inherited
|
||||
//0x2100, 0x214F, //Letterlike Symbols, 80, 80, Greek (1 character), Latin (4 characters), Common (75 characters)
|
||||
//0x2150, 0x218F, //Number Forms, 64, 60, Latin (41 characters), Common (19 characters)
|
||||
//0x2190, 0x21FF, //Arrows, 112, 112, Common
|
||||
//0x2200, 0x22FF, //Mathematical Operators, 256, 256, Common
|
||||
//0x2300, 0x23FF, //Miscellaneous Technical, 256, 256, Common
|
||||
//0x2400, 0x243F, //Control Pictures, 64, 39, Common
|
||||
//0x2440, 0x245F, //Optical Character Recognition, 32, 11, Common
|
||||
//0x2460, 0x24FF, //Enclosed Alphanumerics, 160, 160, Common
|
||||
//0x2500, 0x257F, //Box Drawing, 128, 128, Common
|
||||
//0x2580, 0x259F, //Block Elements, 32, 32, Common
|
||||
//0x25A0, 0x25FF, //Geometric Shapes, 96, 96, Common
|
||||
//0x2600, 0x26FF, //Miscellaneous Symbols, 256, 256, Common
|
||||
//0x2700, 0x27BF, //Dingbats, 192, 192, Common
|
||||
//0x27C0, 0x27EF, //Miscellaneous Mathematical Symbols-A, 48, 48, Common
|
||||
//0x27F0, 0x27FF, //Supplemental Arrows-A, 16, 16, Common
|
||||
//0x2800, 0x28FF, //Braille Patterns, 256, 256, Braille
|
||||
//0x2900, 0x297F, //Supplemental Arrows-B, 128, 128, Common
|
||||
//0x2980, 0x29FF, //Miscellaneous Mathematical Symbols-B, 128, 128, Common
|
||||
//0x2A00, 0x2AFF, //Supplemental Mathematical Operators, 256, 256, Common
|
||||
//0x2B00, 0x2BFF, //Miscellaneous Symbols and Arrows, 256, 207, Common
|
||||
//0x2C00, 0x2C5F, //Glagolitic, 96, 94, Glagolitic
|
||||
//0x2C60, 0x2C7F, //Latin Extended-C, 32, 32, Latin
|
||||
//0x2C80, 0x2CFF, //Coptic, 128, 123, Coptic
|
||||
//0x2D00, 0x2D2F, //Georgian Supplement, 48, 40, Georgian
|
||||
//0x2D30, 0x2D7F, //Tifinagh, 80, 59, Tifinagh
|
||||
//0x2D80, 0x2DDF, //Ethiopic Extended, 96, 79, Ethiopic
|
||||
//0x2DE0, 0x2DFF, //Cyrillic Extended-A, 32, 32, Cyrillic
|
||||
//0x2E00, 0x2E7F, //Supplemental Punctuation, 128, 74, Common
|
||||
//0x2E80, 0x2EFF, //CJK Radicals Supplement, 128, 115, Han
|
||||
//0x2F00, 0x2FDF, //Kangxi Radicals, 224, 214, Han
|
||||
//0x2FF0, 0x2FFF, //Ideographic Description Characters, 16, 12, Common
|
||||
//0x3000, 0x303F, //CJK Symbols and Punctuation, 64, 64, Han (15 characters), Hangul (2 characters), Common (43 characters), Inherited (4 characters)
|
||||
//0x3040, 0x309F, //Hiragana, 96, 93, Hiragana (89 characters), Common (2 characters), Inherited (2 characters)
|
||||
//0x30A0, 0x30FF, //Katakana, 96, 96, Katakana (93 characters), Common (3 characters)
|
||||
//0x3100, 0x312F, //Bopomofo, 48, 42, Bopomofo
|
||||
//0x3130, 0x318F, //Hangul Compatibility Jamo, 96, 94, Hangul
|
||||
//0x3190, 0x319F, //Kanbun, 16, 16, Common
|
||||
//0x31A0, 0x31BF, //Bopomofo Extended, 32, 27, Bopomofo
|
||||
//0x31C0, 0x31EF, //CJK Strokes, 48, 36, Common
|
||||
//0x31F0, 0x31FF, //Katakana Phonetic Extensions, 16, 16, Katakana
|
||||
//0x3200, 0x32FF, //Enclosed CJK Letters and Months, 256, 254, Hangul (62 characters), Katakana (47 characters), Common (145 characters)
|
||||
//0x3300, 0x33FF, //CJK Compatibility, 256, 256, Katakana (88 characters), Common (168 characters)
|
||||
//0x3400, 0x4DBF, //CJK Unified Ideographs Extension A, 6,592, 6,582, Han
|
||||
//0x4DC0, 0x4DFF, //Yijing Hexagram Symbols, 64, 64, Common
|
||||
//0x4E00, 0x9FFF, //CJK Unified Ideographs, 20,992, 20,971, Han
|
||||
//0xA000, 0xA48F, //Yi Syllables, 1,168, 1,165, Yi
|
||||
//0xA490, 0xA4CF, //Yi Radicals, 64, 55, Yi
|
||||
//0xA4D0, 0xA4FF, //Lisu, 48, 48, Lisu
|
||||
//0xA500, 0xA63F, //Vai, 320, 300, Vai
|
||||
//0xA640, 0xA69F, //Cyrillic Extended-B, 96, 96, Cyrillic
|
||||
//0xA6A0, 0xA6FF, //Bamum, 96, 88, Bamum
|
||||
//0xA700, 0xA71F, //Modifier Tone Letters, 32, 32, Common
|
||||
//0xA720, 0xA7FF, //Latin Extended-D, 224, 160, Latin (155 characters), Common (5 characters)
|
||||
//0xA800, 0xA82F, //Syloti Nagri, 48, 44, Syloti Nagri
|
||||
//0xA830, 0xA83F, //Common Indic Number Forms, 16, 10, Common
|
||||
//0xA840, 0xA87F, //Phags-pa, 64, 56, Phags Pa
|
||||
//0xA880, 0xA8DF, //Saurashtra, 96, 82, Saurashtra
|
||||
//0xA8E0, 0xA8FF, //Devanagari Extended, 32, 30, Devanagari
|
||||
//0xA900, 0xA92F, //Kayah Li, 48, 48, Kayah Li (47 characters), Common (1 character)
|
||||
//0xA930, 0xA95F, //Rejang, 48, 37, Rejang
|
||||
//0xA960, 0xA97F, //Hangul Jamo Extended-A, 32, 29, Hangul
|
||||
//0xA980, 0xA9DF, //Javanese, 96, 91, Javanese (90 characters), Common (1 character)
|
||||
//0xA9E0, 0xA9FF, //Myanmar Extended-B, 32, 31, Myanmar
|
||||
//0xAA00, 0xAA5F, //Cham, 96, 83, Cham
|
||||
//0xAA60, 0xAA7F, //Myanmar Extended-A, 32, 32, Myanmar
|
||||
//0xAA80, 0xAADF, //Tai Viet, 96, 72, Tai Viet
|
||||
//0xAAE0, 0xAAFF, //Meetei Mayek Extensions, 32, 23, Meetei Mayek
|
||||
//0xAB00, 0xAB2F, //Ethiopic Extended-A, 48, 32, Ethiopic
|
||||
//0xAB30, 0xAB6F, //Latin Extended-E, 64, 54, Latin (52 characters), Greek (1 character), Common (1 character)
|
||||
//0xAB70, 0xABBF, //Cherokee Supplement, 80, 80, Cherokee
|
||||
//0xABC0, 0xABFF, //Meetei Mayek, 64, 56, Meetei Mayek
|
||||
//0xAC00, 0xD7AF, //Hangul Syllables, 11,184, 11,172, Hangul
|
||||
//0xD7B0, 0xD7FF, //Hangul Jamo Extended-B, 80, 72, Hangul
|
||||
//0xD800, 0xDB7F, //High Surrogates, 896, 0, Unknown
|
||||
//0xDB80, 0xDBFF, //High Private Use Surrogates, 128, 0, Unknown
|
||||
//0xDC00, 0xDFFF, //Low Surrogates, 1,024, 0, Unknown
|
||||
//0xE000, 0xF8FF, //Private Use Area, 6,400, 6,400, Unknown
|
||||
//0xF900, 0xFAFF, //CJK Compatibility Ideographs, 512, 472, Han
|
||||
//0xFB00, 0xFB4F, //Alphabetic Presentation Forms, 80, 58, Armenian (5 characters), Hebrew (46 characters), Latin (7 characters)
|
||||
//0xFB50, 0xFDFF, //Arabic Presentation Forms-A, 688, 611, Arabic (609 characters), Common (2 characters)
|
||||
//0xFE00, 0xFE0F, //Variation Selectors, 16, 16, Inherited
|
||||
//0xFE10, 0xFE1F, //Vertical Forms, 16, 10, Common
|
||||
//0xFE20, 0xFE2F, //Combining Half Marks, 16, 16, Cyrillic (2 characters), Inherited (14 characters)
|
||||
//0xFE30, 0xFE4F, //CJK Compatibility Forms, 32, 32, Common
|
||||
//0xFE50, 0xFE6F, //Small Form Variants, 32, 26, Common
|
||||
//0xFE70, 0xFEFF, //Arabic Presentation Forms-B, 144, 141, Arabic (140 characters), Common (1 character)
|
||||
//0xFF00, 0xFFEF, //Halfwidth and Fullwidth Forms, 240, 225, Hangul (52 characters), Katakana (55 characters), Latin (52 characters), Common (66 characters)
|
||||
//0xFFF0, 0xFFFF, //Specials, 16, 5, Common
|
||||
|
||||
//0x0030, 0x0039, //Example custom range (numbers 0-9)
|
||||
//0x0041, 0x005A, //Example custom range (Upper case A-Z)
|
||||
//0x0061, 0x007A, //Example custom range (Lower case a-z)
|
||||
};
|
||||
|
||||
// Here we specify particular individual Unicodes to be included (appended at end of selected range)
|
||||
static final int[] specificUnicodes = {
|
||||
|
||||
// Commonly used codes, add or remove // in next line
|
||||
// 0x00A3, 0x00B0, 0x00B5, 0x03A9, 0x20AC, // £ ° µ Ω €
|
||||
|
||||
// Numbers and characters for showing time, change next line to //* to use
|
||||
/*
|
||||
0x002B, 0x002D, 0x002E, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, // - + . 0 1 2 3 4
|
||||
0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x0061, 0x006D, // 5 6 7 8 9 : a m
|
||||
0x0070, // p
|
||||
//*/
|
||||
|
||||
// More characters for TFT_eSPI test sketches, change next line to //* to use
|
||||
/*
|
||||
0x0102, 0x0103, 0x0104, 0x0105, 0x0106, 0x0107, 0x010C, 0x010D,
|
||||
0x010E, 0x010F, 0x0110, 0x0111, 0x0118, 0x0119, 0x011A, 0x011B,
|
||||
|
||||
0x0131, 0x0139, 0x013A, 0x013D, 0x013E, 0x0141, 0x0142, 0x0143,
|
||||
0x0144, 0x0147, 0x0148, 0x0150, 0x0151, 0x0152, 0x0153, 0x0154,
|
||||
0x0155, 0x0158, 0x0159, 0x015A, 0x015B, 0x015E, 0x015F, 0x0160,
|
||||
0x0161, 0x0162, 0x0163, 0x0164, 0x0165, 0x016E, 0x016F, 0x0170,
|
||||
0x0171, 0x0178, 0x0179, 0x017A, 0x017B, 0x017C, 0x017D, 0x017E,
|
||||
0x0192,
|
||||
|
||||
0x02C6, 0x02C7, 0x02D8, 0x02D9, 0x02DA, 0x02DB, 0x02DC, 0x02DD,
|
||||
0x03A9, 0x03C0, 0x2013, 0x2014, 0x2018, 0x2019, 0x201A, 0x201C,
|
||||
0x201D, 0x201E, 0x2020, 0x2021, 0x2022, 0x2026, 0x2030, 0x2039,
|
||||
0x203A, 0x2044, 0x20AC,
|
||||
|
||||
0x2122, 0x2202, 0x2206, 0x220F,
|
||||
|
||||
0x2211, 0x221A, 0x221E, 0x222B, 0x2248, 0x2260, 0x2264, 0x2265,
|
||||
0x25CA,
|
||||
|
||||
0xF8FF, 0xFB01, 0xFB02,
|
||||
//*/
|
||||
};
|
||||
|
||||
// >>>>>>>>>> USER CONFIGURED PARAMETERS END HERE <<<<<<<<<<
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Variable to hold the inclusive Unicode range (16-bit values only for this sketch)
|
||||
int firstUnicode = 0;
|
||||
int lastUnicode = 0;
|
||||
|
||||
PFont myFont;
|
||||
|
||||
PrintWriter logOutput;
|
||||
|
||||
void setup() {
|
||||
logOutput = createWriter("FontFiles/System_Font_List.txt");
|
||||
|
||||
size(1000, 800);
|
||||
|
||||
// Print the available fonts to the console as a list:
|
||||
String[] fontList = PFont.list();
|
||||
printArray(fontList);
|
||||
|
||||
// Save font list to file
|
||||
for (int x = 0; x < fontList.length; x++)
|
||||
{
|
||||
logOutput.print("[" + x + "] ");
|
||||
logOutput.println(fontList[x]);
|
||||
}
|
||||
logOutput.flush(); // Writes the remaining data to the file
|
||||
logOutput.close(); // Finishes the file
|
||||
|
||||
// Set the fontName from the array number or the defined fontName
|
||||
if (fontNumber >= 0)
|
||||
{
|
||||
// fontName = fontList[fontNumber];
|
||||
fontType = "";
|
||||
}
|
||||
|
||||
char[] charset;
|
||||
int index = 0, count = 0;
|
||||
|
||||
int blockCount = unicodeBlocks.length;
|
||||
|
||||
for (int i = 0; i < blockCount; i+=2) {
|
||||
firstUnicode = unicodeBlocks[i];
|
||||
lastUnicode = unicodeBlocks[i+1];
|
||||
if (lastUnicode < firstUnicode) {
|
||||
delay(100);
|
||||
System.err.println("ERROR: Bad Unicode range secified, last < first!");
|
||||
System.err.print("first in range = 0x" + hex(firstUnicode, 4));
|
||||
System.err.println(", last in range = 0x" + hex(lastUnicode, 4));
|
||||
while (true);
|
||||
}
|
||||
// calculate the number of characters
|
||||
count += (lastUnicode - firstUnicode + 1);
|
||||
}
|
||||
|
||||
count += specificUnicodes.length;
|
||||
|
||||
println();
|
||||
println("=====================");
|
||||
println("Creating font file...");
|
||||
println("Unicode blocks included = " + (blockCount/2));
|
||||
println("Specific unicodes included = " + specificUnicodes.length);
|
||||
println("Total number of characters = " + count);
|
||||
|
||||
if (count == 0) {
|
||||
delay(100);
|
||||
System.err.println("ERROR: No Unicode range or specific codes have been defined!");
|
||||
while (true);
|
||||
}
|
||||
|
||||
// allocate memory
|
||||
charset = new char[count];
|
||||
|
||||
for (int i = 0; i < blockCount; i+=2) {
|
||||
firstUnicode = unicodeBlocks[i];
|
||||
lastUnicode = unicodeBlocks[i+1];
|
||||
|
||||
// loading the range specified
|
||||
for (int code = firstUnicode; code <= lastUnicode; code++) {
|
||||
charset[index] = Character.toChars(code)[0];
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
// loading the specific point codes
|
||||
for (int i = 0; i < specificUnicodes.length; i++) {
|
||||
charset[index] = Character.toChars(specificUnicodes[i])[0];
|
||||
index++;
|
||||
}
|
||||
|
||||
// Make font smooth (anti-aliased)
|
||||
boolean smooth = true;
|
||||
|
||||
// Create the font in memory
|
||||
myFont = createFont(fontName+fontType, displayFontSize, smooth, charset);
|
||||
|
||||
// Print characters to the sketch window
|
||||
fill(0, 0, 0);
|
||||
textFont(myFont);
|
||||
|
||||
// Set the left and top margin
|
||||
int margin = displayFontSize;
|
||||
translate(margin/2, margin);
|
||||
|
||||
int gapx = displayFontSize*10/8;
|
||||
int gapy = displayFontSize*10/8;
|
||||
index = 0;
|
||||
fill(0);
|
||||
|
||||
textSize(displayFontSize);
|
||||
|
||||
for (int y = 0; y < height-gapy; y += gapy) {
|
||||
int x = 0;
|
||||
while (x < width) {
|
||||
|
||||
int unicode = charset[index];
|
||||
float cwidth = textWidth((char)unicode) + 2;
|
||||
if ( (x + cwidth) > (width - gapx) ) break;
|
||||
|
||||
// Draw the glyph to the screen
|
||||
text(new String(Character.toChars(unicode)), x, y);
|
||||
|
||||
// Move cursor
|
||||
x += cwidth;
|
||||
// Increment the counter
|
||||
index++;
|
||||
if (index >= count) break;
|
||||
}
|
||||
if (index >= count) break;
|
||||
}
|
||||
|
||||
|
||||
// creating font to save as a file
|
||||
PFont font;
|
||||
|
||||
font = createFont(fontName+fontType, fontSize, smooth, charset);
|
||||
|
||||
println("Created font " + fontName + str(fontSize) + ".vlw");
|
||||
|
||||
String fontFileName = "FontFiles/" + fontName + str(fontSize) + ".vlw";
|
||||
|
||||
// creating file
|
||||
try {
|
||||
print("Saving to sketch FontFiles folder... ");
|
||||
|
||||
OutputStream output = createOutput(fontFileName);
|
||||
font.save(output);
|
||||
output.close();
|
||||
|
||||
println("OK!");
|
||||
|
||||
delay(100);
|
||||
|
||||
// Open up the FontFiles folder to access the saved file
|
||||
String path = sketchPath();
|
||||
if(openFolder){
|
||||
Desktop.getDesktop().open(new File(path+"/FontFiles"));
|
||||
}
|
||||
|
||||
System.err.println("All done! Note: Rectangles are displayed for non-existant characters.");
|
||||
}
|
||||
catch(IOException e) {
|
||||
println("Doh! Failed to create the file");
|
||||
}
|
||||
|
||||
if(!createHeaderFile) return;
|
||||
// Now creating header file if the option was specified.
|
||||
try{
|
||||
print("saving header file to FontFile folder...");
|
||||
|
||||
InputStream input = createInputRaw(fontFileName);
|
||||
PrintWriter output = createWriter("FontFiles/" + fontName + str(fontSize) + ".h");
|
||||
|
||||
output.println("#include <pgmspace.h>");
|
||||
output.println();
|
||||
output.println("const uint8_t " + fontName + str(fontSize) + "[] PROGMEM = {");
|
||||
|
||||
int i = 0;
|
||||
int data = input.read();
|
||||
while(data != -1){
|
||||
output.print("0x");
|
||||
output.print(hex(data, 2));
|
||||
if(i++ < 15){
|
||||
output.print(", ");
|
||||
} else {
|
||||
output.println(",");
|
||||
i = 0;
|
||||
}
|
||||
data = input.read();
|
||||
}
|
||||
// font.save(output);
|
||||
output.println("\n};");
|
||||
|
||||
output.close();
|
||||
input.close();
|
||||
|
||||
println("C header file created.");
|
||||
|
||||
} catch(IOException e){
|
||||
println("Failed to create C header file");
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -1,525 +0,0 @@
|
||||
// This is a Processing sketch, see https://processing.org/ to download the IDE
|
||||
|
||||
// The sketch is a client that requests TFT screenshots from an Arduino board.
|
||||
// The Arduino must call a screenshot server function to respond with pixels.
|
||||
|
||||
// It has been created to work with the TFT_eSPI library here:
|
||||
// https://github.com/Bodmer/TFT_eSPI
|
||||
|
||||
// The sketch must only be run when the designated serial port is available and enumerated
|
||||
// otherwise the screenshot window may freeze and that process will need to be terminated
|
||||
// This is a limitation of the Processing environment and not the sketch.
|
||||
// If anyone knows how to determine if a serial port is available at start up the PM me
|
||||
// on (Bodmer) the Arduino forum.
|
||||
|
||||
// The block below contains variables that the user may need to change for a particular setup
|
||||
// As a minimum set the serial port and baud rate must be defined. The capture window is
|
||||
// automatically resized for landscape, portrait and different TFT resolutions.
|
||||
|
||||
// Captured images are stored in the sketch folder, use the Processing IDE "Sketch" menu
|
||||
// option "Show Sketch Folder" or press Ctrl+K
|
||||
|
||||
// Created by: Bodmer 5/3/17
|
||||
// Updated by: Bodmer 12/3/17
|
||||
// Version: 0.07
|
||||
|
||||
// MIT licence applies, all text above must be included in derivative works
|
||||
|
||||
|
||||
// ###########################################################################################
|
||||
// # These are the values to change for a particular setup #
|
||||
// #
|
||||
int serial_port = 0; // Use enumerated value from list provided when sketch is run #
|
||||
// #
|
||||
// On an Arduino Due Programming Port use a baud rate of:115200) #
|
||||
// On an Arduino Due Native USB Port use a baud rate of any value #
|
||||
int serial_baud_rate = 921600; // #
|
||||
// #
|
||||
// Change the image file type saved here, comment out all but one #
|
||||
//String image_type = ".jpg"; // #
|
||||
String image_type = ".png"; // Lossless compression #
|
||||
//String image_type = ".bmp"; // #
|
||||
//String image_type = ".tif"; // #
|
||||
// #
|
||||
boolean save_border = true; // Save the image with a border #
|
||||
int border = 5; // Border pixel width #
|
||||
boolean fade = false; // Fade out image after saving #
|
||||
// #
|
||||
int max_images = 100; // Maximum of numbered file images before over-writing files #
|
||||
// #
|
||||
int max_allowed = 1000; // Maximum number of save images allowed before a restart #
|
||||
// #
|
||||
// # End of the values to change for a particular setup #
|
||||
// ###########################################################################################
|
||||
|
||||
// These are default values, this sketch obtains the actual values from the Arduino board
|
||||
int tft_width = 480; // default TFT width (automatic - sent by Arduino)
|
||||
int tft_height = 480; // default TFT height (automatic - sent by Arduino)
|
||||
int color_bytes = 2; // 2 for 16-bit, 3 for three RGB bytes (automatic - sent by Arduino)
|
||||
|
||||
import processing.serial.*;
|
||||
|
||||
Serial serial; // Create an instance called serial
|
||||
|
||||
int serialCount = 0; // Count of colour bytes arriving
|
||||
|
||||
// Stage window graded background colours
|
||||
color bgcolor1 = color(0, 100, 104); // Arduino IDE style background color 1
|
||||
color bgcolor2 = color(77, 183, 187); // Arduino IDE style background color 2
|
||||
//color bgcolor2 = color(255, 255, 255); // White
|
||||
|
||||
// TFT image frame greyscale value (dark grey)
|
||||
color frameColor = 42;
|
||||
|
||||
color buttonStopped = color(255, 0, 0);
|
||||
color buttonRunning = color(128, 204, 206);
|
||||
color buttonDimmed = color(180, 0, 0);
|
||||
boolean dimmed = false;
|
||||
boolean running = true;
|
||||
boolean mouseClick = false;
|
||||
|
||||
int[] rgb = new int[3]; // Buffer for the colour bytes
|
||||
int indexRed = 0; // Colour byte index in the array
|
||||
int indexGreen = 1;
|
||||
int indexBlue = 2;
|
||||
|
||||
int n = 0;
|
||||
|
||||
int x_offset = (500 - tft_width) /2; // Image offsets in the window
|
||||
int y_offset = 20;
|
||||
|
||||
int xpos = 0, ypos = 0; // Current pixel position
|
||||
|
||||
int beginTime = 0;
|
||||
int pixelWaitTime = 1000; // Maximum 1000ms wait for image pixels to arrive
|
||||
int lastPixelTime = 0; // Time that "image send" command was sent
|
||||
|
||||
int requestTime = 0;
|
||||
int requestCount = 0;
|
||||
|
||||
int state = 0; // State machine current state
|
||||
|
||||
int progress_bar = 0; // Console progress bar dot count
|
||||
int pixel_count = 0; // Number of pixels read for 1 screen
|
||||
float percentage = 0; // Percentage of pixels received
|
||||
|
||||
int saved_image_count = 0; // Stats - number of images processed
|
||||
int bad_image_count = 0; // Stats - number of images that had lost pixels
|
||||
String filename = "";
|
||||
|
||||
int drawLoopCount = 0; // Used for the fade out
|
||||
|
||||
void setup() {
|
||||
|
||||
size(500, 540); // Stage size, can handle 480 pixels wide screen
|
||||
noStroke(); // No border on the next thing drawn
|
||||
noSmooth(); // No anti-aliasing to avoid adjacent pixel colour merging
|
||||
|
||||
// Graded background and title
|
||||
drawWindow();
|
||||
|
||||
frameRate(2000); // High frame rate so draw() loops fast
|
||||
|
||||
// Print a list of the available serial ports
|
||||
println("-----------------------");
|
||||
println("Available Serial Ports:");
|
||||
println("-----------------------");
|
||||
printArray(Serial.list());
|
||||
println("-----------------------");
|
||||
|
||||
print("Port currently used: [");
|
||||
print(serial_port);
|
||||
println("]");
|
||||
|
||||
String portName = Serial.list()[serial_port];
|
||||
|
||||
serial = new Serial(this, portName, serial_baud_rate);
|
||||
|
||||
state = 99;
|
||||
}
|
||||
|
||||
void draw() {
|
||||
|
||||
if (mouseClick) buttonClicked();
|
||||
|
||||
switch(state) {
|
||||
|
||||
case 0: // Init varaibles, send start request
|
||||
if (running) {
|
||||
tint(0, 0, 0, 255);
|
||||
flushBuffer();
|
||||
println("");
|
||||
print("Ready: ");
|
||||
|
||||
xpos = 0;
|
||||
ypos = 0;
|
||||
serialCount = 0;
|
||||
progress_bar = 0;
|
||||
pixel_count = 0;
|
||||
percentage = 0;
|
||||
drawLoopCount = frameCount;
|
||||
lastPixelTime = millis() + 1000;
|
||||
|
||||
state = 1;
|
||||
} else {
|
||||
if (millis() > beginTime) {
|
||||
beginTime = millis() + 500;
|
||||
dimmed = !dimmed;
|
||||
if (dimmed) drawButton(buttonDimmed);
|
||||
else drawButton(buttonStopped);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 1: // Console message, give server some time
|
||||
print("requesting image ");
|
||||
serial.write("S");
|
||||
delay(10);
|
||||
beginTime = millis();
|
||||
requestTime = millis() + 1000;
|
||||
requestCount = 1;
|
||||
state = 2;
|
||||
break;
|
||||
|
||||
case 2: // Get size and set start time for rendering duration report
|
||||
if (millis() > requestTime) {
|
||||
requestCount++;
|
||||
print("*");
|
||||
serial.clear();
|
||||
serial.write("S");
|
||||
if (requestCount > 32) {
|
||||
requestCount = 0;
|
||||
System.err.println(" - no response!");
|
||||
state = 0;
|
||||
}
|
||||
requestTime = millis() + 1000;
|
||||
}
|
||||
if ( getSize() == true ) { // Go to next state when we have the size and bits per pixel
|
||||
getFilename();
|
||||
flushBuffer(); // Precaution in case image header size increases in later versions
|
||||
lastPixelTime = millis() + 1000;
|
||||
beginTime = millis();
|
||||
state = 3;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3: // Request pixels and render returned RGB values
|
||||
state = renderPixels(); // State will change when all pixels are rendered
|
||||
|
||||
// Request more pixels, changing the number requested allows the average transfer rate to be controlled
|
||||
// The pixel transfer rate is dependant on four things:
|
||||
// 1. The frame rate defined in this Processing sketch in setup()
|
||||
// 2. The baud rate of the serial link (~10 bit periods per byte)
|
||||
// 3. The number of request bytes 'R' sent in the lines below
|
||||
// 4. The number of pixels sent in a burst by the server sketch (defined via NPIXELS)
|
||||
|
||||
//serial.write("RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"); // 32 x NPIXELS more
|
||||
serial.write("RRRRRRRRRRRRRRRR"); // 16 x NPIXELS more
|
||||
//serial.write("RRRRRRRR"); // 8 x NPIXELS more
|
||||
//serial.write("RRRR"); // 4 x NPIXELS more
|
||||
//serial.write("RR"); // 2 x NPIXELS more
|
||||
//serial.write("R"); // 1 x NPIXELS more
|
||||
if (!running) state = 4;
|
||||
break;
|
||||
|
||||
case 4: // Pixel receive time-out, flush serial buffer
|
||||
flushBuffer();
|
||||
state = 6;
|
||||
break;
|
||||
|
||||
case 5: // Save the image to the sketch folder (Ctrl+K to access)
|
||||
saveScreenshot();
|
||||
saved_image_count++;
|
||||
println("Saved image count = " + saved_image_count);
|
||||
if (bad_image_count > 0) System.err.println(" Bad image count = " + bad_image_count);
|
||||
drawLoopCount = frameCount; // Reset value ready for counting in step 6
|
||||
state = 6;
|
||||
break;
|
||||
|
||||
case 6: // Fade the old image if enabled
|
||||
if ( fadedImage() == true ) state = 0; // Go to next state when image has faded
|
||||
break;
|
||||
|
||||
case 99: // Draw image viewer window
|
||||
drawWindow();
|
||||
delay(50); // Delay here seems to be required for the IDE console to get ready
|
||||
state = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
println("");
|
||||
System.err.println("Error state reached - check sketch!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void drawWindow()
|
||||
{
|
||||
// Graded background in Arduino colours
|
||||
for (int i = 0; i < height - 25; i++) {
|
||||
float inter = map(i, 0, height - 25, 0, 1);
|
||||
color c = lerpColor(bgcolor1, bgcolor2, inter);
|
||||
stroke(c);
|
||||
line(0, i, 500, i);
|
||||
}
|
||||
fill(bgcolor2);
|
||||
rect( 0, height-25, width-1, 24);
|
||||
textAlign(CENTER);
|
||||
textSize(20);
|
||||
fill(0);
|
||||
text("Bodmer's TFT image viewer", width/2, height-6);
|
||||
|
||||
if (running) drawButton(buttonRunning);
|
||||
else drawButton(buttonStopped);
|
||||
}
|
||||
|
||||
void flushBuffer()
|
||||
{
|
||||
//println("Clearing serial pipe after a time-out");
|
||||
int clearTime = millis() + 50;
|
||||
while ( millis() < clearTime ) serial.clear();
|
||||
}
|
||||
|
||||
boolean getSize()
|
||||
{
|
||||
if ( serial.available() > 6 ) {
|
||||
println();
|
||||
char code = (char)serial.read();
|
||||
if (code == 'W') {
|
||||
tft_width = serial.read()<<8 | serial.read();
|
||||
}
|
||||
code = (char)serial.read();
|
||||
if (code == 'H') {
|
||||
tft_height = serial.read()<<8 | serial.read();
|
||||
}
|
||||
code = (char)serial.read();
|
||||
if (code == 'Y') {
|
||||
int bits_per_pixel = (char)serial.read();
|
||||
if (bits_per_pixel == 24) color_bytes = 3;
|
||||
else color_bytes = 2;
|
||||
}
|
||||
code = (char)serial.read();
|
||||
if (code == '?') {
|
||||
drawWindow();
|
||||
|
||||
x_offset = (500 - tft_width) /2;
|
||||
tint(0, 0, 0, 255);
|
||||
noStroke();
|
||||
fill(frameColor);
|
||||
rect((width - tft_width)/2 - border, y_offset - border, tft_width + 2 * border, tft_height + 2 * border);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void saveScreenshot()
|
||||
{
|
||||
println();
|
||||
if (saved_image_count < max_allowed)
|
||||
{
|
||||
if (filename == "") filename = "tft_screen_" + (n++);
|
||||
filename = filename + image_type;
|
||||
println("Saving image as \"" + filename + "\"");
|
||||
if (save_border)
|
||||
{
|
||||
PImage partialSave = get(x_offset - border, y_offset - border, tft_width + 2*border, tft_height + 2*border);
|
||||
partialSave.save(filename);
|
||||
} else {
|
||||
PImage partialSave = get(x_offset, y_offset, tft_width, tft_height);
|
||||
partialSave.save(filename);
|
||||
}
|
||||
|
||||
if (n>=max_images) n = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
System.err.println(max_allowed + " saved image count exceeded, restart the sketch");
|
||||
}
|
||||
}
|
||||
|
||||
void getFilename()
|
||||
{
|
||||
int readTime = millis() + 20;
|
||||
int inByte = 0;
|
||||
filename = "";
|
||||
while ( serial.available() > 0 && millis() < readTime && inByte != '.')
|
||||
{
|
||||
inByte = serial.read();
|
||||
if (inByte == ' ') inByte = '_';
|
||||
if ( unicodeCheck(inByte) ) filename += (char)inByte;
|
||||
}
|
||||
|
||||
inByte = serial.read();
|
||||
if (inByte == '@') filename += "_" + timeCode();
|
||||
else if (inByte == '#') filename += "_" + saved_image_count%100;
|
||||
else if (inByte == '%') filename += "_" + millis();
|
||||
else if (inByte != '*') filename = "";
|
||||
|
||||
inByte = serial.read();
|
||||
if (inByte == 'j') image_type =".jpg";
|
||||
else if (inByte == 'b') image_type =".bmp";
|
||||
else if (inByte == 'p') image_type =".png";
|
||||
else if (inByte == 't') image_type =".tif";
|
||||
}
|
||||
|
||||
boolean unicodeCheck(int unicode)
|
||||
{
|
||||
if ( unicode >= '0' && unicode <= '9' ) return true;
|
||||
if ( (unicode >= 'A' && unicode <= 'Z' ) || (unicode >= 'a' && unicode <= 'z')) return true;
|
||||
if ( unicode == '_' || unicode == '/' ) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
String timeCode()
|
||||
{
|
||||
String timeCode = (int)year() + "_" + (int)month() + "_" + (int)day() + "_";
|
||||
timeCode += (int)hour() + "_" + (int)minute() + "_" + (int)second();
|
||||
return timeCode;
|
||||
}
|
||||
|
||||
int renderPixels()
|
||||
{
|
||||
if ( serial.available() > 0 ) {
|
||||
|
||||
// Add the latest byte from the serial port to array:
|
||||
while (serial.available()>0)
|
||||
{
|
||||
rgb[serialCount++] = serial.read();
|
||||
|
||||
// If we have 3 colour bytes:
|
||||
if ( serialCount >= color_bytes ) {
|
||||
serialCount = 0;
|
||||
pixel_count++;
|
||||
if (color_bytes == 3)
|
||||
{
|
||||
stroke(rgb[indexRed], rgb[indexGreen], rgb[indexBlue], 1000);
|
||||
} else
|
||||
{ // Can cater for various byte orders
|
||||
//stroke( (rgb[0] & 0x1F)<<3, (rgb[0] & 0xE0)>>3 | (rgb[1] & 0x07)<<5, (rgb[1] & 0xF8));
|
||||
//stroke( (rgb[1] & 0x1F)<<3, (rgb[1] & 0xE0)>>3 | (rgb[0] & 0x07)<<5, (rgb[0] & 0xF8));
|
||||
stroke( (rgb[0] & 0xF8), (rgb[1] & 0xE0)>>3 | (rgb[0] & 0x07)<<5, (rgb[1] & 0x1F)<<3);
|
||||
//stroke( (rgb[1] & 0xF8), (rgb[0] & 0xE0)>>3 | (rgb[1] & 0x07)<<5, (rgb[0] & 0x1F)<<3);
|
||||
}
|
||||
// We get some pixel merge aliasing if smooth() is defined, so draw pixel twice
|
||||
point(xpos + x_offset, ypos + y_offset);
|
||||
//point(xpos + x_offset, ypos + y_offset);
|
||||
|
||||
lastPixelTime = millis();
|
||||
xpos++;
|
||||
if (xpos >= tft_width) {
|
||||
xpos = 0;
|
||||
progressBar();
|
||||
ypos++;
|
||||
if (ypos>=tft_height) {
|
||||
ypos = 0;
|
||||
if ((int)percentage <100) {
|
||||
while (progress_bar++ < 64) print(" ");
|
||||
percent(100);
|
||||
}
|
||||
println("Image fetch time = " + (millis()-beginTime)/1000.0 + " s");
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
if (millis() > (lastPixelTime + pixelWaitTime))
|
||||
{
|
||||
println("");
|
||||
System.err.println(pixelWaitTime + "ms time-out for pixels exceeded...");
|
||||
if (pixel_count > 0) {
|
||||
bad_image_count++;
|
||||
System.err.print("Pixels missing = " + (tft_width * tft_height - pixel_count));
|
||||
System.err.println(", corrupted image not saved");
|
||||
System.err.println("Good image count = " + saved_image_count);
|
||||
System.err.println(" Bad image count = " + bad_image_count);
|
||||
}
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
return 3;
|
||||
}
|
||||
|
||||
void progressBar()
|
||||
{
|
||||
progress_bar++;
|
||||
print(".");
|
||||
if (progress_bar >63)
|
||||
{
|
||||
progress_bar = 0;
|
||||
percentage = 0.5 + 100 * pixel_count/(0.001 + tft_width * tft_height);
|
||||
percent(percentage);
|
||||
}
|
||||
}
|
||||
|
||||
void percent(float percentage)
|
||||
{
|
||||
if (percentage > 100) percentage = 100;
|
||||
println(" [ " + (int)percentage + "% ]");
|
||||
textAlign(LEFT);
|
||||
textSize(16);
|
||||
noStroke();
|
||||
fill(bgcolor2);
|
||||
rect(10, height - 25, 70, 20);
|
||||
fill(0);
|
||||
text(" [ " + (int)percentage + "% ]", 10, height-8);
|
||||
}
|
||||
|
||||
boolean fadedImage()
|
||||
{
|
||||
int opacity = frameCount - drawLoopCount; // So we get increasing fade
|
||||
if (fade)
|
||||
{
|
||||
tint(255, opacity);
|
||||
//image(tft_img, x_offset, y_offset);
|
||||
noStroke();
|
||||
fill(50, 50, 50, opacity);
|
||||
rect( (width - tft_width)/2, y_offset, tft_width, tft_height);
|
||||
delay(10);
|
||||
}
|
||||
if (opacity > 50) // End fade after 50 cycles
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void drawButton(color buttonColor)
|
||||
{
|
||||
stroke(0);
|
||||
fill(buttonColor);
|
||||
rect(500 - 100, 540 - 26, 80, 24);
|
||||
textAlign(CENTER);
|
||||
textSize(20);
|
||||
fill(0);
|
||||
if (running) text(" Pause ", 500 - 60, height-7);
|
||||
else text(" Run ", 500 - 60, height-7);
|
||||
}
|
||||
|
||||
void buttonClicked()
|
||||
{
|
||||
mouseClick = false;
|
||||
if (running) {
|
||||
running = false;
|
||||
drawButton(buttonStopped);
|
||||
System.err.println("");
|
||||
System.err.println("Stopped - click 'Run' button: ");
|
||||
//noStroke();
|
||||
//fill(50);
|
||||
//rect( (width - tft_width)/2, y_offset, tft_width, tft_height);
|
||||
beginTime = millis() + 500;
|
||||
dimmed = false;
|
||||
state = 4;
|
||||
} else {
|
||||
running = true;
|
||||
drawButton(buttonRunning);
|
||||
}
|
||||
}
|
||||
|
||||
void mousePressed() {
|
||||
if (mouseX > (500 - 100) && mouseX < (500 - 20) && mouseY > (540 - 26) && mouseY < (540 - 2)) {
|
||||
mouseClick = true;
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
## bmp2array4bit
|
||||
|
||||
bmp2array4bit.py reads a bmp file, and creates C (or C++) code that contains two arrays for adding images to four-bit sprites. See [Sprite_image_4bit](../../examples/Sprite/Sprite_image_4bit) for an example.
|
||||
|
||||
It is loosely based on Spark Fun's bmp2array script, https://github.com/sparkfun/BMPtoArray/blob/master/bmp2array.py. The bmp file format is documented in https://en.wikipedia.org/wiki/BMP_file_format.
|
||||
|
||||
You'll need python 3.6 (the original uses Python 2.7)
|
||||
|
||||
`usage: python bmp2array4bit.py [-v] star.bmp [-o myfile.c]`
|
||||
|
||||
Create the bmp file in Gimp (www.gimp.org) from any image as follows:
|
||||
|
||||
* Remove the alpha channel (if it has one)
|
||||
Layer -> Transparency -> Remove Alpha Channel
|
||||
* Set the mode to indexed.
|
||||
Image -> Mode -> Indexed...
|
||||
* Select Generate optimum palette with 16 colors (max)
|
||||
* Export the file with a .bmp extension. Do **NOT** select options:
|
||||
* Run-Length Encoded
|
||||
* Compatibility Options: "Do not write color space information"
|
||||
* There are no Advanced Options available with these settings
|
||||
|
||||
(There are other tools that will produce bmp files, and these should work provided you don't use run-length encoding or other advanced features).
|
||||
|
||||
The first array produced is the palette for the image.
|
||||
The second is the image itself.
|
||||
@@ -1,251 +0,0 @@
|
||||
'''
|
||||
|
||||
This script takes in a bitmap and outputs a text file that is a
|
||||
byte array used in Arduino files.
|
||||
|
||||
It is loosely based on Spark Fun's bmp2array script.
|
||||
|
||||
You'll need python 3.6 (the original use Python 2.7)
|
||||
|
||||
usage: python fourbitbmp2array.py [-v] star.bmp [-o myfile.c]
|
||||
|
||||
Create the bmp file in Gimp by :
|
||||
|
||||
. Remove the alpha channel (if it has one) Layer -> Transparency -> Remove Alpha Channel
|
||||
. Set the mode to indexed. Image -> Mode -> Indexed...
|
||||
. Select Generate optimum palette with 16 colors (max)
|
||||
. Export the file with a .bmp extension. Options are:
|
||||
. Run-Length Encoded: not selected
|
||||
. Compatibility Options: "Do not write color space information" not selected
|
||||
. There are no Advanced Options available with these settings
|
||||
|
||||
|
||||
|
||||
|
||||
'''
|
||||
|
||||
import sys
|
||||
import struct
|
||||
import math
|
||||
import argparse
|
||||
import os
|
||||
|
||||
debug = None
|
||||
|
||||
def debugOut(s):
|
||||
if debug:
|
||||
print(s)
|
||||
|
||||
# look at arguments
|
||||
parser = argparse.ArgumentParser(description="Convert bmp file to C array")
|
||||
parser.add_argument("-v", "--verbose", help="debug output", action="store_true")
|
||||
parser.add_argument("input", help="input file name")
|
||||
parser.add_argument("-o", "--output", help="output file name")
|
||||
args = parser.parse_args()
|
||||
|
||||
if not os.path.exists(args.input):
|
||||
parser.print_help()
|
||||
print("The input file {} does not exist".format(args.input))
|
||||
sys.exit(1)
|
||||
|
||||
if args.output == None:
|
||||
output = os.path.basename(args.input).replace(".bmp", ".c")
|
||||
else:
|
||||
output = args.output
|
||||
|
||||
debug = args.verbose
|
||||
|
||||
try:
|
||||
#Open our input file which is defined by the first commandline argument
|
||||
#then dump it into a list of bytes
|
||||
infile = open(args.input,"rb") #b is for binary
|
||||
contents = bytearray(infile.read())
|
||||
infile.close()
|
||||
except:
|
||||
print("could not read input file {}".format(args.input))
|
||||
sys.exit(1)
|
||||
|
||||
# first two bytes should be "BM"
|
||||
upto = 2
|
||||
#Get the size of this image
|
||||
data = struct.pack("BBBB", contents[upto], contents[upto+1], contents[upto+2], contents[upto+3])
|
||||
fileSize = struct.unpack("I", bytearray(data))
|
||||
|
||||
upto += 4
|
||||
# four bytes are reserved
|
||||
|
||||
upto += 4
|
||||
|
||||
debugOut("Size of file: {}".format(fileSize[0]))
|
||||
|
||||
#Get the header offset amount
|
||||
data = struct.pack("BBBB", contents[upto], contents[upto+1], contents[upto+2], contents[upto+3])
|
||||
offset = struct.unpack("I", bytearray(data))
|
||||
|
||||
debugOut("Offset: {}".format(offset[0]))
|
||||
upto += 4
|
||||
|
||||
data = struct.pack("BBBB", contents[upto], contents[upto+1], contents[upto+2], contents[upto+3])
|
||||
headersize = struct.unpack("I", bytearray(data))
|
||||
headerLength = headersize[0]
|
||||
startOfDefinitions = headerLength + upto
|
||||
debugOut("header size: {}, up to {}, startOfDefinitions {}".format(headersize[0], upto, startOfDefinitions))
|
||||
upto += 4
|
||||
|
||||
data = struct.pack("BBBB", contents[upto], contents[upto+1], contents[upto+2], contents[upto+3])
|
||||
t = struct.unpack("I", bytearray(data))
|
||||
debugOut("width: {}".format(t[0]))
|
||||
width = t[0]
|
||||
|
||||
upto += 4
|
||||
data = struct.pack("BBBB", contents[upto], contents[upto+1], contents[upto+2], contents[upto+3])
|
||||
t = struct.unpack("I", bytearray(data))
|
||||
debugOut("height: {}".format(t[0]))
|
||||
height = t[0]
|
||||
|
||||
# 26
|
||||
upto += 4
|
||||
|
||||
data = struct.pack("BB", contents[upto], contents[upto+1])
|
||||
t = struct.unpack("H", bytearray(data))
|
||||
debugOut("planes: {}".format(t[0]))
|
||||
|
||||
upto = upto + 2
|
||||
data = struct.pack("BB", contents[upto], contents[upto+1])
|
||||
t = struct.unpack("H", bytearray(data))
|
||||
debugOut("bits per pixel: {}".format(t[0]))
|
||||
bitsPerPixel = t[0]
|
||||
|
||||
upto = upto + 2
|
||||
data = struct.pack("BBBB", contents[upto], contents[upto+1], contents[upto+2], contents[upto+3])
|
||||
t = struct.unpack("I", bytearray(data))
|
||||
debugOut("biCompression: {}".format(t[0]))
|
||||
|
||||
upto = upto + 4
|
||||
data = struct.pack("BBBB", contents[upto], contents[upto+1], contents[upto+2], contents[upto+3])
|
||||
t = struct.unpack("I", bytearray(data))
|
||||
debugOut("biSizeImage: {}".format(t[0]))
|
||||
|
||||
upto = upto + 4
|
||||
data = struct.pack("BBBB", contents[upto], contents[upto+1], contents[upto+2], contents[upto+3])
|
||||
t = struct.unpack("I", bytearray(data))
|
||||
debugOut("biXPelsPerMeter: {}".format(t[0]))
|
||||
|
||||
upto = upto + 4
|
||||
data = struct.pack("BBBB", contents[upto], contents[upto+1], contents[upto+2], contents[upto+3])
|
||||
t = struct.unpack("I", bytearray(data))
|
||||
debugOut("biYPelsPerMeter: {}".format(t[0]))
|
||||
|
||||
upto = upto + 4
|
||||
data = struct.pack("BBBB", contents[upto], contents[upto+1], contents[upto+2], contents[upto+3])
|
||||
t = struct.unpack("I", bytearray(data))
|
||||
debugOut("biClrUsed: {}".format(t[0]))
|
||||
colorsUsed = t
|
||||
|
||||
upto = upto + 4
|
||||
data = struct.pack("BBBB", contents[upto], contents[upto+1], contents[upto+2], contents[upto+3])
|
||||
t = struct.unpack("I", bytearray(data))
|
||||
debugOut("biClrImportant: {}".format(t[0]))
|
||||
|
||||
upto += 4
|
||||
|
||||
debugOut("Upto: {} Number of colors used: {} definitions start at: {}".format(upto, colorsUsed[0], startOfDefinitions))
|
||||
|
||||
#Create color definition array and init the array of color values
|
||||
colorIndex = [] #(colorsUsed[0])
|
||||
for i in range(colorsUsed[0]):
|
||||
colorIndex.append(0)
|
||||
|
||||
#Assign the colors to the array. upto = 54
|
||||
# startOfDefinitions = upto
|
||||
for i in range(colorsUsed[0]):
|
||||
upto = startOfDefinitions + (i * 4)
|
||||
blue = contents[upto]
|
||||
green = contents[upto + 1]
|
||||
red = contents[upto + 2]
|
||||
# ignore the alpha channel.
|
||||
|
||||
# data = struct.pack("BBBB", contents[upto], contents[upto+1], contents[upto+2], contents[upto+3])
|
||||
# t = struct.unpack("I", bytearray(data))
|
||||
# colorIndex[i] = t[0]
|
||||
|
||||
colorIndex[i] = (((red & 0xf8)<<8) + ((green & 0xfc)<<3)+(blue>>3))
|
||||
debugOut("color at index {0} is {1:04x}, (r,g,b,a) = ({2:02x}, {3:02x}, {4:02x}, {5:02x})".format(i, colorIndex[i], red, green, blue, contents[upto+3]))
|
||||
|
||||
#debugOut(the color definitions
|
||||
# for i in range(colorsUsed[0]):
|
||||
# print hex(colorIndex[i])
|
||||
|
||||
# perfect, except upside down.
|
||||
|
||||
#Make a string to hold the output of our script
|
||||
arraySize = (len(contents) - offset[0])
|
||||
outputString = "/* This was generated using a script based on the SparkFun BMPtoArray python script" + '\n'
|
||||
outputString += " See https://github.com/sparkfun/BMPtoArray for more info */" + '\n\n'
|
||||
outputString += "static const uint16_t palette[" + str(colorsUsed[0]) + "] = {";
|
||||
for i in range(colorsUsed[0]):
|
||||
# print hexlify(colorIndex[i])
|
||||
if i % 4 == 0:
|
||||
outputString += "\n\t"
|
||||
outputString += "0x{:04x}, ".format(colorIndex[i])
|
||||
|
||||
outputString = outputString[:-2]
|
||||
outputString += "\n};\n\n"
|
||||
outputString += "// width is " + str(width) + ", height is " + str(height) + "\n"
|
||||
outputString += "static const uint8_t myGraphic[" + str(arraySize) + "] PROGMEM = {" + '\n'
|
||||
|
||||
if bitsPerPixel != 4:
|
||||
print("Expected 4 bits per pixel; found {}".format(bitsPerPixel))
|
||||
sys.exit(1)
|
||||
|
||||
#Start converting spots to values
|
||||
#Start at the offset and go to the end of the file
|
||||
dropLastNumber = True #(width % 4) == 2 or (width % 4) == 1
|
||||
paddedWidth = int(math.ceil(bitsPerPixel * width / 32.0) * 4)
|
||||
debugOut("array range is {} {} len(contents) is {} paddedWidth is {} width is {}".format(offset[0], fileSize[0], len(contents), paddedWidth, width))
|
||||
|
||||
r = 0
|
||||
width = int(width / 2)
|
||||
#for i in range(offset[0], fileSize[0]): # close but image is upside down. Each row is correct but need to swap columns.
|
||||
#for i in range(fileSize[0], offset[0], -1):
|
||||
|
||||
for col in range(height-1, -1, -1):
|
||||
i = 0
|
||||
for row in range(width):
|
||||
colorCode1 = contents[row + col*paddedWidth + offset[0]]
|
||||
|
||||
if r > 0 and r % width == 0:
|
||||
i = 0
|
||||
outputString += '\n\n'
|
||||
elif (i + 1) % 12 == 0 :
|
||||
outputString += '\n'
|
||||
i = 0
|
||||
|
||||
#debugOut("cell ({0}, {1})".format(row, col)
|
||||
|
||||
r = r + 1
|
||||
i = i + 1
|
||||
outputString += "0x{:02x}, ".format(colorCode1)
|
||||
|
||||
|
||||
|
||||
#Once we've reached the end of our input string, pull the last two
|
||||
#characters off (the last comma and space) since we don't need
|
||||
#them. Top it off with a closing bracket and a semicolon.
|
||||
outputString = outputString[:-2]
|
||||
outputString += "};"
|
||||
|
||||
try:
|
||||
#Write the output string to our output file
|
||||
outfile = open(output, "w")
|
||||
outfile.write(outputString)
|
||||
outfile.close()
|
||||
except:
|
||||
print("could not write output to file {}".format(output))
|
||||
sys.exit(1)
|
||||
|
||||
debugOut("{} complete".format(output))
|
||||
debugOut("Copy and paste this array into a image.h or other header file")
|
||||
|
||||
if not debug:
|
||||
print("Completed; the output is in {}".format(output))
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB |
@@ -1,3 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#define ILI9341_DRIVER
|
||||
#define TFT_DMA_SUPPORT
|
||||
#define TFT_CS 5
|
||||
|
||||
@@ -15,271 +15,14 @@
|
||||
// Example User_Setup files are stored in the "User_Setups" folder. These can be used
|
||||
// unmodified or adapted for a particular hardware configuration.
|
||||
|
||||
#ifndef USER_SETUP_LOADED // Lets PlatformIO users define settings in
|
||||
// platformio.ini, see notes in "Tools" folder.
|
||||
|
||||
///////////////////////////////////////////////////////
|
||||
// User configuration selection lines are below //
|
||||
///////////////////////////////////////////////////////
|
||||
|
||||
// Only ONE line below should be uncommented to define your setup. Add extra lines and files as needed.
|
||||
|
||||
#include <User_Setup.h> // Default setup is root library folder
|
||||
|
||||
//#include <User_Setups/Setup1_ILI9341.h> // Setup file for ESP8266 configured for my ILI9341
|
||||
//#include <User_Setups/Setup2_ST7735.h> // Setup file for ESP8266 configured for my ST7735
|
||||
//#include <User_Setups/Setup3_ILI9163.h> // Setup file for ESP8266 configured for my ILI9163
|
||||
//#include <User_Setups/Setup4_S6D02A1.h> // Setup file for ESP8266 configured for my S6D02A1
|
||||
//#include <User_Setups/Setup5_RPi_ILI9486.h> // Setup file for ESP8266 configured for my stock RPi TFT
|
||||
//#include <User_Setups/Setup6_RPi_Wr_ILI9486.h> // Setup file for ESP8266 configured for my modified RPi TFT
|
||||
//#include <User_Setups/Setup7_ST7735_128x128.h> // Setup file for ESP8266 configured for my ST7735 128x128 display
|
||||
//#include <User_Setups/Setup8_ILI9163_128x128.h> // Setup file for ESP8266 configured for my ILI9163 128x128 display
|
||||
//#include <User_Setups/Setup9_ST7735_Overlap.h> // Setup file for ESP8266 configured for my ST7735
|
||||
//#include <User_Setups/Setup10_RPi_touch_ILI9486.h> // Setup file for ESP8266 configured for ESP8266 and RPi TFT with touch
|
||||
|
||||
//#include <User_Setups/Setup11_RPi_touch_ILI9486.h> // Setup file configured for ESP32 and RPi TFT with touch
|
||||
//#include <User_Setups/Setup12_M5Stack_Basic_Core.h>// Setup file for the ESP32 based M5Stack (Basic Core only)
|
||||
//#include <User_Setups/Setup13_ILI9481_Parallel.h> // Setup file for the ESP32 with parallel bus TFT
|
||||
//#include <User_Setups/Setup14_ILI9341_Parallel.h> // Setup file for the ESP32 with parallel bus TFT
|
||||
//#include <User_Setups/Setup15_HX8357D.h> // Setup file for ESP8266 configured for HX8357D
|
||||
//#include <User_Setups/Setup16_ILI9488_Parallel.h> // Setup file for the ESP32 with parallel bus TFT
|
||||
//#include <User_Setups/Setup17_ePaper.h> // Setup file for ESP8266 and any Waveshare ePaper display
|
||||
//#include <User_Setups/Setup18_ST7789.h> // Setup file for ESP8266 configured for ST7789
|
||||
|
||||
//#include <User_Setups/Setup19_RM68140_Parallel.h> // Setup file configured for RM68140 with parallel bus
|
||||
|
||||
//#include <User_Setups/Setup20_ILI9488.h> // Setup file for ESP8266 and ILI9488 SPI bus TFT
|
||||
//#include <User_Setups/Setup21_ILI9488.h> // Setup file for ESP32 and ILI9488 SPI bus TFT
|
||||
|
||||
//#include <User_Setups/Setup22_TTGO_T4.h> // Setup file for ESP32 and TTGO T4 version 1.2
|
||||
//#include <User_Setups/Setup22_TTGO_T4_v1.3.h> // Setup file for ESP32 and TTGO T4 version 1.3
|
||||
//#include <User_Setups/Setup23_TTGO_TM.h> // Setup file for ESP32 and TTGO TM ST7789 SPI bus TFT
|
||||
//#include <User_Setups/Setup24_ST7789.h> // Setup file for DSTIKE/ESP32/ESP8266 configured for ST7789 240 x 240
|
||||
//#include <User_Setups/Setup25_TTGO_T_Display.h> // Setup file for ESP32 and TTGO T-Display ST7789V SPI bus TFT
|
||||
//#include <User_Setups/Setup26_TTGO_T_Wristband.h> // Setup file for ESP32 and TTGO T-Wristband ST7735 SPI bus TFT
|
||||
|
||||
//#include <User_Setups/Setup27_RPi_ST7796_ESP32.h> // ESP32 RPi MHS-4.0 inch Display-B
|
||||
//#include <User_Setups/Setup28_RPi_ST7796_ESP8266.h> // ESP8266 RPi MHS-4.0 inch Display-B
|
||||
|
||||
//#include <User_Setups/Setup29_ILI9341_STM32.h> // Setup for Nucleo board
|
||||
//#include <User_Setups/Setup30_ILI9341_Parallel_STM32.h> // Setup for Nucleo board and parallel display
|
||||
//#include <User_Setups/Setup31_ST7796_Parallel_STM32.h> // Setup for Nucleo board and parallel display
|
||||
//#include <User_Setups/Setup32_ILI9341_STM32F103.h> // Setup for "Blue/Black Pill"
|
||||
|
||||
//#include <User_Setups/Setup33_RPi_ILI9486_STM32.h> // Setup for Nucleo board
|
||||
|
||||
//#include <User_Setups/Setup34_ILI9481_Parallel_STM32.h> // Setup for Nucleo board and parallel display
|
||||
//#include <User_Setups/Setup35_ILI9341_STM32_Port_Bus.h> // Setup for STM32 port A parallel display
|
||||
|
||||
//#include <User_Setups/Setup36_RPi_touch_ST7796.h> // Setup file configured for ESP32 and RPi ST7796 TFT with touch
|
||||
|
||||
//#include <User_Setups/Setup42_ILI9341_ESP32.h> // Setup file for ESP32 and SPI ILI9341 240x320
|
||||
//#include <User_Setups/Setup43_ST7735.h> // Setup file for ESP8266 & ESP32 configured for my ST7735S 80x160
|
||||
//#include <User_Setups/Setup44_TTGO_CameraPlus.h> // Setup file for ESP32 and TTGO T-CameraPlus ST7789 SPI bus TFT 240x240
|
||||
//#include <User_Setups/Setup45_TTGO_T_Watch.h> // Setup file for ESP32 and TTGO T-Watch ST7789 SPI bus TFT 240x240
|
||||
//#include <User_Setups/Setup46_GC9A01_ESP32.h> // Setup file for ESP32 and GC9A01 SPI bus TFT 240x240
|
||||
|
||||
//#include <User_Setups/Setup47_ST7735.h> // Setup file for ESP32 configured for ST7735 128 x 128 animated eyes
|
||||
|
||||
//#include <User_Setups/Setup50_SSD1963_Parallel.h> // Setup file for ESP32 and SSD1963 TFT display
|
||||
|
||||
//#include <User_Setups/Setup51_LilyPi_ILI9481.h> // Setup file for LilyGo LilyPi with ILI9481 display
|
||||
//#include <User_Setups/Setup52_LilyPi_ST7796.h> // Setup file for LilyGo LilyPi with ST7796 display
|
||||
|
||||
//#include <User_Setups/Setup60_RP2040_ILI9341.h> // Setup file for RP2040 with SPI ILI9341
|
||||
//#include <User_Setups/Setup61_RP2040_ILI9341_PIO_SPI.h> // Setup file for RP2040 with PIO SPI ILI9341
|
||||
//#include <User_Setups/Setup62_RP2040_Nano_Connect_ILI9341.h> // Setup file for RP2040 with SPI ILI9341
|
||||
|
||||
//#include <User_Setups/Setup66_Seeed_XIAO_Round.h> // Setup file for Seeed XIAO with GC9A01 240x240
|
||||
|
||||
//#include <User_Setups/Setup70_ESP32_S2_ILI9341.h> // Setup file for ESP32 S2 with SPI ILI9341
|
||||
//#include <User_Setups/Setup70b_ESP32_S3_ILI9341.h> // Setup file for ESP32 S3 with SPI ILI9341
|
||||
//#include <User_Setups/Setup70c_ESP32_C3_ILI9341.h> // Setup file for ESP32 C3 with SPI ILI9341
|
||||
//#include <User_Setups/Setup70d_ILI9488_S3_Parallel.h> // Setup file for ESP32 S3 with SPI ILI9488
|
||||
|
||||
//#include <User_Setups/Setup71_ESP32_S2_ST7789.h> // Setup file for ESP32 S2 with ST7789
|
||||
//#include <User_Setups/Setup72_ESP32_ST7789_172x320.h> // Setup file for ESP32 with ST7789 1.47" 172x320
|
||||
|
||||
//#include <User_Setups/Setup100_RP2040_ILI9488_parallel.h> // Setup file for Pico/RP2040 with 8-bit parallel ILI9488
|
||||
//#include <User_Setups/Setup101_RP2040_ILI9481_parallel.h> // Setup file for Pico/RP2040 with 8-bit parallel ILI9481
|
||||
//#include <User_Setups/Setup102_RP2040_ILI9341_parallel.h> // Setup file for Pico/RP2040 with 8-bit parallel ILI9341
|
||||
//#include <User_Setups/Setup103_RP2040_ILI9486_parallel.h> // Setup file for Pico/RP2040 with 8-bit parallel ILI9486
|
||||
//#include <User_Setups/Setup104_RP2040_ST7796_parallel.h> // Setup file for Pico/RP2040 with 8-bit parallel ST7796
|
||||
|
||||
//#include <User_Setups/Setup105_RP2040_ST7796_16bit_parallel.h> // Setup file for RP2040 16-bit parallel display
|
||||
//#include <User_Setups/Setup106_RP2040_ILI9481_16bit_parallel.h> // Setup file for RP2040 16-bit parallel display
|
||||
//#include <User_Setups/Setup107_RP2040_ILI9341_16bit_parallel.h> // Setup file for RP2040 16-bit parallel display
|
||||
//#include <User_Setups/Setup108_RP2040_ST7735.h> // Setup file for Waveshare RP2040 board with onboard ST7735 0.96" 160x80 display
|
||||
|
||||
//#include <User_Setups/Setup135_ST7789.h> // Setup file for ESP8266 and ST7789 135 x 240 TFT
|
||||
|
||||
//#include <User_Setups/Setup136_LilyGo_TTV.h> // Setup file for ESP32 and Lilygo TTV ST7789 SPI bus TFT 135x240
|
||||
//#include <User_Setups/Setup137_LilyGo_TDisplay_RP2040.h> // Setup file for Lilygo T-Display RP2040 (ST7789 on SPI bus with 135x240 TFT)
|
||||
|
||||
//#include <User_Setups/Setup138_Pico_Explorer_Base_RP2040_ST7789.h> // Setup file for Pico Explorer Base by Pimoroni for RP2040 (ST7789 on SPI bus with 240x240 TFT)
|
||||
|
||||
//#include <User_Setups/Setup200_GC9A01.h> // Setup file for ESP32 and GC9A01 240 x 240 TFT
|
||||
|
||||
//#include <User_Setups/Setup201_WT32_SC01.h> // Setup file for ESP32 based WT32_SC01 from Seeed
|
||||
|
||||
//#include <User_Setups/Setup202_SSD1351_128.h> // Setup file for ESP32/ESP8266 based SSD1351 128x128 1.5inch OLED display
|
||||
|
||||
//#include <User_Setups/Setup203_ST7789.h> // Setup file for ESP32/ESP8266 based ST7789 240X280 1.69inch TFT
|
||||
|
||||
//#include <User_Setups/Setup204_ESP32_TouchDown.h> // Setup file for the ESP32 TouchDown based on ILI9488 480 x 320 TFT
|
||||
|
||||
//#include <User_Setups/Setup205_ESP32_TouchDown_S3.h> // Setup file for the ESP32 TouchDown S3 based on ILI9488 480 x 320 TFT
|
||||
|
||||
//#include <User_Setups/Setup206_LilyGo_T_Display_S3.h> // For the LilyGo T-Display S3 based ESP32S3 with ST7789 170 x 320 TFT
|
||||
//#include <User_Setups/Setup207_LilyGo_T_HMI.h> // For the LilyGo T-HMI S3 based ESP32S3 with ST7789 240 x 320 TFT
|
||||
//#include <User_Setups/Setup209_LilyGo_T_Dongle_S3.h> // For the LilyGo T-Dongle S3 based ESP32 with ST7735 80 x 160 TFT
|
||||
//#include <User_Setups/Setup210_LilyGo_T_Embed_S3.h> // For the LilyGo T-Embed S3 based ESP32S3 with ST7789 170 x 320 TFT
|
||||
//#include <User_Setups/Setup211_LilyGo_T_QT_Pro_S3.h> // For the LilyGo T-QT Pro S3 based ESP32S3 with GC9A01 128 x 128 TFT
|
||||
// #include <User_Setups/Setup212_LilyGo_T_PicoPro.h> // For the LilyGo T-PICO-Pro with ST7796 222 x 480 TFT
|
||||
// #include <User_Setups/Setup213_LilyGo_T_Beam_Shield.h> // For the LilyGo T-BEAM V1.x with ST7796 222 x 480 TFT
|
||||
|
||||
//#include <User_Setups/Setup250_ESP32_S3_Box_Lite.h> // For the ESP32 S3 Box Lite
|
||||
//#include <User_Setups/Setup251_ESP32_S3_Box.h> // For the ESP32 S3 Box
|
||||
|
||||
//#include <User_Setups/Setup301_BW16_ST7735.h> // Setup file for Bw16-based boards with ST7735 160 x 80 TFT
|
||||
//#include <User_Setups/Setup302_Waveshare_ESP32S3_GC9A01.h> // Setup file for Waveshare ESP32-S3-Touch-LCD-1.28 board with GC9A01 240*240 TFT
|
||||
|
||||
//#include <User_Setups/SetupX_Template.h> // Template file for a setup
|
||||
|
||||
|
||||
//#include <User_Setups/Dustin_ILI9488.h> // Setup file for Dustin Watts PCB with ILI9488
|
||||
//#include <User_Setups/Dustin_ST7796.h> // Setup file for Dustin Watts PCB with ST7796
|
||||
//#include <User_Setups/Dustin_ILI9488_Pico.h> // Setup file for Dustin Watts Pico PCB with ST7796
|
||||
//#include <User_Setups/Dustin_ST7789_Pico.h> // Setup file for Dustin Watts PCB with ST7789 240 x 240 on 3.3V adapter board
|
||||
//#include <User_Setups/Dustin_GC9A01_Pico.h> // Setup file for Dustin Watts PCB with GC9A01 240 x 240 on 3.3V adapter board
|
||||
//#include <User_Setups/Dustin_GC9A01_ESP32.h> // Setup file for Dustin Watts PCB with GC9A01 240 x 240 on 3.3V adapter board
|
||||
//#include <User_Setups/Dustin_STT7789_ESP32.h> // Setup file for Dustin Watts PCB with ST7789 240 x 240 on 3.3V adapter board
|
||||
//#include <User_Setups/Dustin_ILI9341_ESP32.h> // Setup file for Dustin Watts PCB with ILI9341
|
||||
//#include <User_Setups/ILI9225.h>
|
||||
|
||||
#endif // USER_SETUP_LOADED
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// DON'T TINKER WITH ANY OF THE FOLLOWING LINES, THESE ADD THE TFT DRIVERS //
|
||||
// AND ESP8266 PIN DEFINITONS, THEY ARE HERE FOR BODMER'S CONVENIENCE! //
|
||||
// //
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <User_Setup.h>
|
||||
|
||||
// Identical looking TFT displays may have a different colour ordering in the 16-bit colour
|
||||
#define TFT_BGR 0 // Colour order Blue-Green-Red
|
||||
#define TFT_RGB 1 // Colour order Red-Green-Blue
|
||||
|
||||
// Legacy setup support, RPI_DISPLAY_TYPE replaces RPI_DRIVER
|
||||
#if defined (RPI_DRIVER)
|
||||
#if !defined (RPI_DISPLAY_TYPE)
|
||||
#define RPI_DISPLAY_TYPE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Legacy setup support, RPI_ILI9486_DRIVER form is deprecated
|
||||
// Instead define RPI_DISPLAY_TYPE and also define driver (e.g. ILI9486_DRIVER)
|
||||
#if defined (RPI_ILI9486_DRIVER)
|
||||
#if !defined (ILI9486_DRIVER)
|
||||
#define ILI9486_DRIVER
|
||||
#endif
|
||||
#if !defined (RPI_DISPLAY_TYPE)
|
||||
#define RPI_DISPLAY_TYPE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Invoke 18-bit colour for selected displays
|
||||
#if !defined (RPI_DISPLAY_TYPE) && !defined (TFT_PARALLEL_8_BIT) && !defined (TFT_PARALLEL_16_BIT) && !defined (ESP32_PARALLEL)
|
||||
#if defined (ILI9481_DRIVER) || defined (ILI9486_DRIVER) || defined (ILI9488_DRIVER)
|
||||
#define SPI_18BIT_DRIVER
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Load the right driver definition - do not tinker here !
|
||||
#if defined (ILI9341_DRIVER) || defined(ILI9341_2_DRIVER) || defined (ILI9342_DRIVER)
|
||||
#include <TFT_Drivers/ILI9341_Defines.h>
|
||||
#define TFT_DRIVER 0x9341
|
||||
#elif defined (ST7735_DRIVER)
|
||||
#include <TFT_Drivers/ST7735_Defines.h>
|
||||
#define TFT_DRIVER 0x7735
|
||||
#elif defined (ILI9163_DRIVER)
|
||||
#include <TFT_Drivers/ILI9163_Defines.h>
|
||||
#define TFT_DRIVER 0x9163
|
||||
#elif defined (S6D02A1_DRIVER)
|
||||
#include <TFT_Drivers/S6D02A1_Defines.h>
|
||||
#define TFT_DRIVER 0x6D02
|
||||
#elif defined (ST7796_DRIVER)
|
||||
#include "TFT_Drivers/ST7796_Defines.h"
|
||||
#define TFT_DRIVER 0x7796
|
||||
#elif defined (ILI9486_DRIVER)
|
||||
#include <TFT_Drivers/ILI9486_Defines.h>
|
||||
#define TFT_DRIVER 0x9486
|
||||
#elif defined (ILI9481_DRIVER)
|
||||
#include <TFT_Drivers/ILI9481_Defines.h>
|
||||
#define TFT_DRIVER 0x9481
|
||||
#elif defined (ILI9488_DRIVER)
|
||||
#include <TFT_Drivers/ILI9488_Defines.h>
|
||||
#define TFT_DRIVER 0x9488
|
||||
#elif defined (HX8357D_DRIVER)
|
||||
#include "TFT_Drivers/HX8357D_Defines.h"
|
||||
#define TFT_DRIVER 0x8357
|
||||
#elif defined (EPD_DRIVER)
|
||||
#include "TFT_Drivers/EPD_Defines.h"
|
||||
#define TFT_DRIVER 0xE9D
|
||||
#elif defined (ST7789_DRIVER)
|
||||
#include "TFT_Drivers/ST7789_Defines.h"
|
||||
#define TFT_DRIVER 0x7789
|
||||
#elif defined (R61581_DRIVER)
|
||||
#include "TFT_Drivers/R61581_Defines.h"
|
||||
#define TFT_DRIVER 0x6158
|
||||
#elif defined (ST7789_2_DRIVER)
|
||||
#include "TFT_Drivers/ST7789_2_Defines.h"
|
||||
#define TFT_DRIVER 0x778B
|
||||
#elif defined (RM68140_DRIVER)
|
||||
#include "TFT_Drivers/RM68140_Defines.h"
|
||||
#define TFT_DRIVER 0x6814
|
||||
#elif defined (SSD1351_DRIVER)
|
||||
#include "TFT_Drivers/SSD1351_Defines.h"
|
||||
#define TFT_DRIVER 0x1351
|
||||
#elif defined (SSD1963_480_DRIVER)
|
||||
#include "TFT_Drivers/SSD1963_Defines.h"
|
||||
#define TFT_DRIVER 0x1963
|
||||
#elif defined (SSD1963_800_DRIVER)
|
||||
#include "TFT_Drivers/SSD1963_Defines.h"
|
||||
#define TFT_DRIVER 0x1963
|
||||
#elif defined (SSD1963_800ALT_DRIVER)
|
||||
#include "TFT_Drivers/SSD1963_Defines.h"
|
||||
#define TFT_DRIVER 0x1963
|
||||
#elif defined (SSD1963_800BD_DRIVER)
|
||||
#include "TFT_Drivers/SSD1963_Defines.h"
|
||||
#define TFT_DRIVER 0x1963
|
||||
#elif defined (GC9A01_DRIVER)
|
||||
#include "TFT_Drivers/GC9A01_Defines.h"
|
||||
#define TFT_DRIVER 0x9A01
|
||||
#elif defined (ILI9225_DRIVER)
|
||||
#include "TFT_Drivers/ILI9225_Defines.h"
|
||||
#define TFT_DRIVER 0x9225
|
||||
#elif defined (RM68120_DRIVER)
|
||||
#include "TFT_Drivers/RM68120_Defines.h"
|
||||
#define TFT_DRIVER 0x6812
|
||||
#elif defined (HX8357B_DRIVER)
|
||||
#include "TFT_Drivers/HX8357B_Defines.h"
|
||||
#define TFT_DRIVER 0x835B
|
||||
#elif defined (HX8357C_DRIVER)
|
||||
#include "TFT_Drivers/HX8357C_Defines.h"
|
||||
#define TFT_DRIVER 0x835C
|
||||
|
||||
// <<<<<<<<<<<<<<<<<<<<<<<< ADD NEW DRIVER HERE
|
||||
// XYZZY_init.h and XYZZY_rotation.h must also be added in TFT_eSPI.cpp
|
||||
#elif defined (XYZZY_DRIVER)
|
||||
#include "TFT_Drivers/XYZZY_Defines.h"
|
||||
#define TFT_DRIVER 0x0000
|
||||
#else
|
||||
#define TFT_DRIVER 0x0000
|
||||
#endif
|
||||
#include <TFT_Drivers/ILI9341_Defines.h>
|
||||
#define TFT_DRIVER 0x9341
|
||||
|
||||
// These are the pins for ESP8266 boards
|
||||
// Name GPIO NodeMCU Function
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
// This setup is for the RP2040 processor only when used with 8-bit parallel displays
|
||||
// See SetupX_Template.h for all options available
|
||||
#define USER_SETUP_ID 100
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Interface
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#define TFT_PARALLEL_8_BIT
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Display driver type
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#define ILI9488_DRIVER
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// RP2040 pins used
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//#define TFT_CS -1 // Do not define, chip select control pin permanently connected to 0V
|
||||
|
||||
// These pins can be moved and are controlled directly by the library software
|
||||
#define TFT_DC 28 // Data Command control pin
|
||||
#define TFT_RST 2 // Reset pin
|
||||
|
||||
//#define TFT_RD -1 // Do not define, read pin permanently connected to 3V3
|
||||
|
||||
// Note: All the following pins are PIO hardware configured and driven
|
||||
#define TFT_WR 22
|
||||
|
||||
// PIO requires these to be sequentially increasing - do not change
|
||||
#define TFT_D0 6
|
||||
#define TFT_D1 7
|
||||
#define TFT_D2 8
|
||||
#define TFT_D3 9
|
||||
#define TFT_D4 10
|
||||
#define TFT_D5 11
|
||||
#define TFT_D6 12
|
||||
#define TFT_D7 13
|
||||
//*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// 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
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1,54 +0,0 @@
|
||||
// This setup is for the RP2040 processor only when used with 8-bit parallel displays
|
||||
// See SetupX_Template.h for all options available
|
||||
#define USER_SETUP_ID 101
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Interface
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#define TFT_PARALLEL_8_BIT
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Display driver type
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#define ILI9481_DRIVER
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// RP2040 pins used
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//#define TFT_CS -1 // Do not define, chip select control pin permanently connected to 0V
|
||||
|
||||
// These pins can be moved and are controlled directly by the library software
|
||||
#define TFT_DC 28 // Data Command control pin
|
||||
#define TFT_RST 2 // Reset pin
|
||||
|
||||
//#define TFT_RD -1 // Do not define, read pin permanently connected to 3V3
|
||||
|
||||
// Note: All the following pins are PIO hardware configured and driven
|
||||
#define TFT_WR 22
|
||||
|
||||
// PIO requires these to be sequentially increasing - do not change
|
||||
#define TFT_D0 6
|
||||
#define TFT_D1 7
|
||||
#define TFT_D2 8
|
||||
#define TFT_D3 9
|
||||
#define TFT_D4 10
|
||||
#define TFT_D5 11
|
||||
#define TFT_D6 12
|
||||
#define TFT_D7 13
|
||||
//*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// 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
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1,54 +0,0 @@
|
||||
// This setup is for the RP2040 processor only when used with 8-bit parallel displays
|
||||
// See SetupX_Template.h for all options available
|
||||
#define USER_SETUP_ID 102
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Interface
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#define TFT_PARALLEL_8_BIT
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Display driver type
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#define ILI9341_DRIVER
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// RP2040 pins used
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//#define TFT_CS -1 // Do not define, chip select control pin permanently connected to 0V
|
||||
|
||||
// These pins can be moved and are controlled directly by the library software
|
||||
#define TFT_DC 28 // Data Command control pin
|
||||
#define TFT_RST 2 // Reset pin
|
||||
|
||||
//#define TFT_RD -1 // Do not define, read pin permanently connected to 3V3
|
||||
|
||||
// Note: All the following pins are PIO hardware configured and driven
|
||||
#define TFT_WR 22
|
||||
|
||||
// PIO requires these to be sequentially increasing - do not change
|
||||
#define TFT_D0 6
|
||||
#define TFT_D1 7
|
||||
#define TFT_D2 8
|
||||
#define TFT_D3 9
|
||||
#define TFT_D4 10
|
||||
#define TFT_D5 11
|
||||
#define TFT_D6 12
|
||||
#define TFT_D7 13
|
||||
//*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// 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
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1,54 +0,0 @@
|
||||
// This setup is for the RP2040 processor only when used with 8-bit parallel displays
|
||||
// See SetupX_Template.h for all options available
|
||||
#define USER_SETUP_ID 103
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Interface
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#define TFT_PARALLEL_8_BIT
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Display driver type
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#define ILI9486_DRIVER
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// RP2040 pins used
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//#define TFT_CS -1 // Do not define, chip select control pin permanently connected to 0V
|
||||
|
||||
// These pins can be moved and are controlled directly by the library software
|
||||
#define TFT_DC 28 // Data Command control pin
|
||||
#define TFT_RST 2 // Reset pin
|
||||
|
||||
//#define TFT_RD -1 // Do not define, read pin permanently connected to 3V3
|
||||
|
||||
// Note: All the following pins are PIO hardware configured and driven
|
||||
#define TFT_WR 22
|
||||
|
||||
// PIO requires these to be sequentially increasing - do not change
|
||||
#define TFT_D0 6
|
||||
#define TFT_D1 7
|
||||
#define TFT_D2 8
|
||||
#define TFT_D3 9
|
||||
#define TFT_D4 10
|
||||
#define TFT_D5 11
|
||||
#define TFT_D6 12
|
||||
#define TFT_D7 13
|
||||
//*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// 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
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1,54 +0,0 @@
|
||||
// This setup is for the RP2040 processor only when used with 8-bit parallel displays
|
||||
// See SetupX_Template.h for all options available
|
||||
#define USER_SETUP_ID 104
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Interface
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#define TFT_PARALLEL_8_BIT
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Display driver type
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#define ST7796_DRIVER
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// RP2040 pins used
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//#define TFT_CS -1 // Do not define, chip select control pin permanently connected to 0V
|
||||
|
||||
// These pins can be moved and are controlled directly by the library software
|
||||
#define TFT_DC 28 // Data Command control pin
|
||||
#define TFT_RST 2 // Reset pin
|
||||
|
||||
//#define TFT_RD -1 // Do not define, read pin permanently connected to 3V3
|
||||
|
||||
// Note: All the following pins are PIO hardware configured and driven
|
||||
#define TFT_WR 22
|
||||
|
||||
// PIO requires these to be sequentially increasing - do not change
|
||||
#define TFT_D0 6
|
||||
#define TFT_D1 7
|
||||
#define TFT_D2 8
|
||||
#define TFT_D3 9
|
||||
#define TFT_D4 10
|
||||
#define TFT_D5 11
|
||||
#define TFT_D6 12
|
||||
#define TFT_D7 13
|
||||
//*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// 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
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1,60 +0,0 @@
|
||||
// This setup is for the RP2040 processor only when used with 8-bit parallel displays
|
||||
// See SetupX_Template.h for all options available
|
||||
#define USER_SETUP_ID 105
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Interface
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#define TFT_PARALLEL_16_BIT
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Display driver type
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#define ST7796_DRIVER
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// RP2040 pins used
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//#define TFT_CS -1 // Do not define, chip select control pin permanently connected to 0V
|
||||
|
||||
// These pins can be moved and are controlled directly by the library software
|
||||
#define TFT_DC 3 // Data Command control pin
|
||||
#define TFT_RST 2 // Reset pin
|
||||
|
||||
//#define TFT_RD -1 // Do not define, read pin must be permanently connected to 3V3
|
||||
#define TFT_WR 4
|
||||
|
||||
// PIO requires these to be sequentially increasing GPIO with no gaps
|
||||
#define TFT_D0 6
|
||||
#define TFT_D1 7
|
||||
#define TFT_D2 8
|
||||
#define TFT_D3 9
|
||||
#define TFT_D4 10
|
||||
#define TFT_D5 11
|
||||
#define TFT_D6 12
|
||||
#define TFT_D7 13
|
||||
#define TFT_D8 14
|
||||
#define TFT_D9 15
|
||||
#define TFT_D10 16
|
||||
#define TFT_D11 17
|
||||
#define TFT_D12 18
|
||||
#define TFT_D13 19
|
||||
#define TFT_D14 20
|
||||
#define TFT_D15 21
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// 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
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1,77 +0,0 @@
|
||||
// This setup is for the RP2040 processor when used with 8-bit parallel displays
|
||||
// See SetupX_Template.h for all options available
|
||||
#define USER_SETUP_ID 106
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Interface
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//#define TFT_PARALLEL_8_BIT
|
||||
#define TFT_PARALLEL_16_BIT
|
||||
|
||||
// The parallel interface write cycle period is derived from a division of the CPU clock
|
||||
// speed so scales with the processor clock. This means that the divider ratio may need
|
||||
// to be increased when overclocking. I may also need to be adjusted dependant on the
|
||||
// display controller type (ILI94341, HX8357C etc.). If RP2040_PIO_CLK_DIV is not defined
|
||||
// the library will set default values which may not suit your display.
|
||||
// The display controller data sheet will specify the minimum write cycle period. The
|
||||
// controllers often work reliably for shorter periods, however if the period is too short
|
||||
// the display may not initialise or graphics will become corrupted.
|
||||
// PIO write cycle frequency = (CPU clock/(4 * RP2040_PIO_CLK_DIV))
|
||||
//#define RP2040_PIO_CLK_DIV 1 // 32ns write cycle at 125MHz CPU clock
|
||||
//#define RP2040_PIO_CLK_DIV 2 // 64ns write cycle at 125MHz CPU clock
|
||||
//#define RP2040_PIO_CLK_DIV 3 // 96ns write cycle at 125MHz CPU clock
|
||||
//#define RP2040_PIO_CLK_DIV 4 // 96ns write cycle at 125MHz CPU clock
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Display driver type
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#define ILI9481_DRIVER
|
||||
//#define HX8357B_DRIVER
|
||||
//#define HX8357C_DRIVER
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// RP2040 pins used
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// These pins can be moved and are controlled directly by the library software
|
||||
#define TFT_RST 18 // Reset pin
|
||||
#define TFT_CS 19 // Do not define if chip select control pin permanently connected to 0V
|
||||
//#define TFT_RD -1 // Do not define, read pin must be permanently connected to 3V3
|
||||
|
||||
// Note: All the following pins are PIO hardware configured and driven
|
||||
#define TFT_WR 16 // Write strobe pin
|
||||
#define TFT_DC 17 // Data Command control pin
|
||||
|
||||
// PIO requires these to be sequentially increasing
|
||||
#define TFT_D0 0
|
||||
#define TFT_D1 1
|
||||
#define TFT_D2 2
|
||||
#define TFT_D3 3
|
||||
#define TFT_D4 4
|
||||
#define TFT_D5 5
|
||||
#define TFT_D6 6
|
||||
#define TFT_D7 7
|
||||
#define TFT_D8 8
|
||||
#define TFT_D9 9
|
||||
#define TFT_D10 10
|
||||
#define TFT_D11 11
|
||||
#define TFT_D12 12
|
||||
#define TFT_D13 13
|
||||
#define TFT_D14 14
|
||||
#define TFT_D15 15
|
||||
//*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// 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
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1,65 +0,0 @@
|
||||
// This setup is for the RP2040 processor only when used with 8-bit parallel displays
|
||||
// See SetupX_Template.h for all options available
|
||||
#define USER_SETUP_ID 107
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Interface
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//#define TFT_PARALLEL_8_BIT
|
||||
#define TFT_PARALLEL_16_BIT
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Display driver type
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#define ILI9341_DRIVER
|
||||
//#define ILI9481_DRIVER // Tested
|
||||
//#define HX8357B_DRIVER // Tested
|
||||
//#define HX8357C_DRIVER // Tested
|
||||
//#define SSD1963_800_DRIVER
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// RP2040 pins used
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// These pins can be moved and are controlled directly by the library software
|
||||
#define TFT_RST 18 // Reset pin
|
||||
#define TFT_CS 19 // Do not define if chip select control pin permanently connected to 0V
|
||||
//#define TFT_RD -1 // Do not define, read pin must be permanently connected to 3V3
|
||||
|
||||
// Note: All the following pins are PIO hardware configured and driven
|
||||
#define TFT_WR 16 // Write strobe pin
|
||||
#define TFT_DC 17 // Data Command control pin
|
||||
|
||||
// PIO requires these to be sequentially increasing
|
||||
#define TFT_D0 0
|
||||
#define TFT_D1 1
|
||||
#define TFT_D2 2
|
||||
#define TFT_D3 3
|
||||
#define TFT_D4 4
|
||||
#define TFT_D5 5
|
||||
#define TFT_D6 6
|
||||
#define TFT_D7 7
|
||||
#define TFT_D8 8
|
||||
#define TFT_D9 9
|
||||
#define TFT_D10 10
|
||||
#define TFT_D11 11
|
||||
#define TFT_D12 12
|
||||
#define TFT_D13 13
|
||||
#define TFT_D14 14
|
||||
#define TFT_D15 15
|
||||
//*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// 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
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1,44 +0,0 @@
|
||||
// This setup is for the Waveshare RP2040-LCD-0.96 board
|
||||
// See SetupX_Template.h for all options available
|
||||
#define USER_SETUP_ID 108
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Display driver type
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#define ST7735_DRIVER
|
||||
#define ST7735_GREENTAB160x80
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Display params
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#define TFT_WIDTH 80
|
||||
#define TFT_HEIGHT 160
|
||||
#define TFT_INVERSION_ON
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// RP2040 config and pins
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#define SPI_FREQUENCY 27000000
|
||||
#define RP2040_PIO_CLK_DIV 1
|
||||
#define TFT_SPI_PORT 1
|
||||
|
||||
#define TFT_MOSI 11
|
||||
#define TFT_SCLK 10
|
||||
#define TFT_CS 9
|
||||
#define TFT_DC 8
|
||||
#define TFT_RST 12
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// 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
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1,33 +0,0 @@
|
||||
// For ESP8266
|
||||
// See SetupX_Template.h for all options available
|
||||
#define USER_SETUP_ID 10
|
||||
|
||||
#define RPI_DISPLAY_TYPE
|
||||
#define ILI9486_DRIVER
|
||||
|
||||
// For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation
|
||||
#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
|
||||
|
||||
#define TOUCH_CS PIN_D1 // Chip select pin (T_CS) of touch screen
|
||||
|
||||
|
||||
#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
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
|
||||
#define SPI_FREQUENCY 16000000 // Some displays will operate at higher frequencies
|
||||
|
||||
#define SPI_TOUCH_FREQUENCY 2500000
|
||||
|
||||
|
||||
// #define SUPPORT_TRANSACTIONS
|
||||
@@ -1,32 +0,0 @@
|
||||
// For ESP32
|
||||
// See SetupX_Template.h for all options available
|
||||
#define USER_SETUP_ID 11
|
||||
|
||||
#define RPI_DISPLAY_TYPE
|
||||
#define ILI9486_DRIVER
|
||||
|
||||
#define TFT_MISO 19
|
||||
#define TFT_MOSI 23
|
||||
#define TFT_SCLK 18
|
||||
#define TFT_CS 15 // Chip select control pin
|
||||
#define TFT_DC 2 // Data Command control pin
|
||||
#define TFT_RST 4 // Reset pin (could connect to RST pin)
|
||||
//#define TFT_RST -1 // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST
|
||||
|
||||
#define TOUCH_CS 22 // Chip select pin (T_CS) of touch screen
|
||||
|
||||
|
||||
#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
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
|
||||
#define SPI_FREQUENCY 20000000 // Some displays will operate at higher frequencies
|
||||
|
||||
#define SPI_TOUCH_FREQUENCY 2500000
|
||||
@@ -1,33 +0,0 @@
|
||||
// See SetupX_Template.h for all options available
|
||||
#define USER_SETUP_ID 12
|
||||
|
||||
//Setup file for the M5Stack Basic Core
|
||||
|
||||
#define ILI9341_DRIVER
|
||||
|
||||
#define M5STACK
|
||||
|
||||
#define TFT_MISO 19
|
||||
#define TFT_MOSI 23
|
||||
#define TFT_SCLK 18
|
||||
#define TFT_CS 14 // Chip select control pin
|
||||
#define TFT_DC 27 // Data Command control pin
|
||||
#define TFT_RST 33 // Reset pin (could connect to Arduino RESET pin)
|
||||
#define TFT_BL 32 // LED back-light
|
||||
|
||||
|
||||
#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
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
|
||||
#define SPI_FREQUENCY 27000000
|
||||
|
||||
// Optional reduced SPI frequency for reading TFT
|
||||
#define SPI_READ_FREQUENCY 5000000
|
||||
@@ -1,57 +0,0 @@
|
||||
// ST7789 135 x 240 display with no chip select line
|
||||
#define USER_SETUP_ID 135
|
||||
|
||||
#define ST7789_DRIVER // Configure all registers
|
||||
|
||||
#define TFT_WIDTH 135
|
||||
#define TFT_HEIGHT 240
|
||||
|
||||
#define CGRAM_OFFSET // Library will add offsets required
|
||||
|
||||
//#define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
|
||||
//#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red
|
||||
|
||||
//#define TFT_INVERSION_ON
|
||||
//#define TFT_INVERSION_OFF
|
||||
|
||||
// DSTIKE stepup
|
||||
//#define TFT_DC 23
|
||||
//#define TFT_RST 32
|
||||
//#define TFT_MOSI 26
|
||||
//#define TFT_SCLK 27
|
||||
|
||||
// Generic ESP32 setup
|
||||
//#define TFT_MISO 19
|
||||
//#define TFT_MOSI 23
|
||||
//#define TFT_SCLK 18
|
||||
//#define TFT_CS -1 // Not connected
|
||||
//#define TFT_DC 2
|
||||
//#define TFT_RST 4 // Connect reset to ensure display initialises
|
||||
|
||||
// For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation
|
||||
#define TFT_CS -1 // Define as not used
|
||||
#define TFT_DC PIN_D1 // Data Command control pin
|
||||
//#define TFT_RST PIN_D4 // TFT reset pin (could connect to NodeMCU RST, see next line)
|
||||
#define TFT_RST -1 // TFT reset pin connect to NodeMCU RST, must also then add 10K pull down to TFT 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_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
|
||||
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
|
||||
// #define SPI_FREQUENCY 27000000
|
||||
#define SPI_FREQUENCY 40000000
|
||||
|
||||
#define SPI_READ_FREQUENCY 20000000
|
||||
|
||||
#define SPI_TOUCH_FREQUENCY 2500000
|
||||
|
||||
// #define SUPPORT_TRANSACTIONS
|
||||
@@ -1,35 +0,0 @@
|
||||
// ST7789 135 x 240 display with no chip select line
|
||||
#define USER_SETUP_ID 136
|
||||
|
||||
#define ST7789_DRIVER // Configure all registers
|
||||
|
||||
#define TFT_WIDTH 135
|
||||
#define TFT_HEIGHT 240
|
||||
|
||||
#define CGRAM_OFFSET // Library will add offsets required
|
||||
|
||||
// Generic ESP32 setup
|
||||
//#define TFT_MISO 19
|
||||
#define TFT_MOSI 23
|
||||
#define TFT_SCLK 18
|
||||
#define TFT_CS 5
|
||||
#define TFT_DC 19
|
||||
#define TFT_RST 4
|
||||
|
||||
|
||||
#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_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
|
||||
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
|
||||
// #define SPI_FREQUENCY 27000000
|
||||
#define SPI_FREQUENCY 40000000
|
||||
|
||||
// #define SUPPORT_TRANSACTIONS
|
||||
@@ -1,33 +0,0 @@
|
||||
// LilyGo T-Display RP2040 (ST7789 135 x 240 display)
|
||||
#define USER_SETUP_ID 137
|
||||
|
||||
#define ST7789_DRIVER // Configure all registers
|
||||
|
||||
#define TFT_WIDTH 135
|
||||
#define TFT_HEIGHT 240
|
||||
|
||||
#define CGRAM_OFFSET // Library will add offsets required
|
||||
|
||||
// For LilyGo T-Display RP2040
|
||||
#define TFT_CS 5 // Chip Select pin
|
||||
#define TFT_DC 1 // Data Command control pin
|
||||
#define TFT_RST 0 // Reset pin
|
||||
#define TFT_MOSI 3
|
||||
#define TFT_SCLK 2
|
||||
// Don't uncomment next line if you want PWM control of the backlight in the sketch
|
||||
//#define TFT_BL 4
|
||||
|
||||
#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_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
|
||||
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
#define SPI_FREQUENCY 40000000
|
||||
#define SPI_READ_FREQUENCY 20000000
|
||||
#define SPI_TOUCH_FREQUENCY 2500000
|
||||
@@ -1,32 +0,0 @@
|
||||
// Pico Explorer Base by Pimoroni (RP2040) (ST7789 on SPI bus with 240x240 TFT)
|
||||
#define USER_SETUP_ID 138
|
||||
|
||||
#define ST7789_DRIVER // Configure all registers
|
||||
|
||||
#define TFT_WIDTH 240
|
||||
#define TFT_HEIGHT 240
|
||||
|
||||
#define CGRAM_OFFSET // Library will add offsets required
|
||||
|
||||
// For Pico Explorer Base (PR2040)
|
||||
#define TFT_CS 17 // Chip Select pin
|
||||
#define TFT_DC 16 // Data Command control pin
|
||||
#define TFT_RST -1 // No Reset pin
|
||||
#define TFT_MOSI 19
|
||||
#define TFT_SCLK 18
|
||||
|
||||
|
||||
#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_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
|
||||
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
#define SPI_FREQUENCY 40000000
|
||||
#define SPI_READ_FREQUENCY 20000000
|
||||
#define SPI_TOUCH_FREQUENCY 2500000
|
||||
@@ -1,36 +0,0 @@
|
||||
// See SetupX_Template.h for all options available
|
||||
#define USER_SETUP_ID 13
|
||||
|
||||
#define TFT_PARALLEL_8_BIT
|
||||
|
||||
|
||||
#define ILI9481_DRIVER
|
||||
|
||||
|
||||
// ESP32 pins used for UNO format board
|
||||
#define TFT_CS 33 // Chip select control pin
|
||||
#define TFT_DC 15 // Data Command control pin - must use a pin in the range 0-31
|
||||
#define TFT_RST 32 // Reset pin
|
||||
|
||||
#define TFT_WR 4 // Write strobe control pin - must use a pin in the range 0-31
|
||||
#define TFT_RD 2
|
||||
|
||||
#define TFT_D0 12 // Must use pins in the range 0-31 for the data bus
|
||||
#define TFT_D1 13 // so a single register write sets/clears all bits
|
||||
#define TFT_D2 26
|
||||
#define TFT_D3 25
|
||||
#define TFT_D4 17
|
||||
#define TFT_D5 16
|
||||
#define TFT_D6 27
|
||||
#define TFT_D7 14
|
||||
|
||||
|
||||
#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
|
||||
|
||||
#define SMOOTH_FONT
|
||||
@@ -1,36 +0,0 @@
|
||||
// See SetupX_Template.h for all options available
|
||||
#define USER_SETUP_ID 14
|
||||
|
||||
#define TFT_PARALLEL_8_BIT
|
||||
|
||||
|
||||
#define ILI9341_DRIVER
|
||||
|
||||
|
||||
// ESP32 pins used for the parallel interface TFT
|
||||
#define TFT_CS 33 // Chip select control pin
|
||||
#define TFT_DC 15 // Data Command control pin - must use a pin in the range 0-31
|
||||
#define TFT_RST 32 // Reset pin
|
||||
|
||||
#define TFT_WR 4 // Write strobe control pin - must use a pin in the range 0-31
|
||||
#define TFT_RD 2
|
||||
|
||||
#define TFT_D0 12 // Must use pins in the range 0-31 for the data bus
|
||||
#define TFT_D1 13 // so a single register write sets/clears all bits
|
||||
#define TFT_D2 26
|
||||
#define TFT_D3 25
|
||||
#define TFT_D4 17
|
||||
#define TFT_D5 16
|
||||
#define TFT_D6 27
|
||||
#define TFT_D7 14
|
||||
|
||||
|
||||
#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
|
||||
|
||||
#define SMOOTH_FONT
|
||||
@@ -1,36 +0,0 @@
|
||||
// See SetupX_Template.h for all options available
|
||||
#define USER_SETUP_ID 15
|
||||
|
||||
#define HX8357D_DRIVER
|
||||
|
||||
// If green and blue swapped on display then change the RGB colour order
|
||||
// Only uncomment ONE of the following options
|
||||
#define TFT_RGB_ORDER TFT_RGB // Red-Green-Blue
|
||||
//#define TFT_RGB_ORDER TFT_BGR // Blue-Green-RED
|
||||
|
||||
// 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_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
|
||||
|
||||
|
||||
#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
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
|
||||
// #define SPI_FREQUENCY 20000000
|
||||
#define SPI_FREQUENCY 27000000
|
||||
// #define SPI_FREQUENCY 40000000
|
||||
|
||||
#define SPI_TOUCH_FREQUENCY 2500000
|
||||
|
||||
|
||||
// #define SUPPORT_TRANSACTIONS
|
||||
@@ -1,36 +0,0 @@
|
||||
// See SetupX_Template.h for all options available
|
||||
#define USER_SETUP_ID 16
|
||||
|
||||
#define ESP32_PARALLEL
|
||||
|
||||
|
||||
#define ILI9488_DRIVER
|
||||
|
||||
|
||||
// ESP32 pins used
|
||||
#define TFT_CS 33 // Chip select control pin
|
||||
#define TFT_DC 15 // Data Command control pin - must use a pin in the range 0-31
|
||||
#define TFT_RST 32 // Reset pin
|
||||
|
||||
#define TFT_WR 4 // Write strobe control pin - must use a pin in the range 0-31
|
||||
#define TFT_RD 2
|
||||
|
||||
#define TFT_D0 12 // Must use pins in the range 0-31 for the data bus
|
||||
#define TFT_D1 13 // so a single register write sets/clears all bits
|
||||
#define TFT_D2 26
|
||||
#define TFT_D3 25
|
||||
#define TFT_D4 17
|
||||
#define TFT_D5 16
|
||||
#define TFT_D6 27
|
||||
#define TFT_D7 14
|
||||
|
||||
|
||||
#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
|
||||
|
||||
#define SMOOTH_FONT
|
||||
@@ -1,16 +0,0 @@
|
||||
#define EPD_DRIVER // ePaper driver
|
||||
|
||||
#define TFT_MISO -1
|
||||
#define TFT_MOSI -1
|
||||
#define TFT_SCLK -1
|
||||
#define TFT_RST -1
|
||||
|
||||
#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
|
||||
|
||||
#define SMOOTH_FONT
|
||||
@@ -1,45 +0,0 @@
|
||||
// See SetupX_Template.h for all options available
|
||||
#define USER_SETUP_ID 18
|
||||
|
||||
#define ST7789_DRIVER
|
||||
|
||||
// #define TFT_SDA_READ // This option is for ESP32 ONLY, tested with ST7789 display only
|
||||
|
||||
// If colours are inverted (white shows as black) then uncomment one of the next
|
||||
// 2 lines try both options, one of the options should correct the inversion.
|
||||
// #define TFT_INVERSION_ON
|
||||
// #define TFT_INVERSION_OFF
|
||||
|
||||
// For ST7789 ONLY, define the colour order IF the blue and red are swapped on your display
|
||||
// Try ONE option at a time to find the correct colour order for your display
|
||||
// #define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
|
||||
// #define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red
|
||||
|
||||
|
||||
// My ST7789 display has TCT_CS wired permananently low so the pin is not defined here
|
||||
|
||||
// For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation
|
||||
#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 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
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
|
||||
// #define SPI_FREQUENCY 20000000
|
||||
#define SPI_FREQUENCY 27000000
|
||||
// #define SPI_FREQUENCY 40000000
|
||||
// #define SPI_FREQUENCY 80000000
|
||||
|
||||
#define SPI_TOUCH_FREQUENCY 2500000
|
||||
|
||||
|
||||
//#define SUPPORT_TRANSACTIONS
|
||||
@@ -1,36 +0,0 @@
|
||||
// See SetupX_Template.h for all options available
|
||||
#define USER_SETUP_ID 19
|
||||
|
||||
#define ESP32_PARALLEL
|
||||
|
||||
|
||||
#define RM68140_DRIVER
|
||||
|
||||
|
||||
// ESP32 pins used for UNO format board
|
||||
#define TFT_CS 33 // Chip select control pin
|
||||
#define TFT_DC 15 // Data Command control pin - must use a pin in the range 0-31
|
||||
#define TFT_RST 32 // Reset pin
|
||||
|
||||
#define TFT_WR 4 // Write strobe control pin - must use a pin in the range 0-31
|
||||
#define TFT_RD 2
|
||||
|
||||
#define TFT_D0 12 // Must use pins in the range 0-31 for the data bus
|
||||
#define TFT_D1 13 // so a single register write sets/clears all bits
|
||||
#define TFT_D2 26
|
||||
#define TFT_D3 25
|
||||
#define TFT_D4 17
|
||||
#define TFT_D5 16
|
||||
#define TFT_D6 27
|
||||
#define TFT_D7 14
|
||||
|
||||
|
||||
#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
|
||||
|
||||
#define SMOOTH_FONT
|
||||
@@ -1,32 +0,0 @@
|
||||
// See SetupX_Template.h for all options available
|
||||
#define USER_SETUP_ID 200
|
||||
|
||||
#define GC9A01_DRIVER
|
||||
|
||||
// For ESP32 Dev board (only tested with GC9A01 display)
|
||||
// The hardware SPI can be mapped to any pins
|
||||
|
||||
#define TFT_MOSI 15 // In some display driver board, it might be written as "SDA" and so on.
|
||||
#define TFT_SCLK 14
|
||||
#define TFT_CS 5 // Chip select control pin
|
||||
#define TFT_DC 27 // Data Command control pin
|
||||
#define TFT_RST 33 // Reset pin (could connect to Arduino RESET pin)
|
||||
#define TFT_BL 22 // LED back-light
|
||||
|
||||
|
||||
#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
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
|
||||
//#define SPI_FREQUENCY 80000000
|
||||
#define SPI_FREQUENCY 27000000
|
||||
|
||||
// Optional reduced SPI frequency for reading TFT
|
||||
#define SPI_READ_FREQUENCY 5000000
|
||||
@@ -1,49 +0,0 @@
|
||||
// USER DEFINED SETTINGS
|
||||
// Set driver type, fonts to be loaded, pins used and SPI control method etc.
|
||||
//
|
||||
// See the User_Setup_Select.h file if you wish to be able to define multiple
|
||||
// setups and then easily select which setup file is used by the compiler.
|
||||
//
|
||||
// If this file is edited correctly then all the library example sketches should
|
||||
// run without the need to make any more changes for a particular hardware setup!
|
||||
// Note that some sketches are designed for a particular TFT pixel width/height
|
||||
#define USER_SETUP_ID 201
|
||||
|
||||
// User defined setup
|
||||
#define ST7796_DRIVER
|
||||
|
||||
#define TFT_WIDTH 480
|
||||
#define TFT_HEIGHT 320
|
||||
|
||||
#define TFT_BACKLIGHT_ON HIGH
|
||||
|
||||
#define USE_HSPI_PORT
|
||||
|
||||
#define TFT_MISO 12
|
||||
#define TFT_MOSI 13
|
||||
#define TFT_SCLK 14
|
||||
#define TFT_CS 15
|
||||
#define TFT_DC 21
|
||||
#define TFT_RST 22
|
||||
#define TFT_BL 23
|
||||
|
||||
|
||||
#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
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
// SPI frequency for TFT writes
|
||||
// #define SPI_FREQUENCY 10000000
|
||||
// #define SPI_FREQUENCY 20000000
|
||||
#define SPI_FREQUENCY 27000000
|
||||
// #define SPI_FREQUENCY 40000000
|
||||
// #define SPI_FREQUENCY 80000000
|
||||
|
||||
// Optional reduced SPI frequency for reading TFT
|
||||
#define SPI_READ_FREQUENCY 20000000
|
||||
@@ -1,52 +0,0 @@
|
||||
// See SetupX_Template.h for all options available
|
||||
#define USER_SETUP_ID 202
|
||||
|
||||
#define SSD1351_DRIVER
|
||||
|
||||
|
||||
#define TFT_WIDTH 128
|
||||
#define TFT_HEIGHT 128
|
||||
|
||||
|
||||
#define SSD1351_1DOT5_INCH_128 // For 128 x 128 display
|
||||
|
||||
// Wiring:
|
||||
// +-------------+------------+-------------------------------------------------------------------+
|
||||
// | Display PCB | TFT_eSPI | Info |
|
||||
// +-------------+------------+-------------------------------------------------------------------+
|
||||
// | GND | GND (0V) | Common |
|
||||
// | VCC | 5V or 3.3V | Better to power with 5V if display PCB supports it |
|
||||
// | DIN | TFT_MOSI | SPI data |
|
||||
// | SCK | TFT_SCLK | SPI clock |
|
||||
// | DC | TFT_DC | Distinguish between a command or its data |
|
||||
// | RST | TFT_RST | Hardware reset, can connect to MCU RST pin as well |
|
||||
// | CS | TFT_CS | Chip select, Set to -1 if for manually use with multiple displays |
|
||||
// +-------------+------------+-------------------------------------------------------------------+
|
||||
#if defined(ESP32)
|
||||
#define TFT_MOSI 23
|
||||
#define TFT_SCLK 18
|
||||
#define TFT_DC 2
|
||||
#define TFT_RST 4
|
||||
#define TFT_CS 15
|
||||
#elif defined (ARDUINO_ARCH_ESP8266)
|
||||
//#define TFT_MOSI PIN_D5 // Can't change
|
||||
//#define TFT_SCLK PIN_D7 // Can't change
|
||||
#define TFT_DC PIN_D3
|
||||
#define TFT_RST PIN_D4
|
||||
#define TFT_CS PIN_D8
|
||||
#endif
|
||||
|
||||
|
||||
#define LOAD_GLCD // Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
|
||||
#define LOAD_FONT2 // Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
|
||||
#define LOAD_FONT4 // Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
|
||||
#define LOAD_FONT6 // Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
|
||||
#define LOAD_FONT7 // 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:.
|
||||
#define LOAD_FONT8 // Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
|
||||
//#define LOAD_FONT8N // Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
|
||||
#define LOAD_GFXFF // FreeFonts- 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
|
||||
#define SMOOTH_FONT
|
||||
|
||||
|
||||
#define SPI_FREQUENCY 20000000
|
||||
//#define SPI_FREQUENCY 40000000 // Works after shielding the wires!
|
||||
@@ -1,57 +0,0 @@
|
||||
// ST7789 240 x 280 display with no chip select line
|
||||
#define USER_SETUP_ID 203
|
||||
|
||||
#define ST7789_DRIVER // Configure all registers
|
||||
|
||||
#define TFT_WIDTH 240
|
||||
#define TFT_HEIGHT 280
|
||||
|
||||
#define CGRAM_OFFSET // Library will add offsets required
|
||||
|
||||
//#define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
|
||||
//#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red
|
||||
|
||||
//#define TFT_INVERSION_ON
|
||||
//#define TFT_INVERSION_OFF
|
||||
|
||||
// DSTIKE stepup
|
||||
//#define TFT_DC 23
|
||||
//#define TFT_RST 32
|
||||
//#define TFT_MOSI 26
|
||||
//#define TFT_SCLK 27
|
||||
|
||||
// Generic ESP32 setup
|
||||
//#define TFT_MISO 19
|
||||
//#define TFT_MOSI 23
|
||||
//#define TFT_SCLK 18
|
||||
//#define TFT_CS -1 // Not connected
|
||||
//#define TFT_DC 2
|
||||
//#define TFT_RST 4 // Connect reset to ensure display initialises
|
||||
|
||||
// For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation
|
||||
#define TFT_CS -1 // Define as not used
|
||||
#define TFT_DC PIN_D1 // Data Command control pin
|
||||
//#define TFT_RST PIN_D4 // TFT reset pin (could connect to NodeMCU RST, see next line)
|
||||
#define TFT_RST -1 // TFT reset pin connect to NodeMCU RST, must also then add 10K pull down to TFT 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_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
|
||||
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
|
||||
// #define SPI_FREQUENCY 27000000
|
||||
#define SPI_FREQUENCY 40000000
|
||||
|
||||
#define SPI_READ_FREQUENCY 20000000
|
||||
|
||||
#define SPI_TOUCH_FREQUENCY 2500000
|
||||
|
||||
// #define SUPPORT_TRANSACTIONS
|
||||
@@ -1,32 +0,0 @@
|
||||
// User Setup for the ESP32 TouchDown V1.0 and V1.1
|
||||
// ILI9488 using 4-wire SPI and using an FT6206 touch controller
|
||||
|
||||
#define USER_SETUP_ID 204
|
||||
|
||||
#define ILI9488_DRIVER
|
||||
|
||||
#define TFT_BL 32
|
||||
#define TFT_BACKLIGHT_ON HIGH
|
||||
|
||||
#define TFT_MISO 19
|
||||
#define TFT_MOSI 23
|
||||
#define TFT_SCLK 18
|
||||
#define TFT_CS 15
|
||||
#define TFT_DC 2
|
||||
#define TFT_RST 4
|
||||
|
||||
#define TOUCH_CS 21
|
||||
|
||||
#define LOAD_GLCD
|
||||
#define LOAD_FONT2
|
||||
#define LOAD_FONT4
|
||||
#define LOAD_FONT6
|
||||
#define LOAD_FONT7
|
||||
#define LOAD_FONT8
|
||||
#define LOAD_GFXFF
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
#define SPI_FREQUENCY 27000000
|
||||
#define SPI_READ_FREQUENCY 20000000
|
||||
#define SPI_TOUCH_FREQUENCY 2500000
|
||||
@@ -1,36 +0,0 @@
|
||||
// User Setup for the ESP32 TouchDown S3 V1.1
|
||||
// ILI9488 using 8-bit Parallel and using an FT6206 touch controller
|
||||
|
||||
#define USER_SETUP_ID 205
|
||||
|
||||
#define ESP32_PARALLEL
|
||||
|
||||
#define ILI9488_DRIVER
|
||||
|
||||
#define TFT_DC 5
|
||||
#define TFT_RST 46
|
||||
|
||||
#define TFT_WR 7
|
||||
#define TFT_RD 6
|
||||
|
||||
#define TFT_D0 21
|
||||
#define TFT_D1 14
|
||||
#define TFT_D2 13
|
||||
#define TFT_D3 12
|
||||
#define TFT_D4 11
|
||||
#define TFT_D5 10
|
||||
#define TFT_D6 9
|
||||
#define TFT_D7 8
|
||||
|
||||
#define TFT_BL 48
|
||||
#define TFT_BACKLIGHT_ON HIGH
|
||||
|
||||
#define LOAD_GLCD
|
||||
#define LOAD_FONT2
|
||||
#define LOAD_FONT4
|
||||
#define LOAD_FONT6
|
||||
#define LOAD_FONT7
|
||||
#define LOAD_FONT8
|
||||
#define LOAD_GFXFF
|
||||
|
||||
#define SMOOTH_FONT
|
||||
@@ -1,47 +0,0 @@
|
||||
// ST7789 using 8-bit Parallel
|
||||
|
||||
#define USER_SETUP_ID 206
|
||||
|
||||
#define ST7789_DRIVER
|
||||
#define INIT_SEQUENCE_3 // Using this initialisation sequence improves the display image
|
||||
|
||||
#define CGRAM_OFFSET
|
||||
#define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
|
||||
//#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red
|
||||
|
||||
#define TFT_INVERSION_ON
|
||||
// #define TFT_INVERSION_OFF
|
||||
|
||||
#define TFT_PARALLEL_8_BIT
|
||||
|
||||
#define TFT_WIDTH 170
|
||||
#define TFT_HEIGHT 320
|
||||
|
||||
#define TFT_CS 6
|
||||
#define TFT_DC 7
|
||||
#define TFT_RST 5
|
||||
|
||||
#define TFT_WR 8
|
||||
#define TFT_RD 9
|
||||
|
||||
#define TFT_D0 39
|
||||
#define TFT_D1 40
|
||||
#define TFT_D2 41
|
||||
#define TFT_D3 42
|
||||
#define TFT_D4 45
|
||||
#define TFT_D5 46
|
||||
#define TFT_D6 47
|
||||
#define TFT_D7 48
|
||||
|
||||
#define TFT_BL 38
|
||||
#define TFT_BACKLIGHT_ON HIGH
|
||||
|
||||
#define LOAD_GLCD
|
||||
#define LOAD_FONT2
|
||||
#define LOAD_FONT4
|
||||
#define LOAD_FONT6
|
||||
#define LOAD_FONT7
|
||||
#define LOAD_FONT8
|
||||
#define LOAD_GFXFF
|
||||
|
||||
#define SMOOTH_FONT
|
||||
@@ -1,48 +0,0 @@
|
||||
// ST7789 240 x 240 display with no chip select line
|
||||
#define USER_SETUP_ID 207
|
||||
|
||||
#define ST7789_DRIVER // Configure all registers
|
||||
|
||||
// #define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red
|
||||
|
||||
#define TFT_WIDTH 240
|
||||
#define TFT_HEIGHT 320
|
||||
|
||||
#define CGRAM_OFFSET
|
||||
// #define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
|
||||
#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red
|
||||
|
||||
// #define TFT_INVERSION_ON
|
||||
#define TFT_INVERSION_OFF
|
||||
|
||||
#define TFT_PARALLEL_8_BIT
|
||||
|
||||
// The ESP32 and TFT the pins used for testing are:
|
||||
#define TFT_CS 6 // Chip select control pin (library pulls permanently low
|
||||
#define TFT_DC 7 // Data Command control pin
|
||||
#define TFT_RST -1 // Reset pin, toggles on startup
|
||||
|
||||
#define TFT_WR 8 // Write strobe control pin
|
||||
#define TFT_RD -1 // Read strobe control pin
|
||||
|
||||
#define TFT_D0 48 // Must use pins in the range 0-31 or alternatively 32-48
|
||||
#define TFT_D1 47 // so a single register write sets/clears all bits.
|
||||
#define TFT_D2 39 // Pins can be randomly assigned, this does not affect
|
||||
#define TFT_D3 40 // TFT screen update performance.
|
||||
#define TFT_D4 41
|
||||
#define TFT_D5 42
|
||||
#define TFT_D6 45
|
||||
#define TFT_D7 46
|
||||
|
||||
#define TFT_BL 38 // LED back-light
|
||||
|
||||
#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_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
|
||||
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
|
||||
|
||||
#define SMOOTH_FONT
|
||||
@@ -1,52 +0,0 @@
|
||||
// Config for LilyGo T-Dongle S3 w ESP32 and ST7735 80 x 160 display
|
||||
#define USER_SETUP_ID 209
|
||||
|
||||
#define ST7735_DRIVER // Configure all registers
|
||||
|
||||
#define TFT_WIDTH 80
|
||||
#define TFT_HEIGHT 160
|
||||
|
||||
// #define ST7735_INITB
|
||||
// #define ST7735_GREENTAB
|
||||
// #define ST7735_GREENTAB2
|
||||
// #define ST7735_GREENTAB3
|
||||
// #define ST7735_GREENTAB128 // For 128 x 128 display
|
||||
#define ST7735_GREENTAB160x80 // For 160 x 80 display (BGR, inverted, 26 offset)
|
||||
// #define ST7735_REDTAB
|
||||
//#define ST7735_BLACKTAB
|
||||
// #define ST7735_REDTAB160x80 // For 160 x 80 display with 24 pixel offset
|
||||
|
||||
//#define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
|
||||
#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red
|
||||
|
||||
//#define TFT_INVERSION_ON
|
||||
//#define TFT_INVERSION_OFF
|
||||
|
||||
// Generic ESP32 setup
|
||||
#define TFT_MISO -1
|
||||
#define TFT_MOSI 3
|
||||
#define TFT_SCLK 5
|
||||
#define TFT_CS 4
|
||||
#define TFT_DC 2
|
||||
#define TFT_RST 1 // Connect reset to ensure display initialises
|
||||
|
||||
#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_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
|
||||
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
|
||||
#define SPI_FREQUENCY 27000000
|
||||
//#define SPI_FREQUENCY 40000000
|
||||
|
||||
#define SPI_READ_FREQUENCY 20000000
|
||||
|
||||
#define SPI_TOUCH_FREQUENCY 2500000
|
||||
|
||||
// #define SUPPORT_TRANSACTIONS
|
||||
@@ -1,33 +0,0 @@
|
||||
// See SetupX_Template.h for all options available
|
||||
#define USER_SETUP_ID 20
|
||||
|
||||
#define ILI9488_DRIVER
|
||||
|
||||
|
||||
// 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_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
|
||||
|
||||
|
||||
#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
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
|
||||
// #define SPI_FREQUENCY 20000000
|
||||
#define SPI_FREQUENCY 27000000
|
||||
// #define SPI_FREQUENCY 40000000
|
||||
|
||||
|
||||
#define SPI_TOUCH_FREQUENCY 2500000
|
||||
|
||||
|
||||
// #define SUPPORT_TRANSACTIONS
|
||||
@@ -1,43 +0,0 @@
|
||||
// ST7789 170 x 320 display with no chip select line
|
||||
#define USER_SETUP_ID 210
|
||||
|
||||
#define ST7789_DRIVER // Configure all registers
|
||||
|
||||
#define TFT_WIDTH 170
|
||||
#define TFT_HEIGHT 320
|
||||
|
||||
//#define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
|
||||
//#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red
|
||||
|
||||
#define TFT_INVERSION_ON
|
||||
//#define TFT_INVERSION_OFF
|
||||
#define TFT_BACKLIGHT_ON 1
|
||||
|
||||
#define TFT_BL 15 // LED back-light
|
||||
#define TFT_MISO -1 // Not connected
|
||||
#define TFT_MOSI 11
|
||||
#define TFT_SCLK 12
|
||||
#define TFT_CS 10
|
||||
#define TFT_DC 13
|
||||
#define TFT_RST 9 // Connect reset to ensure display initialises
|
||||
|
||||
#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_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
|
||||
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
|
||||
// #define SPI_FREQUENCY 27000000
|
||||
#define SPI_FREQUENCY 40000000
|
||||
|
||||
#define SPI_READ_FREQUENCY 20000000
|
||||
|
||||
#define SPI_TOUCH_FREQUENCY 2500000
|
||||
|
||||
// #define SUPPORT_TRANSACTIONS
|
||||
@@ -1,45 +0,0 @@
|
||||
// GC9A01 128 x 128 display with no chip select line
|
||||
#define USER_SETUP_ID 211
|
||||
|
||||
#define GC9A01_DRIVER // Configure all registers
|
||||
|
||||
#define TFT_WIDTH 128
|
||||
#define TFT_HEIGHT 128
|
||||
|
||||
// #define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
|
||||
//#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red
|
||||
|
||||
// #define TFT_INVERSION_ON
|
||||
//#define TFT_INVERSION_OFF
|
||||
#define TFT_BACKLIGHT_ON 0
|
||||
#define CGRAM_OFFSET
|
||||
|
||||
|
||||
#define TFT_BL 10 // LED back-light
|
||||
#define TFT_MISO -1 // Not connected
|
||||
#define TFT_MOSI 2
|
||||
#define TFT_SCLK 3
|
||||
#define TFT_CS 5
|
||||
#define TFT_DC 6
|
||||
#define TFT_RST 1 // Connect reset to ensure display initialises
|
||||
|
||||
#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_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
|
||||
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
|
||||
// #define SPI_FREQUENCY 27000000
|
||||
#define SPI_FREQUENCY 40000000
|
||||
|
||||
#define SPI_READ_FREQUENCY 20000000
|
||||
|
||||
#define SPI_TOUCH_FREQUENCY 2500000
|
||||
|
||||
// #define SUPPORT_TRANSACTIONS
|
||||
@@ -1,45 +0,0 @@
|
||||
// ST7796 222 x 480 display with no chip select line
|
||||
#define USER_SETUP_ID 212
|
||||
|
||||
#define ST7796_DRIVER // Configure all registers
|
||||
|
||||
#define TFT_WIDTH 222
|
||||
#define TFT_HEIGHT 480
|
||||
|
||||
#define CGRAM_OFFSET // Library will add offsets required
|
||||
|
||||
// #define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
|
||||
#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red
|
||||
|
||||
#define TFT_INVERSION_ON
|
||||
|
||||
#define TFT_MISO 4
|
||||
#define TFT_MOSI 7
|
||||
#define TFT_SCLK 6
|
||||
#define TFT_CS 8
|
||||
#define TFT_DC 9
|
||||
#define TFT_RST 16
|
||||
#define TFT_BACKLIGHT_ON 1
|
||||
#define TFT_BL 10
|
||||
|
||||
|
||||
#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_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
|
||||
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
|
||||
|
||||
#define SMOOTH_FONT
|
||||
|
||||
|
||||
// #define SPI_FREQUENCY 27000000
|
||||
#define SPI_FREQUENCY 40000000
|
||||
|
||||
#define SPI_READ_FREQUENCY 20000000
|
||||
|
||||
#define SPI_TOUCH_FREQUENCY 2500000
|
||||
|
||||
// #define SUPPORT_TRANSACTIONS
|
||||
@@ -1,36 +0,0 @@
|
||||
// ST7796 222 x 480 display with no chip select line
|
||||
#define USER_SETUP_ID 213
|
||||
|
||||
#define ST7796_DRIVER // Configure all registers
|
||||
|
||||
#define TFT_WIDTH 222
|
||||
#define TFT_HEIGHT 480
|
||||
|
||||
#define CGRAM_OFFSET // Library will add offsets required
|
||||
|
||||
// #define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
|
||||
#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red
|
||||
|
||||
#define TFT_INVERSION_ON
|
||||
|
||||
#define TFT_MISO -1
|
||||
#define TFT_MOSI 14
|
||||
#define TFT_SCLK 15
|
||||
#define TFT_CS 25
|
||||
#define TFT_DC 13
|
||||
#define TFT_RST 2
|
||||
#define TFT_BL 4
|
||||
#define TFT_BACKLIGHT_ON HIGH
|
||||
|
||||
|
||||
#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_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
|
||||
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
|
||||
|
||||
#define SMOOTH_FONT
|
||||
#define SPI_FREQUENCY 40000000
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user