You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2021/07/30 17:08:10 UTC

[incubator-nuttx] branch master updated: raspberrypi-pico: add support for lcd_dev

This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 84480d7  raspberrypi-pico: add support for lcd_dev
84480d7 is described below

commit 84480d760b1c84d91dd2e0fd7ee752e400f0c364
Author: Peter Bee <bi...@xiaomi.com>
AuthorDate: Thu Jul 29 13:46:19 2021 +0800

    raspberrypi-pico: add support for lcd_dev
    
    Signed-off-by: Peter Bee <bi...@xiaomi.com>
    Change-Id: I5cf9fa40cae6ddfe5c8041145f19e5058b76193f
---
 .../rp2040/raspberrypi-pico/src/rp2040_bringup.c   | 26 ++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/boards/arm/rp2040/raspberrypi-pico/src/rp2040_bringup.c b/boards/arm/rp2040/raspberrypi-pico/src/rp2040_bringup.c
index 96ee480..eab72fc 100644
--- a/boards/arm/rp2040/raspberrypi-pico/src/rp2040_bringup.c
+++ b/boards/arm/rp2040/raspberrypi-pico/src/rp2040_bringup.c
@@ -34,11 +34,19 @@
 #include "rp2040_pico.h"
 
 #ifdef CONFIG_LCD_BACKPACK
-#   include "rp2040_lcd_backpack.h"
+#include "rp2040_lcd_backpack.h"
+#endif
+
+#ifdef CONFIG_LCD
+#include <nuttx/board.h>
+#endif
+
+#ifdef CONFIG_LCD_DEV
+#include <nuttx/lcd/lcd_dev.h>
 #endif
 
 #ifdef CONFIG_VIDEO_FB
-#  include <nuttx/video/fb.h>
+#include <nuttx/video/fb.h>
 #endif
 
 /****************************************************************************
@@ -136,6 +144,20 @@ int rp2040_bringup(void)
     {
       _err("ERROR: Failed to initialize Frame Buffer Driver.\n");
     }
+#elif defined(CONFIG_LCD)
+  ret = board_lcd_initialize();
+  if (ret < 0)
+    {
+      syslog(LOG_ERR, "ERROR: Failed to initialize LCD.\n");
+    }
+#endif
+
+#ifdef CONFIG_LCD_DEV
+  ret = lcddev_register(0);
+  if (ret < 0)
+    {
+      syslog(LOG_ERR, "ERROR: lcddev_register() failed: %d\n", ret);
+    }
 #endif
 
 #ifdef CONFIG_LCD_BACKPACK