You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/06/25 10:40:09 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6511: esp32_board_spi:Missing Data Command pin support

pkarashchenko commented on code in PR #6511:
URL: https://github.com/apache/incubator-nuttx/pull/6511#discussion_r906666824


##########
boards/xtensa/esp32/common/src/esp32_board_spi.c:
##########
@@ -71,15 +71,17 @@ static inline uint8_t spi_status(struct spi_dev_s *dev, uint32_t devid)
 static inline int spi_cmddata(struct spi_dev_s *dev, uint32_t devid,
                               bool cmd)
 {
-#ifdef CONFIG_LCD_ILI9341
+#if defined(CONFIG_LCD_ILI9341) || defined(CONFIG_LCD_SSD1680)
   if (devid == SPIDEV_DISPLAY(0))
     {
       /*  This is the Data/Command control pad which determines whether the
        *  data bits are data or a command.
        */
-
+#  if defined(CONFIG_LCD_SSD1680)
+      esp32_gpiowrite(CONFIG_SSD1680_GPIO_PIN_DTA_CMD, !cmd);
+#  else
       esp32_gpiowrite(DISPLAY_DC, !cmd);
-
+#  endif

Review Comment:
   I think the current implementation of `CONFIG_SSD1680_GPIO_PIN_DTA_CMD` could be optimized. We need to change `board.h`:
   ```
   #define DISPLAY_SPI       2
   #if defined(CONFIG_LCD_SSD1680)
   #  define DISPLAY_DC CONFIG_SSD1680_GPIO_PIN_DTA_CMD
   #else
   #  define DISPLAY_DC        21
   #endif
   #define DISPLAY_RST       18
   #define DISPLAY_BCKL      5
   ```
   and revert change here



-- 
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-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org