mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
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:
committed by
Alan Carvalho de Assis
parent
a7a3d8bec7
commit
ea6955f77b
+10
-6
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user