diff --git a/drivers/lcd/Kconfig b/drivers/lcd/Kconfig index 66bd58ef86..667b571b6c 100644 --- a/drivers/lcd/Kconfig +++ b/drivers/lcd/Kconfig @@ -752,6 +752,12 @@ config LCD_ST7789_INVCOLOR Invert colors of the LCD display. This is useful for implementations that assume that that colors are inverted by default. +config LCD_ST7789_BGR + bool "ST7789 Use BGR Instead Of RGB" + default n + ---help--- + Use BGR color format instead of RGB color format. + config LCD_ST7789_BPP int "Bit Per Pixel (12 or 16)" default 16 diff --git a/drivers/lcd/st7789.c b/drivers/lcd/st7789.c index 1e92f82864..b6418fa5dd 100644 --- a/drivers/lcd/st7789.c +++ b/drivers/lcd/st7789.c @@ -480,6 +480,10 @@ static void st7789_setorientation(FAR struct st7789_dev_s *dev) madctl ^= 0x80; #endif +#ifdef CONFIG_LCD_ST7789_BGR + madctl |= 0x08; +#endif + SPI_SEND(dev->spi, LCD_ST7789_DATA_PREFIX | madctl); st7789_deselect(dev->spi);