diff --git a/TFT_Drivers/OTM8009A_Defines.h b/TFT_Drivers/OTM8009A_Defines.h index 0fe8f2f..27aa7f6 100644 --- a/TFT_Drivers/OTM8009A_Defines.h +++ b/TFT_Drivers/OTM8009A_Defines.h @@ -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 */ diff --git a/TFT_Drivers/OTM8009A_Init.h b/TFT_Drivers/OTM8009A_Init.h index 3582e45..af00b75 100644 --- a/TFT_Drivers/OTM8009A_Init.h +++ b/TFT_Drivers/OTM8009A_Init.h @@ -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 */ diff --git a/TFT_Drivers/OTM8009A_Rotation.h b/TFT_Drivers/OTM8009A_Rotation.h index aa5d087..a0e5ae9 100644 --- a/TFT_Drivers/OTM8009A_Rotation.h +++ b/TFT_Drivers/OTM8009A_Rotation.h @@ -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;