lcd/st77xx: change 16 bit cmd send to 8 bit

Make sending commands independent of processor endianness. The data can
be handled by application side, such as LVGL has SWAP16 option.

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
This commit is contained in:
Peter Bee
2021-09-17 14:49:19 +08:00
committed by Alan Carvalho de Assis
parent a7a3d8bec7
commit ea6955f77b
3 changed files with 31 additions and 19 deletions
+10 -6
View File
@@ -482,17 +482,21 @@ static void gc9a01_setarea(FAR struct gc9a01_dev_s *dev,
/* Set row address */
gc9a01_sendcmd(dev, GC9A01_RASET);
gc9a01_select(dev->spi, 16);
SPI_SEND(dev->spi, y0 + GC9A01_YOFFSET);
SPI_SEND(dev->spi, y1 + GC9A01_YOFFSET);
gc9a01_select(dev->spi, 8);
SPI_SEND(dev->spi, (y0 + GC9A01_YOFFSET) >> 8);
SPI_SEND(dev->spi, (y0 + GC9A01_YOFFSET) & 0xff);
SPI_SEND(dev->spi, (y1 + GC9A01_YOFFSET) >> 8);
SPI_SEND(dev->spi, (y1 + GC9A01_YOFFSET) & 0xff);
gc9a01_deselect(dev->spi);
/* Set column address */
gc9a01_sendcmd(dev, GC9A01_CASET);
gc9a01_select(dev->spi, 16);
SPI_SEND(dev->spi, x0 + GC9A01_XOFFSET);
SPI_SEND(dev->spi, x1 + GC9A01_XOFFSET);
gc9a01_select(dev->spi, 8);
SPI_SEND(dev->spi, (x0 + GC9A01_XOFFSET) >> 8);
SPI_SEND(dev->spi, (x0 + GC9A01_XOFFSET) & 0xff);
SPI_SEND(dev->spi, (x1 + GC9A01_XOFFSET) >> 8);
SPI_SEND(dev->spi, (x1 + GC9A01_XOFFSET) & 0xff);
gc9a01_deselect(dev->spi);
}