FASTRUN void RM68120_t41_p::sendCmd16Arg8 (const uint16_t cmd, const uint8_t arg)
{
uint16_t arg16[2] = {arg, 0};
SglBeatWR_nPrm_16(cmd, arg16, 1);
}
FASTRUN void RM68120_t41_p::sendCmd16 (const uint16_t cmd)
{
SglBeatWR_nPrm_16(cmd, 0, 0);
}
sendCmd16(0x0100); // Software Reset
delay(120);
sendCmd16Arg8(0xF000, 0x55);
sendCmd16Arg8(0xF001, 0xAA);
sendCmd16Arg8(0xF002, 0x52);
sendCmd16Arg8(0xF003, 0x08);
sendCmd16Arg8(0xF004, 0x01);
//GAMMA SETING RED
sendCmd16Arg8(0xD100, 0x00);
sendCmd16Arg8(0xD101, 0x00);
sendCmd16Arg8(0xD102, 0x1b);
sendCmd16Arg8(0xD103, 0x44);
sendCmd16Arg8(0xD104, 0x62);
sendCmd16Arg8(0xD105, 0x00);
sendCmd16Arg8(0xD106, 0x7b);
sendCmd16Arg8(0xD107, 0xa1);
sendCmd16Arg8(0xD108, 0xc0);
sendCmd16Arg8(0xD109, 0xee);
sendCmd16Arg8(0xD10A, 0x55);
sendCmd16Arg8(0xD10B, 0x10);
sendCmd16Arg8(0xD10C, 0x2c);
sendCmd16Arg8(0xD10D, 0x43);
sendCmd16Arg8(0xD10E, 0x57);
sendCmd16Arg8(0xD10F, 0x55);
sendCmd16Arg8(0xD110, 0x68);
sendCmd16Arg8(0xD111, 0x78);
sendCmd16Arg8(0xD112, 0x87);
sendCmd16Arg8(0xD113, 0x94);
sendCmd16Arg8(0xD114, 0x55);
sendCmd16Arg8(0xD115, 0xa0);
sendCmd16Arg8(0xD116, 0xac);
sendCmd16Arg8(0xD117, 0xb6);
sendCmd16Arg8(0xD118, 0xc1);
sendCmd16Arg8(0xD119, 0x55);
sendCmd16Arg8(0xD11A, 0xcb);
sendCmd16Arg8(0xD11B, 0xcd);
sendCmd16Arg8(0xD11C, 0xd6);
sendCmd16Arg8(0xD11D, 0xdf);
sendCmd16Arg8(0xD11E, 0x95);
sendCmd16Arg8(0xD11F, 0xe8);
sendCmd16Arg8(0xD120, 0xf1);
sendCmd16Arg8(0xD121, 0xfa);
sendCmd16Arg8(0xD122, 0x02);
sendCmd16Arg8(0xD123, 0xaa);
sendCmd16Arg8(0xD124, 0x0b);
sendCmd16Arg8(0xD125, 0x13);
sendCmd16Arg8(0xD126, 0x1d);
sendCmd16Arg8(0xD127, 0x26);
sendCmd16Arg8(0xD128, 0xaa);
sendCmd16Arg8(0xD129, 0x30);
sendCmd16Arg8(0xD12A, 0x3c);
sendCmd16Arg8(0xD12B, 0x4A);
sendCmd16Arg8(0xD12C, 0x63);
sendCmd16Arg8(0xD12D, 0xea);
sendCmd16Arg8(0xD12E, 0x79);
sendCmd16Arg8(0xD12F, 0xa6);
sendCmd16Arg8(0xD130, 0xd0);
sendCmd16Arg8(0xD131, 0x20);
sendCmd16Arg8(0xD132, 0x0f);
sendCmd16Arg8(0xD133, 0x8e);
sendCmd16Arg8(0xD134, 0xff);
//GAMMA SETING GREEN
sendCmd16Arg8(0xD200, 0x00);
sendCmd16Arg8(0xD201, 0x00);
sendCmd16Arg8(0xD202, 0x1b);
sendCmd16Arg8(0xD203, 0x44);
sendCmd16Arg8(0xD204, 0x62);
sendCmd16Arg8(0xD205, 0x00);
sendCmd16Arg8(0xD206, 0x7b);
sendCmd16Arg8(0xD207, 0xa1);
sendCmd16Arg8(0xD208, 0xc0);
sendCmd16Arg8(0xD209, 0xee);
sendCmd16Arg8(0xD20A, 0x55);
sendCmd16Arg8(0xD20B, 0x10);
sendCmd16Arg8(0xD20C, 0x2c);
sendCmd16Arg8(0xD20D, 0x43);
sendCmd16Arg8(0xD20E, 0x57);
sendCmd16Arg8(0xD20F, 0x55);
sendCmd16Arg8(0xD210, 0x68);
sendCmd16Arg8(0xD211, 0x78);
sendCmd16Arg8(0xD212, 0x87);
sendCmd16Arg8(0xD213, 0x94);
sendCmd16Arg8(0xD214, 0x55);
sendCmd16Arg8(0xD215, 0xa0);
sendCmd16Arg8(0xD216, 0xac);
sendCmd16Arg8(0xD217, 0xb6);
sendCmd16Arg8(0xD218, 0xc1);
sendCmd16Arg8(0xD219, 0x55);
sendCmd16Arg8(0xD21A, 0xcb);
sendCmd16Arg8(0xD21B, 0xcd);
sendCmd16Arg8(0xD21C, 0xd6);
sendCmd16Arg8(0xD21D, 0xdf);
sendCmd16Arg8(0xD21E, 0x95);
sendCmd16Arg8(0xD21F, 0xe8);
sendCmd16Arg8(0xD220, 0xf1);
sendCmd16Arg8(0xD221, 0xfa);
sendCmd16Arg8(0xD222, 0x02);
sendCmd16Arg8(0xD223, 0xaa);
sendCmd16Arg8(0xD224, 0x0b);
sendCmd16Arg8(0xD225, 0x13);
sendCmd16Arg8(0xD226, 0x1d);
sendCmd16Arg8(0xD227, 0x26);
sendCmd16Arg8(0xD228, 0xaa);
sendCmd16Arg8(0xD229, 0x30);
sendCmd16Arg8(0xD22A, 0x3c);
sendCmd16Arg8(0xD22B, 0x4a);
sendCmd16Arg8(0xD22C, 0x63);
sendCmd16Arg8(0xD22D, 0xea);
sendCmd16Arg8(0xD22E, 0x79);
sendCmd16Arg8(0xD22F, 0xa6);
sendCmd16Arg8(0xD230, 0xd0);
sendCmd16Arg8(0xD231, 0x20);
sendCmd16Arg8(0xD232, 0x0f);
sendCmd16Arg8(0xD233, 0x8e);
sendCmd16Arg8(0xD234, 0xff);
//GAMMA SETING BLUE
sendCmd16Arg8(0xD300, 0x00);
sendCmd16Arg8(0xD301, 0x00);
sendCmd16Arg8(0xD302, 0x1b);
sendCmd16Arg8(0xD303, 0x44);
sendCmd16Arg8(0xD304, 0x62);
sendCmd16Arg8(0xD305, 0x00);
sendCmd16Arg8(0xD306, 0x7b);
sendCmd16Arg8(0xD307, 0xa1);
sendCmd16Arg8(0xD308, 0xc0);
sendCmd16Arg8(0xD309, 0xee);
sendCmd16Arg8(0xD30A, 0x55);
sendCmd16Arg8(0xD30B, 0x10);
sendCmd16Arg8(0xD30C, 0x2c);
sendCmd16Arg8(0xD30D, 0x43);
sendCmd16Arg8(0xD30E, 0x57);
sendCmd16Arg8(0xD30F, 0x55);
sendCmd16Arg8(0xD310, 0x68);
sendCmd16Arg8(0xD311, 0x78);
sendCmd16Arg8(0xD312, 0x87);
sendCmd16Arg8(0xD313, 0x94);
sendCmd16Arg8(0xD314, 0x55);
sendCmd16Arg8(0xD315, 0xa0);
sendCmd16Arg8(0xD316, 0xac);
sendCmd16Arg8(0xD317, 0xb6);
sendCmd16Arg8(0xD318, 0xc1);
sendCmd16Arg8(0xD319, 0x55);
sendCmd16Arg8(0xD31A, 0xcb);
sendCmd16Arg8(0xD31B, 0xcd);
sendCmd16Arg8(0xD31C, 0xd6);
sendCmd16Arg8(0xD31D, 0xdf);
sendCmd16Arg8(0xD31E, 0x95);
sendCmd16Arg8(0xD31F, 0xe8);
sendCmd16Arg8(0xD320, 0xf1);
sendCmd16Arg8(0xD321, 0xfa);
sendCmd16Arg8(0xD322, 0x02);
sendCmd16Arg8(0xD323, 0xaa);
sendCmd16Arg8(0xD324, 0x0b);
sendCmd16Arg8(0xD325, 0x13);
sendCmd16Arg8(0xD326, 0x1d);
sendCmd16Arg8(0xD327, 0x26);
sendCmd16Arg8(0xD328, 0xaa);
sendCmd16Arg8(0xD329, 0x30);
sendCmd16Arg8(0xD32A, 0x3c);
sendCmd16Arg8(0xD32B, 0x4A);
sendCmd16Arg8(0xD32C, 0x63);
sendCmd16Arg8(0xD32D, 0xea);
sendCmd16Arg8(0xD32E, 0x79);
sendCmd16Arg8(0xD32F, 0xa6);
sendCmd16Arg8(0xD330, 0xd0);
sendCmd16Arg8(0xD331, 0x20);
sendCmd16Arg8(0xD332, 0x0f);
sendCmd16Arg8(0xD333, 0x8e);
sendCmd16Arg8(0xD334, 0xff);
//GAMMA SETING RED
sendCmd16Arg8(0xD400, 0x00);
sendCmd16Arg8(0xD401, 0x00);
sendCmd16Arg8(0xD402, 0x1b);
sendCmd16Arg8(0xD403, 0x44);
sendCmd16Arg8(0xD404, 0x62);
sendCmd16Arg8(0xD405, 0x00);
sendCmd16Arg8(0xD406, 0x7b);
sendCmd16Arg8(0xD407, 0xa1);
sendCmd16Arg8(0xD408, 0xc0);
sendCmd16Arg8(0xD409, 0xee);
sendCmd16Arg8(0xD40A, 0x55);
sendCmd16Arg8(0xD40B, 0x10);
sendCmd16Arg8(0xD40C, 0x2c);
sendCmd16Arg8(0xD40D, 0x43);
sendCmd16Arg8(0xD40E, 0x57);
sendCmd16Arg8(0xD40F, 0x55);
sendCmd16Arg8(0xD410, 0x68);
sendCmd16Arg8(0xD411, 0x78);
sendCmd16Arg8(0xD412, 0x87);
sendCmd16Arg8(0xD413, 0x94);
sendCmd16Arg8(0xD414, 0x55);
sendCmd16Arg8(0xD415, 0xa0);
sendCmd16Arg8(0xD416, 0xac);
sendCmd16Arg8(0xD417, 0xb6);
sendCmd16Arg8(0xD418, 0xc1);
sendCmd16Arg8(0xD419, 0x55);
sendCmd16Arg8(0xD41A, 0xcb);
sendCmd16Arg8(0xD41B, 0xcd);
sendCmd16Arg8(0xD41C, 0xd6);
sendCmd16Arg8(0xD41D, 0xdf);
sendCmd16Arg8(0xD41E, 0x95);
sendCmd16Arg8(0xD41F, 0xe8);
sendCmd16Arg8(0xD420, 0xf1);
sendCmd16Arg8(0xD421, 0xfa);
sendCmd16Arg8(0xD422, 0x02);
sendCmd16Arg8(0xD423, 0xaa);
sendCmd16Arg8(0xD424, 0x0b);
sendCmd16Arg8(0xD425, 0x13);
sendCmd16Arg8(0xD426, 0x1d);
sendCmd16Arg8(0xD427, 0x26);
sendCmd16Arg8(0xD428, 0xaa);
sendCmd16Arg8(0xD429, 0x30);
sendCmd16Arg8(0xD42A, 0x3c);
sendCmd16Arg8(0xD42B, 0x4A);
sendCmd16Arg8(0xD42C, 0x63);
sendCmd16Arg8(0xD42D, 0xea);
sendCmd16Arg8(0xD42E, 0x79);
sendCmd16Arg8(0xD42F, 0xa6);
sendCmd16Arg8(0xD430, 0xd0);
sendCmd16Arg8(0xD431, 0x20);
sendCmd16Arg8(0xD432, 0x0f);
sendCmd16Arg8(0xD433, 0x8e);
sendCmd16Arg8(0xD434, 0xff);
//GAMMA SETING GREEN
sendCmd16Arg8(0xD500, 0x00);
sendCmd16Arg8(0xD501, 0x00);
sendCmd16Arg8(0xD502, 0x1b);
sendCmd16Arg8(0xD503, 0x44);
sendCmd16Arg8(0xD504, 0x62);
sendCmd16Arg8(0xD505, 0x00);
sendCmd16Arg8(0xD506, 0x7b);
sendCmd16Arg8(0xD507, 0xa1);
sendCmd16Arg8(0xD508, 0xc0);
sendCmd16Arg8(0xD509, 0xee);
sendCmd16Arg8(0xD50A, 0x55);
sendCmd16Arg8(0xD50B, 0x10);
sendCmd16Arg8(0xD50C, 0x2c);
sendCmd16Arg8(0xD50D, 0x43);
sendCmd16Arg8(0xD50E, 0x57);
sendCmd16Arg8(0xD50F, 0x55);
sendCmd16Arg8(0xD510, 0x68);
sendCmd16Arg8(0xD511, 0x78);
sendCmd16Arg8(0xD512, 0x87);
sendCmd16Arg8(0xD513, 0x94);
sendCmd16Arg8(0xD514, 0x55);
sendCmd16Arg8(0xD515, 0xa0);
sendCmd16Arg8(0xD516, 0xac);
sendCmd16Arg8(0xD517, 0xb6);
sendCmd16Arg8(0xD518, 0xc1);
sendCmd16Arg8(0xD519, 0x55);
sendCmd16Arg8(0xD51A, 0xcb);
sendCmd16Arg8(0xD51B, 0xcd);
sendCmd16Arg8(0xD51C, 0xd6);
sendCmd16Arg8(0xD51D, 0xdf);
sendCmd16Arg8(0xD51E, 0x95);
sendCmd16Arg8(0xD51F, 0xe8);
sendCmd16Arg8(0xD520, 0xf1);
sendCmd16Arg8(0xD521, 0xfa);
sendCmd16Arg8(0xD522, 0x02);
sendCmd16Arg8(0xD523, 0xaa);
sendCmd16Arg8(0xD524, 0x0b);
sendCmd16Arg8(0xD525, 0x13);
sendCmd16Arg8(0xD526, 0x1d);
sendCmd16Arg8(0xD527, 0x26);
sendCmd16Arg8(0xD528, 0xaa);
sendCmd16Arg8(0xD529, 0x30);
sendCmd16Arg8(0xD52A, 0x3c);
sendCmd16Arg8(0xD52B, 0x4a);
sendCmd16Arg8(0xD52C, 0x63);
sendCmd16Arg8(0xD52D, 0xea);
sendCmd16Arg8(0xD52E, 0x79);
sendCmd16Arg8(0xD52F, 0xa6);
sendCmd16Arg8(0xD530, 0xd0);
sendCmd16Arg8(0xD531, 0x20);
sendCmd16Arg8(0xD532, 0x0f);
sendCmd16Arg8(0xD533, 0x8e);
sendCmd16Arg8(0xD534, 0xff);
//GAMMA SETING BLUE
sendCmd16Arg8(0xD600, 0x00);
sendCmd16Arg8(0xD601, 0x00);
sendCmd16Arg8(0xD602, 0x1b);
sendCmd16Arg8(0xD603, 0x44);
sendCmd16Arg8(0xD604, 0x62);
sendCmd16Arg8(0xD605, 0x00);
sendCmd16Arg8(0xD606, 0x7b);
sendCmd16Arg8(0xD607, 0xa1);
sendCmd16Arg8(0xD608, 0xc0);
sendCmd16Arg8(0xD609, 0xee);
sendCmd16Arg8(0xD60A, 0x55);
sendCmd16Arg8(0xD60B, 0x10);
sendCmd16Arg8(0xD60C, 0x2c);
sendCmd16Arg8(0xD60D, 0x43);
sendCmd16Arg8(0xD60E, 0x57);
sendCmd16Arg8(0xD60F, 0x55);
sendCmd16Arg8(0xD610, 0x68);
sendCmd16Arg8(0xD611, 0x78);
sendCmd16Arg8(0xD612, 0x87);
sendCmd16Arg8(0xD613, 0x94);
sendCmd16Arg8(0xD614, 0x55);
sendCmd16Arg8(0xD615, 0xa0);
sendCmd16Arg8(0xD616, 0xac);
sendCmd16Arg8(0xD617, 0xb6);
sendCmd16Arg8(0xD618, 0xc1);
sendCmd16Arg8(0xD619, 0x55);
sendCmd16Arg8(0xD61A, 0xcb);
sendCmd16Arg8(0xD61B, 0xcd);
sendCmd16Arg8(0xD61C, 0xd6);
sendCmd16Arg8(0xD61D, 0xdf);
sendCmd16Arg8(0xD61E, 0x95);
sendCmd16Arg8(0xD61F, 0xe8);
sendCmd16Arg8(0xD620, 0xf1);
sendCmd16Arg8(0xD621, 0xfa);
sendCmd16Arg8(0xD622, 0x02);
sendCmd16Arg8(0xD623, 0xaa);
sendCmd16Arg8(0xD624, 0x0b);
sendCmd16Arg8(0xD625, 0x13);
sendCmd16Arg8(0xD626, 0x1d);
sendCmd16Arg8(0xD627, 0x26);
sendCmd16Arg8(0xD628, 0xaa);
sendCmd16Arg8(0xD629, 0x30);
sendCmd16Arg8(0xD62A, 0x3c);
sendCmd16Arg8(0xD62B, 0x4A);
sendCmd16Arg8(0xD62C, 0x63);
sendCmd16Arg8(0xD62D, 0xea);
sendCmd16Arg8(0xD62E, 0x79);
sendCmd16Arg8(0xD62F, 0xa6);
sendCmd16Arg8(0xD630, 0xd0);
sendCmd16Arg8(0xD631, 0x20);
sendCmd16Arg8(0xD632, 0x0f);
sendCmd16Arg8(0xD633, 0x8e);
sendCmd16Arg8(0xD634, 0xff);
sendCmd16Arg8(0xB000, 0x05); //AVDD VOLTAGE SETTING
sendCmd16Arg8(0xB001, 0x05);
sendCmd16Arg8(0xB002, 0x05);
sendCmd16Arg8(0xB100, 0x05); //AVEE VOLTAGE SETTING
sendCmd16Arg8(0xB101, 0x05);
sendCmd16Arg8(0xB102, 0x05);
sendCmd16Arg8(0xB600, 0x34); //AVDD Boosting
sendCmd16Arg8(0xB601, 0x34);
sendCmd16Arg8(0xB603, 0x34);
sendCmd16Arg8(0xB700, 0x24); //AVEE Boosting
sendCmd16Arg8(0xB701, 0x24);
sendCmd16Arg8(0xB702, 0x24);
sendCmd16Arg8(0xB800, 0x24); //VCL Boosting
sendCmd16Arg8(0xB801, 0x24);
sendCmd16Arg8(0xB802, 0x24);
sendCmd16Arg8(0xBA00, 0x14); //VGLX VOLTAGE SETTING
sendCmd16Arg8(0xBA01, 0x14);
sendCmd16Arg8(0xBA02, 0x14);
sendCmd16Arg8(0xB900, 0x24); //VCL Boosting
sendCmd16Arg8(0xB901, 0x24);
sendCmd16Arg8(0xB902, 0x24);
sendCmd16Arg8(0xBc00, 0x00); //Gamma Voltage
sendCmd16Arg8(0xBc01, 0xa0); //vgmp=5.0
sendCmd16Arg8(0xBc02, 0x00);
sendCmd16Arg8(0xBd00, 0x00);
sendCmd16Arg8(0xBd01, 0xa0); //vgmn=5.0
sendCmd16Arg8(0xBd02, 0x00);
sendCmd16Arg8(0xBe01, 0x3d); //VCOM Setting 3
sendCmd16Arg8(0xF000, 0x55); //ENABLE PAGE 0
sendCmd16Arg8(0xF001, 0xAA);
sendCmd16Arg8(0xF002, 0x52);
sendCmd16Arg8(0xF003, 0x08);
sendCmd16Arg8(0xF004, 0x00);
sendCmd16Arg8(0xB400, 0x10); //Vivid Color Function Control
sendCmd16Arg8(0xBC00, 0x05); //Z-INVERSION
sendCmd16Arg8(0xBC01, 0x05);
sendCmd16Arg8(0xBC02, 0x05);
sendCmd16Arg8(0xB700, 0x22); //GATE EQ CONTROL
sendCmd16Arg8(0xB701, 0x22); //GATE EQ CONTROL
sendCmd16Arg8(0xC80B, 0x2A); //DISPLAY TIMING CONTROL
sendCmd16Arg8(0xC80C, 0x2A); //DISPLAY TIMING CONTROL
sendCmd16Arg8(0xC80F, 0x2A); //DISPLAY TIMING CONTROL
sendCmd16Arg8(0xC810, 0x2A); //DISPLAY TIMING CONTROL
sendCmd16Arg8(0xd000, 0x01); //PWM_ENH_OE =1
sendCmd16Arg8(0xb300, 0x10); //DM_SEL =1
sendCmd16Arg8(0xBd02, 0x07); //VBPDA=07h
sendCmd16Arg8(0xBe02, 0x07); //VBPDb=07h
sendCmd16Arg8(0xBf02, 0x07); //VBPDc=07h
sendCmd16Arg8(0xF000, 0x55); //ENABLE PAGE 2
sendCmd16Arg8(0xF001, 0xAA);
sendCmd16Arg8(0xF002, 0x52);
sendCmd16Arg8(0xF003, 0x08);
sendCmd16Arg8(0xF004, 0x02);
sendCmd16Arg8(0xc301, 0xa9); //SDREG0 =0
sendCmd16Arg8(0xfe01, 0x94); //DS=14
sendCmd16Arg8(0xf600, 0x60); //OSC =60h
//sendCmd16Arg8(0x3500, 0x00); //TE ON
sendCmd16Arg8(0xF000, 0x55); //ENABLE PAGE 0
sendCmd16Arg8(0xF001, 0xAA);
sendCmd16Arg8(0xF002, 0x52);
sendCmd16Arg8(0xF003, 0x08);
sendCmd16Arg8(0xF004, 0x00);
sendCmd16(0x1100); // SLEEP OUT
delay(100);
sendCmd16Arg8(0x3A00, 0x55); // Bitdepth = RGB565
delay(50);
sendCmd16Arg8(0x3600, MADCTL[3]); // Rotation
delay(50);
sendCmd16(0x2900); // Display ON
delay(50);