diff --git a/hw/drivers/display/lvgl/tft/ili9341/src/ili9341.c b/hw/drivers/display/lvgl/tft/ili9341/src/ili9341.c index 09053df39a..28bd75bc8e 100644 --- a/hw/drivers/display/lvgl/tft/ili9341/src/ili9341.c +++ b/hw/drivers/display/lvgl/tft/ili9341/src/ili9341.c @@ -159,6 +159,7 @@ LCD_SEQUENCE(init_cmds) 1, ILI9341_SWRESET, LCD_SEQUENCE_DELAY(5), #endif +#if MYNEWT_VAL(ILI9341_IPS) == 0 1, ILI9341_DISPOFF, 4, ILI9341_PWCTRLB, 0x00, 0x83, 0x30, 5, ILI9341_PWSEQCTRL, 0x64, 0x03, 0x12, 0x81, @@ -177,6 +178,29 @@ LCD_SEQUENCE(init_cmds) 2, ILI9341_GAMSET, 01, 16, ILI9341_PGAMCTRL, 0x1f, 0x1a, 0x18, 0x0a, 0x0f, 0x06, 0x45, 0x87, 0x32, 0x0a, 0x07, 0x02, 0x07, 0x05, 0x00, 16, ILI9341_NGAMCTRL, 0x00, 0x25, 0x27, 0x05, 0x10, 0x09, 0x3a, 0x78, 0x4d, 0x05, 0x18, 0x0d, 0x38, 0x3a, 0x1f, +#elif MYNEWT_VAL(ILI9341_IPS) == 1 + 1, ILI9341_DISPOFF, + 4, ILI9341_PWCTRLB, 0x00, 0xC1, 0x30, + 5, ILI9341_PWSEQCTRL, 0x64, 0x03, 0x12, 0x81, + 4, ILI9341_TIMECTRLA_INT, 0x85, 0x00, 0x78, + 6, ILI9341_PWCTRLA, 0x39, 0x2c, 0x00, 0x34, 0x02, + 2, ILI9341_PUMPRATIO, 0x20, + 3, ILI9341_TIMECTRLB, 0x00, 0x00, + 2, ILI9341_PWCTRL1, 0x13, /* VRH[5:0] */ + 2, ILI9341_PWCTRL2, 0x13, /* SAP[2:0];BT[3:0] */ + 3, ILI9341_VMCTRL1, 0x1C, 0x35, + 2, ILI9341_VMCTRL2, 0xC8, + 1, ILI9341_DINVON, + 2, ILI9341_MADCTL, MADCTL_BGR | MADCTL_MX, + 2, ILI9341_PIXSET, 0x55, + 3, ILI9341_IFCTL, 0x01, 0x30, + 3, ILI9341_FRMCTR1, 0x00, 0x1B, + /* positive gamma correction */ + 2, ILI9341_GAM3CTRL, 0x00, + 2, ILI9341_GAMSET, 0x01, + 16, ILI9341_PGAMCTRL, 0x0F, 0x35, 0x31, 0x0B, 0x0E, 0x06, 0x49, 0xA7, 0x33, 0x07, 0x0F, 0x03, 0x0C, 0x0A, 0x00, + 16, ILI9341_NGAMCTRL, 0x00, 0x0A, 0x0F, 0x04, 0x11, 0x08, 0x36, 0x58, 0x4D, 0x07, 0x10, 0x0C, 0x32, 0x34, 0x0F, +#endif 5, ILI9341_CASET, 0x00, 0x00, 0x00, 0xEF, 5, ILI9341_PASET, 0x00, 0x00, 0x01, 0x3F, 1, ILI9341_TEON, diff --git a/hw/drivers/display/lvgl/tft/ili9341/syscfg.yml b/hw/drivers/display/lvgl/tft/ili9341/syscfg.yml index 9b18475be8..716a531d54 100644 --- a/hw/drivers/display/lvgl/tft/ili9341/syscfg.yml +++ b/hw/drivers/display/lvgl/tft/ili9341/syscfg.yml @@ -17,6 +17,12 @@ # syscfg.defs: + ILI9341_IPS: + description: > + Use configuration for IPS display. + IPS displays require different register values to show + correct colors. + value: 0 syscfg.vals: LVGL_DISPLAY_HORIZONTAL_RESOLUTION: 240