This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new c791656daa7 boards/lckfb-szpi-esp32s3: Use the common QMI8658 driver
c791656daa7 is described below
commit c791656daa7aed5c078cdbc6745cd89fbac76294
Author: Huang Qi <[email protected]>
AuthorDate: Mon Nov 2 21:49:52 2026 +0800
boards/lckfb-szpi-esp32s3: Use the common QMI8658 driver
The board carried its own copy of the common esp32s3_qmi8658.c driver.
The two files are functionally identical; the only difference is where
QMI8658_I2C_PORT and QMI8658_I2C_ADDR are taken from: the board-local
copy includes a private board header, the common driver expects them
from <arch/board/board.h>.
Define the two macros in the board's include/board.h (as
esp32s3-ws-lcd128 already does) and drop the board-local copy. This
also fixes the CMake build of the qmi8658 configuration: the common
source, which was dead code so far, needs those defines to compile.
The removal in src/Make.defs has no CMake counterpart: the board's
src/CMakeLists.txt never listed esp32s3_qmi8658.c and the common
driver is already wired in boards/xtensa/esp32s3/common/src.
[skip-cmake-parity]
Assisted-by: pi:glm-5.3-flash
Signed-off-by: Huang Qi <[email protected]>
---
.../esp32s3/lckfb-szpi-esp32s3/include/board.h | 5 ++
.../esp32s3/lckfb-szpi-esp32s3/src/Make.defs | 4 --
.../esp32s3/lckfb-szpi-esp32s3/src/esp32s3-szpi.h | 3 -
.../lckfb-szpi-esp32s3/src/esp32s3_qmi8658.c | 84 ----------------------
4 files changed, 5 insertions(+), 91 deletions(-)
diff --git a/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/include/board.h
b/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/include/board.h
index afe59061b54..623efe4c458 100644
--- a/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/include/board.h
+++ b/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/include/board.h
@@ -51,4 +51,9 @@
#define BOARD_NGPIOIN 1 /* Amount of GPIO Input without Interruption */
#define BOARD_NGPIOINT 1 /* Amount of GPIO Input w/ Interruption pins */
+/* IMU definitions **********************************************************/
+
+#define QMI8658_I2C_PORT (0)
+#define QMI8658_I2C_ADDR (0x6A)
+
#endif /* __BOARDS_XTENSA_ESP32S3_LCKFB_SZPI_ESP32S3_INCLUDE_BOARD_H */
diff --git a/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/src/Make.defs
b/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/src/Make.defs
index 69ec9e3727b..77d7e4dcc65 100644
--- a/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/src/Make.defs
+++ b/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/src/Make.defs
@@ -50,10 +50,6 @@ ifeq ($(CONFIG_INPUT_FT5X06),y)
CSRCS += esp32s3_ft5x06.c
endif
-ifeq ($(CONFIG_SENSORS_QMI8658),y)
-CSRCS += esp32s3_qmi8658.c
-endif
-
ifeq ($(CONFIG_ESP32S3_CAM),y)
CSRCS += esp32s3_board_camera.c
endif
diff --git a/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/src/esp32s3-szpi.h
b/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/src/esp32s3-szpi.h
index 859ee6b93dd..74aefa1ae71 100644
--- a/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/src/esp32s3-szpi.h
+++ b/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/src/esp32s3-szpi.h
@@ -46,9 +46,6 @@
#define FT5X06_I2C_ADDRESS (0x38)
#define FT5X06_FREQUENCY (400000)
-#define QMI8658_I2C_PORT (0)
-#define QMI8658_I2C_ADDR (0x6A)
-
#define ES7210_I2C_ADDR (0x41)
#define ES7210_I2C_FREQ (100000)
#define ES7210_DEVPATH "/dev/audio/pcm_in0"
diff --git a/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/src/esp32s3_qmi8658.c
b/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/src/esp32s3_qmi8658.c
deleted file mode 100644
index d7b9c0984fa..00000000000
--- a/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/src/esp32s3_qmi8658.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/****************************************************************************
- * boards/xtensa/esp32s3/lckfb-szpi-esp32s3/src/esp32s3_qmi8658.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * 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 <unistd.h>
-#include <stdlib.h>
-#include <nuttx/debug.h>
-#include <assert.h>
-#include <nuttx/arch.h>
-#include <nuttx/board.h>
-#include <nuttx/sensors/qmi8658.h>
-
-#include "esp32s3_i2c.h"
-#include "esp32s3-szpi.h"
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: esp32s3_qmi8658_initialize
- *
- * Description:
- * Initialize and register the QMI8658 6-axis IMU sensor driver.
- *
- * This function registers the uORB interface which creates:
- * - "/dev/uorb/sensor_accel0" for accelerometer data
- * - "/dev/uorb/sensor_gyro0" for gyroscope data
- *
- * Input Parameters:
- * None
- *
- * Returned Value:
- * Zero (OK) on success; a negated errno value on failure.
- *
- ****************************************************************************/
-
-int esp32s3_qmi8658_initialize(void)
-{
- struct i2c_master_s *i2c;
- int ret;
-
- i2c = esp32s3_i2cbus_initialize(QMI8658_I2C_PORT);
- if (!i2c)
- {
- i2cerr("Initialize I2C bus failed!\n");
- return -EINVAL;
- }
-
- /* Register QMI8658 uORB sensor device */
-
- ret = qmi8658_uorb_register(0, i2c, QMI8658_I2C_ADDR);
- if (ret < 0)
- {
- syslog(LOG_ERR, "Failed to register QMI8658 uORB driver: %d\n",
- ret);
- }
-
- return ret;
-}