OTM8009A update
This commit is contained in:
parent
40cf9a5111
commit
4147eba7fd
|
|
@ -7,25 +7,25 @@
|
||||||
#define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
|
#define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
|
||||||
|
|
||||||
// Generic commands used by TFT_eSPI.cpp
|
// Generic commands used by TFT_eSPI.cpp
|
||||||
#define TFT_NOP 0x0000
|
#define TFT_NOP 0x00
|
||||||
#define TFT_SWRST 0x0100
|
#define TFT_SWRST 0x01
|
||||||
|
|
||||||
#define TFT_SLPIN 0x1000
|
#define TFT_SLPIN 0x10
|
||||||
#define TFT_SLPOUT 0x1100
|
#define TFT_SLPOUT 0x11
|
||||||
|
|
||||||
#define TFT_INVOFF 0x2000
|
#define TFT_INVOFF 0x20
|
||||||
#define TFT_INVON 0x2100
|
#define TFT_INVON 0x21
|
||||||
|
|
||||||
#define TFT_DISPOFF 0x2800
|
#define TFT_DISPOFF 0x28
|
||||||
#define TFT_DISPON 0x2900
|
#define TFT_DISPON 0x29
|
||||||
|
|
||||||
#define TFT_CASET 0x2A00
|
#define TFT_CASET 0x2A00
|
||||||
#define TFT_PASET 0x2B00
|
#define TFT_PASET 0x2B00
|
||||||
#define TFT_RAMWR 0x2C00
|
|
||||||
|
|
||||||
#define TFT_RAMRD 0x2E00
|
#define TFT_RAMWR 0x2C
|
||||||
|
#define TFT_RAMRD 0x2E
|
||||||
|
|
||||||
#define TFT_MADCTL 0x3600
|
#define TFT_MADCTL 0x36
|
||||||
|
|
||||||
#define TFT_MAD_MY 0x80 /* Row Address Order */
|
#define TFT_MAD_MY 0x80 /* Row Address Order */
|
||||||
#define TFT_MAD_MX 0x40 /* Column Address Order */
|
#define TFT_MAD_MX 0x40 /* Column Address Order */
|
||||||
|
|
|
||||||
|
|
@ -367,21 +367,22 @@
|
||||||
writecommand16(0x3A00);//ccaa[7:0] : reg setting for signal35 selection with u2d mode
|
writecommand16(0x3A00);//ccaa[7:0] : reg setting for signal35 selection with u2d mode
|
||||||
writedata16(0x55);//0x55
|
writedata16(0x55);//0x55
|
||||||
|
|
||||||
// /* Exit CMD2 - new! */
|
/* Exit CMD2 - new! */
|
||||||
// writecommand16(MCS_CMD2_ENA1);
|
writecommand16(MCS_CMD2_ENA1);
|
||||||
// writedata16(0xFF);
|
writedata16(0xFF);
|
||||||
// writecommand16(MCS_CMD2_ENA1 + 1);
|
writecommand16(MCS_CMD2_ENA1 + 1);
|
||||||
// writedata16(0xFF);
|
writedata16(0xFF);
|
||||||
// writecommand16(MCS_CMD2_ENA1 + 2);
|
writecommand16(MCS_CMD2_ENA1 + 2);
|
||||||
// writedata16(0xFF);
|
writedata16(0xFF);
|
||||||
|
|
||||||
|
|
||||||
/* Sleep out */
|
/* Sleep out */
|
||||||
writecommand16(TFT_SLPOUT);
|
writecommand(TFT_SLPOUT);
|
||||||
|
writecommand(TFT_NOP);
|
||||||
delay(100);
|
delay(100);
|
||||||
|
|
||||||
/* Display on */
|
/* Display on */
|
||||||
writecommand16(TFT_DISPON);
|
writecommand(TFT_DISPON);
|
||||||
|
writecommand(TFT_NOP);
|
||||||
delay(50);
|
delay(50);
|
||||||
|
|
||||||
/* Memory Write */
|
/* Memory Write */
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,25 @@
|
||||||
// This is the command sequence that rotates the OTM8009A driver coordinate frame
|
// This is the command sequence that rotates the OTM8009A driver coordinate frame
|
||||||
rotation = m % 4;
|
rotation = m % 4;
|
||||||
writecommand16(TFT_MADCTL);
|
writecommand(TFT_MADCTL);
|
||||||
|
|
||||||
switch (rotation) {
|
switch (rotation) {
|
||||||
case 0: // Portrait
|
case 0: // Portrait
|
||||||
writedata16(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_RGB);
|
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_RGB);
|
||||||
_width = TFT_WIDTH;
|
_width = TFT_WIDTH;
|
||||||
_height = TFT_HEIGHT;
|
_height = TFT_HEIGHT;
|
||||||
break;
|
break;
|
||||||
case 1: // Landscape (Portrait + 90)
|
case 1: // Landscape (Portrait + 90)
|
||||||
writedata16(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_RGB);
|
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_RGB);
|
||||||
_width = TFT_HEIGHT;
|
_width = TFT_HEIGHT;
|
||||||
_height = TFT_WIDTH;
|
_height = TFT_WIDTH;
|
||||||
break;
|
break;
|
||||||
case 2: // Inverter portrait
|
case 2: // Inverter portrait
|
||||||
writedata16(TFT_MAD_RGB);
|
writedata(TFT_MAD_RGB);
|
||||||
_width = TFT_WIDTH;
|
_width = TFT_WIDTH;
|
||||||
_height = TFT_HEIGHT;
|
_height = TFT_HEIGHT;
|
||||||
break;
|
break;
|
||||||
case 3: // Inverted landscape
|
case 3: // Inverted landscape
|
||||||
writedata16(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_RGB);
|
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_RGB);
|
||||||
_width = TFT_HEIGHT;
|
_width = TFT_HEIGHT;
|
||||||
_height = TFT_WIDTH;
|
_height = TFT_WIDTH;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue