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 2023/10/12 20:57:11 UTC
[nuttx] branch master updated (cef8c598c7 -> 0f56d3428b)
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
from cef8c598c7 arm64: Add support for FIQ interrupts
new e99966ec70 chore(esp32s3_board_i2c): suppress warning
new 09ee163d37 feat(esp32s3-eye): I2C
new b7bc0e542c fix(esp32s3-eye): spiflash declaration
new 20b5d2b84c fix(esp32s3-eye): unexpose backlight GPIO
new effab1bd61 feat(esp32s3-eye): SPI and LCD
new e5b4b58f96 feat(esp32s3-eye): i2c defconfig
new 0f56d3428b feat(esp32s3-eye): lcd defconfig
The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../xtensa/esp32s3/common/src/esp32s3_board_i2c.c | 3 +-
boards/xtensa/esp32s3/esp32s3-eye/Kconfig | 11 ++++
.../esp32s3-eye/configs/{nsh => i2c}/defconfig | 5 ++
.../esp32s3-eye/configs/{nsh => lcd}/defconfig | 14 +++++
boards/xtensa/esp32s3/esp32s3-eye/include/board.h | 2 +-
boards/xtensa/esp32s3/esp32s3-eye/src/Make.defs | 8 +++
.../xtensa/esp32s3/esp32s3-eye/src/esp32s3-eye.h | 72 ++++++++++++++++++++++
.../src/esp32s3_board_lcd.c | 30 ++++-----
.../src/esp32s3_board_spi.c | 6 +-
.../esp32s3/esp32s3-eye/src/esp32s3_bringup.c | 49 +++++++++++++++
.../xtensa/esp32s3/esp32s3-eye/src/esp32s3_gpio.c | 7 +--
11 files changed, 180 insertions(+), 27 deletions(-)
copy boards/xtensa/esp32s3/esp32s3-eye/configs/{nsh => i2c}/defconfig (91%)
copy boards/xtensa/esp32s3/esp32s3-eye/configs/{nsh => lcd}/defconfig (77%)
copy boards/xtensa/esp32s3/{esp32s3-box => esp32s3-eye}/src/esp32s3_board_lcd.c (85%)
copy boards/xtensa/esp32s3/{esp32s3-box => esp32s3-eye}/src/esp32s3_board_spi.c (96%)
[nuttx] 06/07: feat(esp32s3-eye): i2c defconfig
Posted by ac...@apache.org.
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/nuttx.git
commit e5b4b58f96fdc358681360af4b3fce5cc5590534
Author: Marco Casaroli <ma...@gmail.com>
AuthorDate: Tue Oct 10 11:12:39 2023 +0000
feat(esp32s3-eye): i2c defconfig
---
.../esp32s3/esp32s3-eye/configs/i2c/defconfig | 51 ++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/boards/xtensa/esp32s3/esp32s3-eye/configs/i2c/defconfig b/boards/xtensa/esp32s3/esp32s3-eye/configs/i2c/defconfig
new file mode 100644
index 0000000000..24534812eb
--- /dev/null
+++ b/boards/xtensa/esp32s3/esp32s3-eye/configs/i2c/defconfig
@@ -0,0 +1,51 @@
+#
+# This file is autogenerated: PLEASE DO NOT EDIT IT.
+#
+# You can use "make menuconfig" to make any modifications to the installed .config file.
+# You can then do "make savedefconfig" to generate a new defconfig file that includes your
+# modifications.
+#
+# CONFIG_ARCH_LEDS is not set
+# CONFIG_NSH_ARGCAT is not set
+# CONFIG_NSH_CMDOPT_HEXDUMP is not set
+CONFIG_ARCH="xtensa"
+CONFIG_ARCH_BOARD="esp32s3-eye"
+CONFIG_ARCH_BOARD_COMMON=y
+CONFIG_ARCH_BOARD_ESP32S3_EYE=y
+CONFIG_ARCH_CHIP="esp32s3"
+CONFIG_ARCH_CHIP_ESP32S3=y
+CONFIG_ARCH_CHIP_ESP32S3WROOM1=y
+CONFIG_ARCH_INTERRUPTSTACK=2048
+CONFIG_ARCH_STACKDUMP=y
+CONFIG_ARCH_XTENSA=y
+CONFIG_BOARD_LOOPSPERMSEC=16717
+CONFIG_BUILTIN=y
+CONFIG_DEBUG_FULLOPT=y
+CONFIG_DEBUG_SYMBOLS=y
+CONFIG_DEV_ZERO=y
+CONFIG_ESP32S3_GPIO_IRQ=y
+CONFIG_ESP32S3_I2C0=y
+CONFIG_ESP32S3_I2C0_SCLPIN=5
+CONFIG_ESP32S3_I2C0_SDAPIN=4
+CONFIG_ESP32S3_USBSERIAL=y
+CONFIG_FS_PROCFS=y
+CONFIG_I2C_RESET=y
+CONFIG_IDLETHREAD_STACKSIZE=3072
+CONFIG_INIT_ENTRYPOINT="nsh_main"
+CONFIG_INTELHEX_BINARY=y
+CONFIG_NSH_ARCHINIT=y
+CONFIG_NSH_BUILTIN_APPS=y
+CONFIG_NSH_FILEIOSIZE=512
+CONFIG_NSH_LINELEN=64
+CONFIG_NSH_READLINE=y
+CONFIG_PREALLOC_TIMERS=4
+CONFIG_RAM_SIZE=114688
+CONFIG_RAM_START=0x20000000
+CONFIG_RR_INTERVAL=200
+CONFIG_SCHED_WAITPID=y
+CONFIG_START_DAY=6
+CONFIG_START_MONTH=12
+CONFIG_START_YEAR=2011
+CONFIG_SYSLOG_BUFFER=y
+CONFIG_SYSTEM_I2CTOOL=y
+CONFIG_SYSTEM_NSH=y
[nuttx] 02/07: feat(esp32s3-eye): I2C
Posted by ac...@apache.org.
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/nuttx.git
commit 09ee163d378a57723f722fffe58a62625147b399
Author: Marco Casaroli <ma...@gmail.com>
AuthorDate: Tue Oct 10 10:57:40 2023 +0000
feat(esp32s3-eye): I2C
---
boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3-eye.h | 16 ++++++++++++++++
boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3_bringup.c | 14 ++++++++++++++
2 files changed, 30 insertions(+)
diff --git a/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3-eye.h b/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3-eye.h
index c0c4714df0..46fe3522c6 100644
--- a/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3-eye.h
+++ b/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3-eye.h
@@ -85,5 +85,21 @@ int esp32s3_bringup(void);
int esp32s3_gpio_init(void);
#endif
+/****************************************************************************
+ * Name: board_i2c_init
+ *
+ * Description:
+ * Configure the I2C driver.
+ *
+ * Returned Value:
+ * Zero (OK) is returned on success; A negated errno value is returned
+ * to indicate the nature of any failure.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_I2C_DRIVER
+int board_i2c_init(void);
+#endif
+
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_XTENSA_ESP32S3_ESP32S3_EYE_SRC_ESP32S3_EYE_H */
diff --git a/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3_bringup.c b/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3_bringup.c
index 34af2191bd..d075e5a87c 100644
--- a/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3_bringup.c
+++ b/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3_bringup.c
@@ -58,6 +58,10 @@
# include "esp32s3_rt_timer.h"
#endif
+#ifdef CONFIG_ESP32S3_I2C
+# include "esp32s3_i2c.h"
+#endif
+
#ifdef CONFIG_WATCHDOG
# include "esp32s3_board_wdt.h"
#endif
@@ -139,6 +143,16 @@ int esp32s3_bringup(void)
}
#endif
+#ifdef CONFIG_I2C_DRIVER
+ /* Configure I2C peripheral interfaces */
+
+ ret = board_i2c_init();
+ if (ret < 0)
+ {
+ syslog(LOG_ERR, "Failed to initialize I2C driver: %d\n", ret);
+ }
+#endif
+
#ifdef CONFIG_INPUT_BUTTONS
/* Register the BUTTON driver */
[nuttx] 01/07: chore(esp32s3_board_i2c): suppress warning
Posted by ac...@apache.org.
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/nuttx.git
commit e99966ec703497c1c57ed8a4d84e7805b6872418
Author: Marco Casaroli <ma...@gmail.com>
AuthorDate: Tue Oct 10 10:05:45 2023 +0000
chore(esp32s3_board_i2c): suppress warning
If only I2C1 is configured but not I2C0, gcc is giving a warning,
so we suppress it.
---
boards/xtensa/esp32s3/common/src/esp32s3_board_i2c.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/boards/xtensa/esp32s3/common/src/esp32s3_board_i2c.c b/boards/xtensa/esp32s3/common/src/esp32s3_board_i2c.c
index de5c46519c..30f7c3b66b 100644
--- a/boards/xtensa/esp32s3/common/src/esp32s3_board_i2c.c
+++ b/boards/xtensa/esp32s3/common/src/esp32s3_board_i2c.c
@@ -86,7 +86,8 @@ int board_i2c_init(void)
ret = i2c_driver_init(ESP32S3_I2C1);
#endif
+#ifdef CONFIG_ESP32S3_I2C0
done:
+#endif
return ret;
}
-
[nuttx] 07/07: feat(esp32s3-eye): lcd defconfig
Posted by ac...@apache.org.
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/nuttx.git
commit 0f56d3428bf11b81899b25de8f1a369efcd30afc
Author: Marco Casaroli <ma...@gmail.com>
AuthorDate: Tue Oct 10 11:56:23 2023 +0000
feat(esp32s3-eye): lcd defconfig
---
.../esp32s3/esp32s3-eye/configs/lcd/defconfig | 60 ++++++++++++++++++++++
1 file changed, 60 insertions(+)
diff --git a/boards/xtensa/esp32s3/esp32s3-eye/configs/lcd/defconfig b/boards/xtensa/esp32s3/esp32s3-eye/configs/lcd/defconfig
new file mode 100644
index 0000000000..5889112b5b
--- /dev/null
+++ b/boards/xtensa/esp32s3/esp32s3-eye/configs/lcd/defconfig
@@ -0,0 +1,60 @@
+#
+# This file is autogenerated: PLEASE DO NOT EDIT IT.
+#
+# You can use "make menuconfig" to make any modifications to the installed .config file.
+# You can then do "make savedefconfig" to generate a new defconfig file that includes your
+# modifications.
+#
+# CONFIG_ARCH_LEDS is not set
+# CONFIG_NSH_ARGCAT is not set
+# CONFIG_NSH_CMDOPT_HEXDUMP is not set
+CONFIG_ARCH="xtensa"
+CONFIG_ARCH_BOARD="esp32s3-eye"
+CONFIG_ARCH_BOARD_COMMON=y
+CONFIG_ARCH_BOARD_ESP32S3_EYE=y
+CONFIG_ARCH_CHIP="esp32s3"
+CONFIG_ARCH_CHIP_ESP32S3=y
+CONFIG_ARCH_CHIP_ESP32S3WROOM1=y
+CONFIG_ARCH_INTERRUPTSTACK=2048
+CONFIG_ARCH_STACKDUMP=y
+CONFIG_ARCH_XTENSA=y
+CONFIG_BOARD_LOOPSPERMSEC=16717
+CONFIG_BUILTIN=y
+CONFIG_DEBUG_FULLOPT=y
+CONFIG_DEBUG_SYMBOLS=y
+CONFIG_DEV_ZERO=y
+CONFIG_DRIVERS_VIDEO=y
+CONFIG_ESP32S3_EYE_LCD=y
+CONFIG_ESP32S3_GPIO_IRQ=y
+CONFIG_ESP32S3_SPI2_CLKPIN=21
+CONFIG_ESP32S3_SPI2_CSPIN=44
+CONFIG_ESP32S3_SPI2_MISOPIN=1
+CONFIG_ESP32S3_SPI2_MOSIPIN=47
+CONFIG_ESP32S3_USBSERIAL=y
+CONFIG_EXAMPLES_FB=y
+CONFIG_FS_PROCFS=y
+CONFIG_IDLETHREAD_STACKSIZE=3072
+CONFIG_INIT_ENTRYPOINT="nsh_main"
+CONFIG_INTELHEX_BINARY=y
+CONFIG_LCD_FRAMEBUFFER=y
+CONFIG_LCD_PORTRAIT=y
+CONFIG_LCD_ST7789_BGR=y
+CONFIG_LCD_ST7789_FREQUENCY=40000000
+CONFIG_LCD_ST7789_YRES=240
+CONFIG_NSH_ARCHINIT=y
+CONFIG_NSH_BUILTIN_APPS=y
+CONFIG_NSH_FILEIOSIZE=512
+CONFIG_NSH_LINELEN=64
+CONFIG_NSH_READLINE=y
+CONFIG_PREALLOC_TIMERS=4
+CONFIG_RAM_SIZE=114688
+CONFIG_RAM_START=0x20000000
+CONFIG_RR_INTERVAL=200
+CONFIG_SCHED_WAITPID=y
+CONFIG_START_DAY=6
+CONFIG_START_MONTH=12
+CONFIG_START_YEAR=2011
+CONFIG_SYSLOG_BUFFER=y
+CONFIG_SYSTEM_NSH=y
+CONFIG_VIDEO=y
+CONFIG_VIDEO_FB=y
[nuttx] 03/07: fix(esp32s3-eye): spiflash declaration
Posted by ac...@apache.org.
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/nuttx.git
commit b7bc0e542cf2995e8275cf96588fa6cef0fcf1a0
Author: Marco Casaroli <ma...@gmail.com>
AuthorDate: Tue Oct 10 10:58:31 2023 +0000
fix(esp32s3-eye): spiflash declaration
---
boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3-eye.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3-eye.h b/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3-eye.h
index 46fe3522c6..2b0d143a43 100644
--- a/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3-eye.h
+++ b/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3-eye.h
@@ -85,6 +85,18 @@ int esp32s3_bringup(void);
int esp32s3_gpio_init(void);
#endif
+/****************************************************************************
+ * Name: board_spiflash_init
+ *
+ * Description:
+ * Initialize the SPIFLASH and register the MTD device.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_ESP32S3_SPIFLASH
+int board_spiflash_init(void);
+#endif
+
/****************************************************************************
* Name: board_i2c_init
*
[nuttx] 05/07: feat(esp32s3-eye): SPI and LCD
Posted by ac...@apache.org.
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/nuttx.git
commit effab1bd61f5a35f76f78150e16a2f6dc7e90b23
Author: Marco Casaroli <ma...@gmail.com>
AuthorDate: Tue Oct 10 10:59:50 2023 +0000
feat(esp32s3-eye): SPI and LCD
LCD is connected to SPI2 and uses DC signalling.
---
boards/xtensa/esp32s3/esp32s3-eye/Kconfig | 11 ++
boards/xtensa/esp32s3/esp32s3-eye/src/Make.defs | 8 ++
.../xtensa/esp32s3/esp32s3-eye/src/esp32s3-eye.h | 44 +++++++
.../src/{esp32s3-eye.h => esp32s3_board_lcd.c} | 140 +++++++++++++--------
.../src/{esp32s3-eye.h => esp32s3_board_spi.c} | 137 ++++++++++----------
.../esp32s3/esp32s3-eye/src/esp32s3_bringup.c | 35 ++++++
6 files changed, 259 insertions(+), 116 deletions(-)
diff --git a/boards/xtensa/esp32s3/esp32s3-eye/Kconfig b/boards/xtensa/esp32s3/esp32s3-eye/Kconfig
index e955d65e3a..d533243d3e 100644
--- a/boards/xtensa/esp32s3/esp32s3-eye/Kconfig
+++ b/boards/xtensa/esp32s3/esp32s3-eye/Kconfig
@@ -48,4 +48,15 @@ config ESP32S3_SPIFLASH_LITTLEFS
endchoice
+config ESP32S3_EYE_LCD
+ bool "Enable ESP32-S3 LCD"
+ default n
+ select ESP32S3_SPI2
+ select SPI_CMDDATA
+ select LCD
+ select LCD_DEV
+ select LCD_ST7789
+ ---help---
+ Enable board LCD support, IC is LCD_ST7789V.
+
endif # ARCH_BOARD_ESP32S3_EYE
diff --git a/boards/xtensa/esp32s3/esp32s3-eye/src/Make.defs b/boards/xtensa/esp32s3/esp32s3-eye/src/Make.defs
index 73d208e58e..d64e14030d 100644
--- a/boards/xtensa/esp32s3/esp32s3-eye/src/Make.defs
+++ b/boards/xtensa/esp32s3/esp32s3-eye/src/Make.defs
@@ -37,6 +37,14 @@ ifeq ($(CONFIG_DEV_GPIO),y)
CSRCS += esp32s3_gpio.c
endif
+ifeq ($(CONFIG_ESP32S3_SPI),y)
+CSRCS += esp32s3_board_spi.c
+endif
+
+ifeq ($(CONFIG_ESP32S3_EYE_LCD),y)
+CSRCS += esp32s3_board_lcd.c
+endif
+
DEPPATH += --dep-path board
VPATH += :board
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board
diff --git a/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3-eye.h b/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3-eye.h
index 2b0d143a43..6c89e6cc24 100644
--- a/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3-eye.h
+++ b/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3-eye.h
@@ -38,6 +38,11 @@
/* BOOT Button */
#define BUTTON_BOOT 0
+/* Display */
+
+#define ESP32S3_EYE_DISPLAY_SPI 2
+#define ESP32S3_EYE_DISPLAY_DC 43
+#define ESP32S3_EYE_DISPLAY_BCKL 48
/****************************************************************************
* Public Types
@@ -97,6 +102,45 @@ int esp32s3_gpio_init(void);
int board_spiflash_init(void);
#endif
+/****************************************************************************
+ * Name: board_lcd_initialize
+ *
+ * Description:
+ * Initialize the LCD video hardware. The initial state of the LCD is fully
+ * initialized, display memory cleared, and the LCD ready to use, but with
+ * the power setting at 0 (full off).
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_ESP32S3_EYE_LCD
+int board_lcd_initialize(void);
+#endif
+
+/****************************************************************************
+ * Name: board_lcd_getdev
+ *
+ * Description:
+ * Return a reference to the LCD object for the specified LCD. This allows
+ * support for multiple LCD devices.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_ESP32S3_EYE_LCD
+struct lcd_dev_s *board_lcd_getdev(int lcddev);
+#endif
+
+/****************************************************************************
+ * Name: board_lcd_uninitialize
+ *
+ * Description:
+ * Uninitialize the LCD support.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_ESP32S3_EYE_LCD
+void board_lcd_uninitialize(void);
+#endif
+
/****************************************************************************
* Name: board_i2c_init
*
diff --git a/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3-eye.h b/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3_board_lcd.c
similarity index 50%
copy from boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3-eye.h
copy to boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3_board_lcd.c
index 2b0d143a43..e7d5eedc68 100644
--- a/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3-eye.h
+++ b/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3_board_lcd.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3-eye.h
+ * boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3_board_lcd.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -18,100 +18,136 @@
*
****************************************************************************/
-#ifndef __BOARDS_XTENSA_ESP32S3_ESP32S3_EYE_SRC_ESP32S3_EYE_H
-#define __BOARDS_XTENSA_ESP32S3_ESP32S3_EYE_SRC_ESP32S3_EYE_H
-
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
-#include <nuttx/compiler.h>
-#include <stdint.h>
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
+#include <stdio.h>
+#include <stdbool.h>
+#include <debug.h>
+#include <errno.h>
+
+#include <nuttx/arch.h>
+#include <nuttx/board.h>
+#include <nuttx/signal.h>
+#include <nuttx/spi/spi.h>
+#include <nuttx/lcd/lcd.h>
+#include <nuttx/lcd/st7789.h>
-/* ESP32-S3-EYE GPIOs *******************************************************/
+#include <arch/board/board.h>
-/* BOOT Button */
+#include "esp32s3_gpio.h"
+#include "esp32s3_spi.h"
+#include "hardware/esp32s3_gpio_sigmap.h"
-#define BUTTON_BOOT 0
+#include "esp32s3-eye.h"
/****************************************************************************
- * Public Types
+ * Pre-processor Definitions
****************************************************************************/
/****************************************************************************
- * Public Data
+ * Private Data
****************************************************************************/
-#ifndef __ASSEMBLY__
+static struct spi_dev_s *g_spidev;
+static struct lcd_dev_s *g_lcd;
/****************************************************************************
- * Public Function Prototypes
+ * Public Functions
****************************************************************************/
/****************************************************************************
- * Name: esp32s3_bringup
+ * Name: board_lcd_initialize
*
* Description:
- * Perform architecture-specific initialization
+ * Initialize the LCD video hardware. The initial state of the LCD is
+ * fully initialized, display memory cleared, and the LCD ready to use, but
+ * with the power setting at 0 (full off).
*
- * CONFIG_BOARD_LATE_INITIALIZE=y :
- * Called from board_late_initialize().
- *
- * CONFIG_BOARD_LATE_INITIALIZE=y && CONFIG_BOARDCTL=y :
- * Called from the NSH library via board_app_initialize()
+ * Returned Value:
+ * Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
-int esp32s3_bringup(void);
+int board_lcd_initialize(void)
+{
+ /* Initialize non-SPI GPIOs */
-/****************************************************************************
- * Name: esp32s3_gpio_init
- *
- * Description:
- * Configure the GPIO driver.
- *
- * Returned Value:
- * Zero (OK) is returned on success; A negated errno value is returned
- * to indicate the nature of any failure.
- *
- ****************************************************************************/
+ esp32s3_configgpio(ESP32S3_EYE_DISPLAY_DC, OUTPUT);
+ esp32s3_configgpio(ESP32S3_EYE_DISPLAY_BCKL, OUTPUT);
+
+ /* Turn on LCD backlight */
+
+ esp32s3_gpiowrite(ESP32S3_EYE_DISPLAY_BCKL, false);
-#ifdef CONFIG_DEV_GPIO
-int esp32s3_gpio_init(void);
-#endif
+ g_spidev = esp32s3_spibus_initialize(ESP32S3_EYE_DISPLAY_SPI);
+ if (!g_spidev)
+ {
+ lcderr("ERROR: Failed to initialize SPI port %d\n",
+ ESP32S3_EYE_DISPLAY_SPI);
+ return -ENODEV;
+ }
+
+ g_lcd = st7789_lcdinitialize(g_spidev);
+ if (!g_lcd)
+ {
+ lcderr("ERROR: st7789_lcdinitialize() failed\n");
+ return -ENODEV;
+ }
+
+ return OK;
+}
/****************************************************************************
- * Name: board_spiflash_init
+ * Name: board_lcd_getdev
*
* Description:
- * Initialize the SPIFLASH and register the MTD device.
+ * Return a a reference to the LCD object for the specified LCD. This
+ * allows support for multiple LCD devices.
+ *
+ * Input Parameters:
+ * devno - LCD device nmber
+ *
+ * Returned Value:
+ * LCD device pointer if success or NULL if failed.
*
****************************************************************************/
-#ifdef CONFIG_ESP32S3_SPIFLASH
-int board_spiflash_init(void);
-#endif
+struct lcd_dev_s *board_lcd_getdev(int devno)
+{
+ if (!g_lcd)
+ {
+ lcderr("ERROR: Failed to bind SPI port %d to LCD %d\n",
+ ESP32S3_EYE_DISPLAY_SPI, devno);
+ }
+ else
+ {
+ lcdinfo("SPI port %d bound to LCD %d\n",
+ ESP32S3_EYE_DISPLAY_SPI,
+ devno);
+ return g_lcd;
+ }
+
+ return NULL;
+}
/****************************************************************************
- * Name: board_i2c_init
+ * Name: board_lcd_uninitialize
*
* Description:
- * Configure the I2C driver.
+ * Uninitialize the LCD support
*
* Returned Value:
- * Zero (OK) is returned on success; A negated errno value is returned
- * to indicate the nature of any failure.
+ * None
*
****************************************************************************/
-#ifdef CONFIG_I2C_DRIVER
-int board_i2c_init(void);
-#endif
+void board_lcd_uninitialize(void)
+{
+ /* Turn the display off */
-#endif /* __ASSEMBLY__ */
-#endif /* __BOARDS_XTENSA_ESP32S3_ESP32S3_EYE_SRC_ESP32S3_EYE_H */
+ g_lcd->setpower(g_lcd, 0);
+}
diff --git a/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3-eye.h b/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3_board_spi.c
similarity index 53%
copy from boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3-eye.h
copy to boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3_board_spi.c
index 2b0d143a43..e7b3261812 100644
--- a/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3-eye.h
+++ b/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3_board_spi.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3-eye.h
+ * boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3_board_spi.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -18,100 +18,109 @@
*
****************************************************************************/
-#ifndef __BOARDS_XTENSA_ESP32S3_ESP32S3_EYE_SRC_ESP32S3_EYE_H
-#define __BOARDS_XTENSA_ESP32S3_ESP32S3_EYE_SRC_ESP32S3_EYE_H
-
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
-#include <nuttx/compiler.h>
-#include <stdint.h>
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-/* ESP32-S3-EYE GPIOs *******************************************************/
+#include <stdint.h>
+#include <stdbool.h>
+#include <debug.h>
-/* BOOT Button */
+#include <nuttx/spi/spi.h>
-#define BUTTON_BOOT 0
+#include "esp32s3_gpio.h"
+#include "esp32s3-eye.h"
/****************************************************************************
- * Public Types
+ * Private Functions
****************************************************************************/
/****************************************************************************
- * Public Data
+ * Public Functions
****************************************************************************/
-#ifndef __ASSEMBLY__
-
/****************************************************************************
- * Public Function Prototypes
+ * Name: esp32s3_spi2_status
****************************************************************************/
-/****************************************************************************
- * Name: esp32s3_bringup
- *
- * Description:
- * Perform architecture-specific initialization
- *
- * CONFIG_BOARD_LATE_INITIALIZE=y :
- * Called from board_late_initialize().
- *
- * CONFIG_BOARD_LATE_INITIALIZE=y && CONFIG_BOARDCTL=y :
- * Called from the NSH library via board_app_initialize()
- *
- ****************************************************************************/
+#ifdef CONFIG_ESP32S3_SPI2
+
+uint8_t esp32s3_spi2_status(struct spi_dev_s *dev, uint32_t devid)
+{
+ uint8_t status = 0;
+
+ return status;
+}
-int esp32s3_bringup(void);
+#endif
/****************************************************************************
- * Name: esp32s3_gpio_init
- *
- * Description:
- * Configure the GPIO driver.
- *
- * Returned Value:
- * Zero (OK) is returned on success; A negated errno value is returned
- * to indicate the nature of any failure.
- *
+ * Name: esp32s3_spi2_cmddata
****************************************************************************/
-#ifdef CONFIG_DEV_GPIO
-int esp32s3_gpio_init(void);
+#if defined(CONFIG_ESP32S3_SPI2) && defined(CONFIG_SPI_CMDDATA)
+
+int esp32s3_spi2_cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
+{
+ if (devid == SPIDEV_DISPLAY(0))
+ {
+ /* This is the Data/Command control pad which determines whether the
+ * data bits are data or a command.
+ */
+
+ esp32s3_gpiowrite(ESP32S3_EYE_DISPLAY_DC, !cmd);
+
+ return OK;
+ }
+
+ spiinfo("devid: %" PRIu32 " CMD: %s\n", devid, cmd ? "command" :
+ "data");
+
+ return -ENODEV;
+}
+
#endif
/****************************************************************************
- * Name: board_spiflash_init
- *
- * Description:
- * Initialize the SPIFLASH and register the MTD device.
- *
+ * Name: esp32s3_spi3_status
****************************************************************************/
-#ifdef CONFIG_ESP32S3_SPIFLASH
-int board_spiflash_init(void);
+#ifdef CONFIG_ESP32S3_SPI3
+
+uint8_t esp32s3_spi3_status(struct spi_dev_s *dev, uint32_t devid)
+{
+ uint8_t status = 0;
+
+ return status;
+}
+
#endif
/****************************************************************************
- * Name: board_i2c_init
- *
- * Description:
- * Configure the I2C driver.
- *
- * Returned Value:
- * Zero (OK) is returned on success; A negated errno value is returned
- * to indicate the nature of any failure.
- *
+ * Name: esp32s3_spi3_cmddata
****************************************************************************/
-#ifdef CONFIG_I2C_DRIVER
-int board_i2c_init(void);
-#endif
+#if defined(CONFIG_ESP32S3_SPI3) && defined(CONFIG_SPI_CMDDATA)
+
+int esp32s3_spi3_cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
+{
+ if (devid == SPIDEV_DISPLAY(0))
+ {
+ /* This is the Data/Command control pad which determines whether the
+ * data bits are data or a command.
+ */
-#endif /* __ASSEMBLY__ */
-#endif /* __BOARDS_XTENSA_ESP32S3_ESP32S3_EYE_SRC_ESP32S3_EYE_H */
+ esp32s3_gpiowrite(CONFIG_ESP32S3_SPI3_MISOPIN, !cmd);
+
+ return OK;
+ }
+
+ spiinfo("devid: %" PRIu32 " CMD: %s\n", devid, cmd ? "command" :
+ "data");
+
+ return -ENODEV;
+}
+
+#endif
diff --git a/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3_bringup.c b/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3_bringup.c
index d075e5a87c..5891609c5d 100644
--- a/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3_bringup.c
+++ b/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3_bringup.c
@@ -70,6 +70,15 @@
# include <nuttx/input/buttons.h>
#endif
+#ifdef CONFIG_ESP32S3_SPI
+# include "esp32s3_spi.h"
+#endif
+
+#ifdef CONFIG_LCD_DEV
+# include <nuttx/board.h>
+# include <nuttx/lcd/lcd_dev.h>
+#endif
+
#include "esp32s3-eye.h"
/****************************************************************************
@@ -206,6 +215,32 @@ int esp32s3_bringup(void)
{
syslog(LOG_ERR, "Failed to initialize GPIO Driver: %d\n", ret);
}
+#endif
+
+#ifdef CONFIG_ESP32S3_EYE_LCD
+
+#ifdef CONFIG_VIDEO_FB
+ ret = fb_register(0, 0);
+ if (ret < 0)
+ {
+ syslog(LOG_ERR, "Failed to initialize Frame Buffer Driver.\n");
+ return ret;
+ }
+#elif defined(CONFIG_LCD)
+ ret = board_lcd_initialize();
+ if (ret < 0)
+ {
+ syslog(LOG_ERR, "ERROR: Failed to initialize LCD.\n");
+ return ret;
+ }
+
+ ret = lcddev_register(0);
+ if (ret < 0)
+ {
+ syslog(LOG_ERR, "ERROR: lcddev_register() failed: %d\n", ret);
+ }
+#endif
+
#endif
/* If we got here then perhaps not all initialization was successful, but
[nuttx] 04/07: fix(esp32s3-eye): unexpose backlight GPIO
Posted by ac...@apache.org.
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/nuttx.git
commit 20b5d2b84c22a243b675305b71ad5bb2baa7d004
Author: Marco Casaroli <ma...@gmail.com>
AuthorDate: Wed Oct 11 19:05:54 2023 +0000
fix(esp32s3-eye): unexpose backlight GPIO
This IO is not exposed in any headers and it is only used for LCD.
So we don't expose it as gpio device.
---
boards/xtensa/esp32s3/esp32s3-eye/include/board.h | 2 +-
boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3_gpio.c | 7 ++-----
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/boards/xtensa/esp32s3/esp32s3-eye/include/board.h b/boards/xtensa/esp32s3/esp32s3-eye/include/board.h
index 19b4a37e7c..ff906a946d 100644
--- a/boards/xtensa/esp32s3/esp32s3-eye/include/board.h
+++ b/boards/xtensa/esp32s3/esp32s3-eye/include/board.h
@@ -45,7 +45,7 @@
/* GPIO pins used by the GPIO Subsystem */
-#define BOARD_NGPIOOUT 2 /* Amount of GPIO Output pins */
+#define BOARD_NGPIOOUT 1 /* Amount of GPIO Output pins */
#define BOARD_NGPIOIN 0
#define BOARD_NGPIOINT 1
diff --git a/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3_gpio.c b/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3_gpio.c
index 1d62732389..e279c18dd1 100644
--- a/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3_gpio.c
+++ b/boards/xtensa/esp32s3/esp32s3-eye/src/esp32s3_gpio.c
@@ -48,12 +48,10 @@
# error "NGPIOINT is > 0 and GPIO interrupts aren't enabled"
#endif
-/* Output pins. GPIO3 is the LED, GPIO48 is the LCD backlight.
- * used.
+/* Output pins. GPIO3 is the LED.
*/
#define GPIO_OUT1 3
-#define GPIO_OUT2 48
/* Input pins. GPIO0 is the BOOT button.
*/
@@ -118,8 +116,7 @@ static const struct gpio_operations_s gpout_ops =
static const uint32_t g_gpiooutputs[BOARD_NGPIOOUT] =
{
- GPIO_OUT1,
- GPIO_OUT2
+ GPIO_OUT1
};
static struct esp32s3gpio_dev_s g_gpout[BOARD_NGPIOOUT];