Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
moononournation committed Jun 13, 2022
1 parent 53658e1 commit 4cb69e5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 48 deletions.
61 changes: 15 additions & 46 deletions src/display/Arduino_ILI9486.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,61 +103,30 @@ void Arduino_ILI9486::tftInit()
DELAY, ILI9486_RST_DELAY,

BEGIN_WRITE,
WRITE_COMMAND_8, ILI9486_DISPOFF,
WRITE_C8_D8, ILI9486_PIXFMT, 0x55, // 16-bit color
WRITE_C8_D8, 0xB0, 0x00, // unlocks E0, F0
WRITE_COMMAND_8, 0xB3,
WRITE_BYTES, 4, 0x02, 0x00, 0x00, 0x00, //Frame Memory, interface [02 00 00 00]
WRITE_C8_D8, 0xB4, 0x00, // Frame mode [00]
// WRITE_COMMAND_8, 0xB6,
// WRITE_BYTES, 3, 0x02, 0x02, 0x3B, // Display Function Control [02 02 3B]
WRITE_COMMAND_8, 0xB6,
WRITE_BYTES, 3, 0x02, 0x42, 0x3B, // Display Function Control [02 02 3B]
WRITE_COMMAND_8, 0xD0,
WRITE_BYTES, 3, 0x07, 0x42, 0x18,
WRITE_COMMAND_8, 0xD1,
WRITE_BYTES, 3, 0x00, 0x07, 0x18,
WRITE_C8_D16, 0xD2, 0x01, 0x02,
WRITE_C8_D16, 0xD3, 0x01, 0x02, // Set Power for Partial Mode [01 22]
WRITE_C8_D16, 0xD4, 0x01, 0x02, // Set Power for Idle Mode [01 22]
// WRITE_COMMAND_8, 0xC0,
// 5, 0x10, 0x3B, 0x00, 0x02, 0x11,
WRITE_COMMAND_8, 0xC0,
WRITE_BYTES, 5, 0x14, 0x3B, 0x00, 0x02, 0x11,
WRITE_COMMAND_8, 0xC1,
WRITE_BYTES, 3, 0x10, 0x10, 0x88, // Display Timing Normal [10 10 88]
WRITE_C8_D8, 0xC5, 0x03, //Frame Rate [03]
WRITE_C8_D8, 0xC6, 0x02, //Interface Control [02]

WRITE_COMMAND_8, 0xC8,
WRITE_BYTES, 12,
0x00, 0x32, 0x36, 0x45, 0x06,
0x16, 0x37, 0x75, 0x77, 0x54,
0x0C, 0x00,

WRITE_C8_D8, 0xCC, 0x00, // Panel Control [00]
WRITE_C8_D8, 0x36, 0x18, // 0x08,

WRITE_COMMAND_8, ILI9486_GMCTRP1,
WRITE_COMMAND_8, ILI9486_SLPOUT,
END_WRITE,

DELAY, ILI9486_SLPOUT_DELAY,

BEGIN_WRITE,
WRITE_C8_D8, ILI9486_PIXFMT, 0x55, // 16 bit colour interface
WRITE_C8_D8, 0xC2, 0x44,
WRITE_COMMAND_8, 0xC5,
WRITE_BYTES, 4, 0x00, 0x00, 0x00, 0x00,
WRITE_COMMAND_8, 0xE0,
WRITE_BYTES, 15,
0x0F, 0x1F, 0x1C, 0x0C, 0x0F,
0x08, 0x48, 0x98, 0x37, 0x0A,
0x13, 0x04, 0x11, 0x0D, 0x00,

WRITE_COMMAND_8, ILI9486_GMCTRN1,
WRITE_COMMAND_8, 0xE1,
WRITE_BYTES, 15,
0x0F, 0x32, 0x2E, 0x0B, 0x0D,
0x05, 0x47, 0x75, 0x37, 0x06,
0x10, 0x03, 0x24, 0x20, 0x00,

WRITE_COMMAND_8, ILI9486_SLPOUT, // Exit Sleep
WRITE_C8_D8, 0x36, 0x48,
WRITE_COMMAND_8, 0x29, // display on
END_WRITE,

DELAY, ILI9486_SLPOUT_DELAY,

BEGIN_WRITE,
WRITE_COMMAND_8, ILI9486_DISPON, // Display on
END_WRITE};
DELAY, ILI9486_SLPOUT_DELAY};

_bus->batchOperation(ili9486_init_operations, sizeof(ili9486_init_operations));

Expand Down
4 changes: 2 additions & 2 deletions src/display/Arduino_ILI9486.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#define ILI9486_TFTWIDTH 320 ///< ILI9486 max TFT width
#define ILI9486_TFTHEIGHT 480 ///< ILI9486 max TFT height

#define ILI9486_RST_DELAY 150 ///< delay ms wait for reset finish
#define ILI9486_SLPIN_DELAY 150 ///< delay ms wait for sleep in finish
#define ILI9486_RST_DELAY 120 ///< delay ms wait for reset finish
#define ILI9486_SLPIN_DELAY 120 ///< delay ms wait for sleep in finish
#define ILI9486_SLPOUT_DELAY 150 ///< delay ms wait for sleep out finish

#define ILI9486_NOP 0x00 ///< No-op register
Expand Down

0 comments on commit 4cb69e5

Please sign in to comment.