|
|
@ -144,39 +144,11 @@ static const uint16_t st7796s_init[] = {
|
|
|
|
ESC_REG(ST7796S_PGC), 0x00F0, 0x0004, 0x0008, 0x0009, 0x0008, 0x0015, 0x002F, 0x0042, 0x0046, 0x0028, 0x0015, 0x0016, 0x0029, 0x002D,
|
|
|
|
ESC_REG(ST7796S_PGC), 0x00F0, 0x0004, 0x0008, 0x0009, 0x0008, 0x0015, 0x002F, 0x0042, 0x0046, 0x0028, 0x0015, 0x0016, 0x0029, 0x002D,
|
|
|
|
ESC_REG(ST7796S_NGC), 0x00F0, 0x0004, 0x0009, 0x0009, 0x0008, 0x0015, 0x002E, 0x0046, 0x0046, 0x0028, 0x0015, 0x0015, 0x0029, 0x002D,
|
|
|
|
ESC_REG(ST7796S_NGC), 0x00F0, 0x0004, 0x0009, 0x0009, 0x0008, 0x0015, 0x002E, 0x0046, 0x0046, 0x0028, 0x0015, 0x0015, 0x0029, 0x002D,
|
|
|
|
|
|
|
|
|
|
|
|
ESC_REG(ST7796S_NORON),
|
|
|
|
#if ENABLED(ST7796S_INVERTED)
|
|
|
|
ESC_REG(ST7796S_WRCTRLD), 0x0024,
|
|
|
|
ESC_REG(ST7796S_INVON), // Display inversion ON
|
|
|
|
ESC_REG(ST7796S_CSCON), 0x003C, // disable command 2 part I
|
|
|
|
#else
|
|
|
|
ESC_REG(ST7796S_CSCON), 0x0069, // disable command 2 part II
|
|
|
|
ESC_REG(ST7796S_NORON),
|
|
|
|
ESC_REG(ST7796S_DISPON),
|
|
|
|
#endif
|
|
|
|
ESC_END
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const uint16_t lerdge_st7796s_init[] = {
|
|
|
|
|
|
|
|
DATASIZE_8BIT,
|
|
|
|
|
|
|
|
ESC_REG(ST7796S_SWRESET), ESC_DELAY(100),
|
|
|
|
|
|
|
|
ESC_REG(ST7796S_SLPOUT), ESC_DELAY(20),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ESC_REG(ST7796S_CSCON), 0x00C3, // enable command 2 part I
|
|
|
|
|
|
|
|
ESC_REG(ST7796S_CSCON), 0x0096, // enable command 2 part II
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ESC_REG(ST7796S_MADCTL), ST7796S_MADCTL_DATA,
|
|
|
|
|
|
|
|
ESC_REG(ST7796S_COLMOD), 0x0055,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ESC_REG(ST7796S_DIC), 0x0001, // 1-dot inversion
|
|
|
|
|
|
|
|
ESC_REG(ST7796S_EM), 0x00C6,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ESC_REG(ST7796S_PWR2), 0x0015,
|
|
|
|
|
|
|
|
ESC_REG(ST7796S_PWR3), 0x00AF,
|
|
|
|
|
|
|
|
ESC_REG(ST7796S_VCMPCTL), 0x0022,
|
|
|
|
|
|
|
|
ESC_REG(ST7796S_VCMOST), 0x0000,
|
|
|
|
|
|
|
|
ESC_REG(ST7796S_DOCA), 0x0040, 0x008A, 0x0000, 0x0000, 0x0029, 0x0019, 0x00A5, 0x0033,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Gamma Correction. */
|
|
|
|
|
|
|
|
ESC_REG(ST7796S_PGC), 0x00F0, 0x0004, 0x0008, 0x0009, 0x0008, 0x0015, 0x002F, 0x0042, 0x0046, 0x0028, 0x0015, 0x0016, 0x0029, 0x002D,
|
|
|
|
|
|
|
|
ESC_REG(ST7796S_NGC), 0x00F0, 0x0004, 0x0009, 0x0009, 0x0008, 0x0015, 0x002E, 0x0046, 0x0046, 0x0028, 0x0015, 0x0015, 0x0029, 0x002D,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ESC_REG(ST7796S_INVON), // Display inversion ON
|
|
|
|
|
|
|
|
ESC_REG(ST7796S_WRCTRLD), 0x0024,
|
|
|
|
ESC_REG(ST7796S_WRCTRLD), 0x0024,
|
|
|
|
ESC_REG(ST7796S_CSCON), 0x003C, // disable command 2 part I
|
|
|
|
ESC_REG(ST7796S_CSCON), 0x003C, // disable command 2 part I
|
|
|
|
ESC_REG(ST7796S_CSCON), 0x0069, // disable command 2 part II
|
|
|
|
ESC_REG(ST7796S_CSCON), 0x0069, // disable command 2 part II
|
|
|
|