michallenc commented on code in PR #16094: URL: https://github.com/apache/nuttx/pull/16094#discussion_r2022407104
########## drivers/lcd/st7789.c: ########## @@ -497,6 +497,39 @@ static void st7789_setorientation(FAR struct st7789_dev_s *dev) } #endif +static void st7789_ramctl(FAR struct st7789_dev_s *dev) +{ + /* ============ ==== ==== ====== ====== ======== ===== ====== ====== + * Parameters D7 D6 D5 D4 D3 D2 D1 D0 + * ============ ==== ==== ====== ====== ======== ===== ====== ====== + * 1st (LSB) 0 0 0 RM 0 0 DM1 DM0 + * 2nd (MSB) 1 1 EPF1 EPF0 ENDIAN RIM MDT1 MDT0 + * ============ ==== ==== ====== ====== ======== ===== ====== ====== + */ + + uint16_t ramctl = 0x0; + + st7789_sendcmd(dev, ST7789_RAMCTRL); + st7789_select(dev->spi, LCD_ST7789_SPI_BITS * 2); + + /* Fill the reserved bits */ + + ramctl |= 0xc000; + + /* Set EPF */ + + ramctl |= 0x3000; Review Comment: @JianyuWang0623 Hi, this unfortunately breaks the behavior of 1.14" 135x240 display with LCD driver (even with a simple example that tries to fill the entire display with one color) and on 2.4'' IPS 240x320 (DMT024QVNTNT0-2B) display. The latter even fails on debug assertion as it has a 3 wire connection, therefore `LCD_ST7789_SPI_BITS` is defined as 9 and setting bits of one word to `LCD_ST7789_SPI_BITS * 2 = 18` is not supported by SAMv7 and many other platforms (usually 2 bytes are maximum). I would suggest putting the entire `st7789_ramctl` call under `ifdef` as it is not needed by default (or at least it wasn't on many displays so far) and let the default be as previous. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org