OTM8009A update

This commit is contained in:
Mike 2020-07-11 22:38:31 +02:00
parent 40cf9a5111
commit 4147eba7fd
3 changed files with 27 additions and 26 deletions

View File

@ -7,25 +7,25 @@
#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_NOP 0x00
#define TFT_SWRST 0x01
#define TFT_SLPIN 0x1000
#define TFT_SLPOUT 0x1100
#define TFT_SLPIN 0x10
#define TFT_SLPOUT 0x11
#define TFT_INVOFF 0x2000
#define TFT_INVON 0x2100
#define TFT_INVOFF 0x20
#define TFT_INVON 0x21
#define TFT_DISPOFF 0x2800
#define TFT_DISPON 0x2900
#define TFT_DISPOFF 0x28
#define TFT_DISPON 0x29
#define TFT_CASET 0x2A00
#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_MX 0x40 /* Column Address Order */

View File

@ -367,21 +367,22 @@
writecommand16(0x3A00);//ccaa[7:0] : reg setting for signal35 selection with u2d mode
writedata16(0x55);//0x55
// /* Exit CMD2 - new! */
// writecommand16(MCS_CMD2_ENA1);
// writedata16(0xFF);
// writecommand16(MCS_CMD2_ENA1 + 1);
// writedata16(0xFF);
// writecommand16(MCS_CMD2_ENA1 + 2);
// writedata16(0xFF);
/* Exit CMD2 - new! */
writecommand16(MCS_CMD2_ENA1);
writedata16(0xFF);
writecommand16(MCS_CMD2_ENA1 + 1);
writedata16(0xFF);
writecommand16(MCS_CMD2_ENA1 + 2);
writedata16(0xFF);
/* Sleep out */
writecommand16(TFT_SLPOUT);
writecommand(TFT_SLPOUT);
writecommand(TFT_NOP);
delay(100);
/* Display on */
writecommand16(TFT_DISPON);
writecommand(TFT_DISPON);
writecommand(TFT_NOP);
delay(50);
/* Memory Write */

View File

@ -1,25 +1,25 @@
// This is the command sequence that rotates the OTM8009A driver coordinate frame
rotation = m % 4;
writecommand16(TFT_MADCTL);
writecommand(TFT_MADCTL);
switch (rotation) {
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;
_height = TFT_HEIGHT;
break;
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;
_height = TFT_WIDTH;
break;
case 2: // Inverter portrait
writedata16(TFT_MAD_RGB);
writedata(TFT_MAD_RGB);
_width = TFT_WIDTH;
_height = TFT_HEIGHT;
break;
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;
_height = TFT_WIDTH;
break;