From 4feba8a31a9cb6662595c8726b985b7e33b95212 Mon Sep 17 00:00:00 2001 From: prenticedavid Date: Mon, 6 Jun 2016 14:44:32 +0100 Subject: [PATCH] add HX8352-A with ID=0x5252 --- MCUFRIEND_kbv.cpp | 48 +++++++++++++++++++++++++++++++++++++++++++++ mcufriend_shield.h | 2 +- mcufriend_special.h | 4 ++-- 3 files changed, 51 insertions(+), 3 deletions(-) diff --git a/MCUFRIEND_kbv.cpp b/MCUFRIEND_kbv.cpp index 6f1fc24..e47cea1 100644 --- a/MCUFRIEND_kbv.cpp +++ b/MCUFRIEND_kbv.cpp @@ -1214,6 +1214,54 @@ void MCUFRIEND_kbv::begin(uint16_t ID) }; init_table(HX8347G_2_regValues, sizeof(HX8347G_2_regValues)); break; + case 0x5252: //HX8352-A + _lcd_capable = REV_SCREEN | MIPI_DCS_REV1 | MV_AXIS; + is8347 = 1; + static const uint8_t HX8352A_regValues[] PROGMEM = { + 0x83, 1, 0x02, //TESTM=1 + 0x85, 1, 0x03, //VDC_SEL=011 + 0x8B, 2, 0x01, 0x93, //STBA[7]=1,STBA[5:4]=01,STBA[1:0]=11 + 0x91, 1, 0x01, //DCDC_SYNC=1 + 0x83, 1, 0x00, //TESTM=0 + //Gamma Setting + 0x3E, 12, 0xB0, 0x03, 0x10, 0x56, 0x13, 0x46, 0x23, 0x76, 0x00, 0x5E, 0x4F, 0x40, + //Power Voltage Setting + 0x17, 1, 0x91, // + 0x2B, 1, 0xF9, // + TFTLCD_DELAY8, 10, + 0x1B, 1, 0x14, // + 0x1A, 1, 0x11, // + 0x1C, 1, 0x06, // + 0x1F, 1, 0x42, // + TFTLCD_DELAY8, 20, + 0x19, 1, 0x0A, // + 0x19, 1, 0x1A, // + TFTLCD_DELAY8, 40, + 0x19, 1, 0x12, // + TFTLCD_DELAY8, 40, + 0x1E, 1, 0x27, // + TFTLCD_DELAY8, 100, + //Display ON Setting + 0x24, 1, 0x60, // + 0x3D, 1, 0x40, // + 0x34, 1, 0x38, // + 0x35, 1, 0x38, // + 0x24, 1, 0x38, // + TFTLCD_DELAY8, 40, + 0x24, 1, 0x3C, // + 0x16, 1, 0x1C, // + 0x01, 1, 0x06, // + 0x55, 1, 0x00, // + //Set GRAM Area + 0x02, 2, 0x00, 0x00, //Column Start + 0x04, 2, 0x00, 0xEF, //Column End + 0x06, 2, 0x00, 0x00, //Row Start + 0x08, 2, 0x01, 0x8F, //Row End + }; + init_table(HX8352A_regValues, sizeof(HX8352A_regValues)); + p16 = (int16_t *) & HEIGHT; + *p16 = 400; + break; #endif #ifdef SUPPORT_8347A case 0x8347: diff --git a/mcufriend_shield.h b/mcufriend_shield.h index d664ff1..5817f36 100644 --- a/mcufriend_shield.h +++ b/mcufriend_shield.h @@ -1,4 +1,4 @@ -#define USE_SPECIAL //check for custom drivers +//#define USE_SPECIAL //check for custom drivers #if defined(USE_SPECIAL) #include "mcufriend_special.h" #if !defined(USE_SPECIAL_FAIL) diff --git a/mcufriend_special.h b/mcufriend_special.h index d05d66a..6621958 100644 --- a/mcufriend_special.h +++ b/mcufriend_special.h @@ -7,9 +7,9 @@ //#define USE_MEGA_8BIT_SHIELD //#define USE_MEGA_16BIT_SHIELD //RD on PL6 (D43) //#define USE_BLD_BST_MEGA32U4 -//#define USE_BLD_BST_MEGA2560 +#define USE_BLD_BST_MEGA2560 //#define USE_DUE_8BIT_PROTOSHIELD -#define USE_DUE_16BIT_SHIELD //RD on PA15 (D24) +//#define USE_DUE_16BIT_SHIELD //RD on PA15 (D24) #if 0 #elif defined(__AVR_ATmega328P__) && defined(USE_SSD1289_SHIELD_UNO) //on UNO