boards/xtensa/esp32s3/esp32s3-box: Fix ILI9342C color inversion

When using the ILI9342C LCD on the esp32s3-box-3 development board, the
displayed colors are inverted.

add content

Manually converts the byte order of color data from little-endian
to big-endian before transmission.
This commit is contained in:
jiayadong
2025-06-27 17:20:53 +08:00
committed by Xiang Xiao
parent 27a2f88e86
commit 0d834b0621
@@ -30,6 +30,7 @@
#include <stdbool.h>
#include <debug.h>
#include <errno.h>
#include <endian.h>
#include <sys/param.h>
#include <nuttx/arch.h>
@@ -420,6 +421,11 @@ static int ili9342c_sendgram(struct ili9341_lcd_s *lcd,
{
struct ili9342c_lcd_dev *priv = (struct ili9342c_lcd_dev *)lcd;
for (uint32_t i = 0; i < nwords; i++)
{
((uint16_t *)wd)[i] = swap16(wd[i]);
}
lcdinfo("lcd:%p, wd=%p, nwords=%" PRIu32 "\n", lcd, wd, nwords);
SPI_SETBITS(priv->spi_dev, 16);