1
0
Fork 0
forked from nuttx/nuttx-update

st7789: add configuration option to set default background color

ST7789 fills the display with 0xffff color during its initialization.
This color may or may not be overwritten by a higher layer (framebuffer
or lcd driver for example). The color remains on the display until
application UI is started if not overwritten by the higher layer before.

This commit adds configuration option LCD_ST7789_DEFAULT_COLOR that
allows to set the default background color. This may avoid shining
display with, for example, white color for an extensive amount of time.
The default value is set to 0xffff previously hard-coded in the driver,
therefore current implementations will not notice the change.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
This commit is contained in:
Michal Lenc 2024-11-29 09:45:33 +01:00 committed by Xiang Xiao
parent fcd8236e24
commit a8d4ed910d
2 changed files with 10 additions and 1 deletions

View file

@ -756,6 +756,15 @@ 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_DEFAULT_COLOR
hex "ST7789 Default Background Color"
default 0xffff
range 0 0xffff
---help---
This sets the default color of ST7789 display during its initialization.
It is the color that is filled to the display and remains there unless
higher layer (framebuffer/lcd) overwrites it.
config LCD_ST7789_BGR
bool "ST7789 Use BGR Instead Of RGB"
default n

View file

@ -992,7 +992,7 @@ FAR struct lcd_dev_s *st7789_lcdinitialize(FAR struct spi_dev_s *spi)
st7789_setorientation(priv);
#endif
st7789_display(priv, true);
st7789_fill(priv, 0xffff);
st7789_fill(priv, CONFIG_LCD_ST7789_DEFAULT_COLOR);
return &priv->dev;
}