tmedicci commented on code in PR #11554:
URL: https://github.com/apache/nuttx/pull/11554#discussion_r1453429517
##########
boards/xtensa/esp32s3/esp32s3-devkit/configs/spi/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-devkit"
+CONFIG_ARCH_BOARD_COMMON=y
+CONFIG_ARCH_BOARD_ESP32S3_DEVKIT=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
Review Comment:
Usually we don't enable `DEBUG_SYMBOLS` in defconfigs. Could you please
disable it on `menuconfig` and regenerate this `defconfig` using `make
savedefconfig`?
##########
boards/xtensa/esp32s3/esp32s3-devkit/src/esp32s3_bringup.c:
##########
@@ -138,6 +143,24 @@ int esp32s3_bringup(void)
}
#endif
+#ifdef CONFIG_ESP32S3_SPI
+ #ifdef CONFIG_ESP32S3_SPI2
+ ret = board_spidev_initialize(2);
Review Comment:
```suggestion
ret = board_spidev_initialize(ESP32S3_SPI2);
```
##########
boards/xtensa/esp32s3/esp32s3-devkit/src/esp32s3_bringup.c:
##########
@@ -138,6 +143,24 @@ int esp32s3_bringup(void)
}
#endif
+#ifdef CONFIG_ESP32S3_SPI
+ #ifdef CONFIG_ESP32S3_SPI2
+ ret = board_spidev_initialize(2);
+ if (ret < 0)
+ {
+ syslog(LOG_ERR, "ERROR: Failed to init spidev 2: %d\n", ret);
+ }
+ #endif
+
+ #ifdef CONFIG_ESP32S3_SPI3
+ ret = board_spidev_initialize(3);
Review Comment:
```suggestion
ret = board_spidev_initialize(ESP32S3_SPI3);
```
##########
boards/xtensa/esp32s3/common/include/esp32s3_board_spidev.h:
##########
@@ -0,0 +1,72 @@
+/****************************************************************************
+ * boards/xtensa/esp32s3/common/include/esp32s3_board_spidev.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __BOARDS_XTENSA_ESP32S3_COMMON_INCLUDE_ESP32S3_BOARD_SPIDEV_H
+#define __BOARDS_XTENSA_ESP32S3_COMMON_INCLUDE_ESP32S3_BOARD_SPIDEV_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef __ASSEMBLY__
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+#undef EXTERN
+#if defined(__cplusplus)
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
+#endif
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+#ifdef CONFIG_ESP32S3_SPI
+/****************************************************************************
+ * Name: board_spidev_initialize
+ *
+ * Description:
+ * Initialize and register SPI driver for the specified SPI port.
+ *
+ ****************************************************************************/
Review Comment:
The description is missing the `Input Parameters` and `Returned Value`
sections. You can refer to the following pages for an example.
https://nuttx.apache.org/docs/latest/contributing/coding_style.html
https://nuttx.apache.org/docs/latest/contributing/coding_style.html#cfilestructure
##########
boards/xtensa/esp32s3/common/src/esp32s3_board_spidev.c:
##########
@@ -0,0 +1,72 @@
+/****************************************************************************
+ * boards/xtensa/esp32s3/common/src/esp32s3_board_spidev.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdio.h>
+#include <debug.h>
+#include <errno.h>
+
+#include <nuttx/spi/spi_transfer.h>
+
+#include "esp32s3_spi.h"
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: board_spidev_initialize
+ *
+ * Description:
+ * Initialize and register SPI driver for the specified SPI port.
+ *
+ ****************************************************************************/
Review Comment:
The description is missing the `Input Parameters` and `Returned Value`
sections. You can refer to the following pages for an example.
https://nuttx.apache.org/docs/latest/contributing/coding_style.html
https://nuttx.apache.org/docs/latest/contributing/coding_style.html#cfilestructure
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]