From 41bf301a2e7ce77715679332ca42f8a7c73a2980 Mon Sep 17 00:00:00 2001 From: Jacob Dahl Date: Tue, 17 Mar 2026 21:55:32 -0800 Subject: [PATCH] refactor(drivers/imu/murata/sch16t): convert params.c to module.yaml Convert 1 parameter file(s) from legacy C format to YAML module configuration. --- src/drivers/imu/murata/sch16t/CMakeLists.txt | 2 + src/drivers/imu/murata/sch16t/parameters.c | 90 ------------------- src/drivers/imu/murata/sch16t/parameters.yaml | 57 ++++++++++++ 3 files changed, 59 insertions(+), 90 deletions(-) delete mode 100644 src/drivers/imu/murata/sch16t/parameters.c create mode 100644 src/drivers/imu/murata/sch16t/parameters.yaml diff --git a/src/drivers/imu/murata/sch16t/CMakeLists.txt b/src/drivers/imu/murata/sch16t/CMakeLists.txt index 73b90a12fb..af54d7d06d 100644 --- a/src/drivers/imu/murata/sch16t/CMakeLists.txt +++ b/src/drivers/imu/murata/sch16t/CMakeLists.txt @@ -40,6 +40,8 @@ px4_add_module( SCH16T.hpp sch16t_main.cpp Murata_SCH16T_registers.hpp + MODULE_CONFIG + parameters.yaml DEPENDS drivers_accelerometer drivers_gyroscope diff --git a/src/drivers/imu/murata/sch16t/parameters.c b/src/drivers/imu/murata/sch16t/parameters.c deleted file mode 100644 index 85e6728f64..0000000000 --- a/src/drivers/imu/murata/sch16t/parameters.c +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2024 PX4 Development Team. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name PX4 nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -/** - * Murata SCH16T IMU (external SPI) - * - * @reboot_required true - * @min 0 - * @max 1 - * @group Sensors - * @value 0 Disabled - * @value 1 Enabled - */ -PARAM_DEFINE_INT32(SENS_EN_SCH16T, 0); - -/** - * Gyro filter settings - * - * @value 0 13 Hz - * @value 1 30 Hz - * @value 2 68 Hz - * @value 3 235 Hz - * @value 4 280 Hz - * @value 5 370 Hz - * @value 6 No filter - * - * @reboot_required true - * - */ -PARAM_DEFINE_INT32(SCH16T_GYRO_FILT, 2); - -/** - * Accel filter settings - * - * @value 0 13 Hz - * @value 1 30 Hz - * @value 2 68 Hz - * @value 3 235 Hz - * @value 4 280 Hz - * @value 5 370 Hz - * @value 6 No filter - * - * @reboot_required true - * - */ -PARAM_DEFINE_INT32(SCH16T_ACC_FILT, 6); - -/** - * Gyro and Accel decimation settings - * - * @value 0 None - * @value 1 5900 Hz - * @value 2 2950 Hz - * @value 3 1475 Hz - * @value 4 738 Hz - * - * @reboot_required true - * - */ -PARAM_DEFINE_INT32(SCH16T_DECIM, 4); diff --git a/src/drivers/imu/murata/sch16t/parameters.yaml b/src/drivers/imu/murata/sch16t/parameters.yaml new file mode 100644 index 0000000000..4c4dec25dd --- /dev/null +++ b/src/drivers/imu/murata/sch16t/parameters.yaml @@ -0,0 +1,57 @@ +module_name: sch16t +parameters: +- group: Sensors + definitions: + SENS_EN_SCH16T: + description: + short: Murata SCH16T IMU (external SPI) + type: enum + values: + 0: Disabled + 1: Enabled + default: 0 + reboot_required: true + min: 0 + max: 1 +- group: Miscellaneous + definitions: + SCH16T_GYRO_FILT: + description: + short: Gyro filter settings + type: enum + values: + 0: 13 Hz + 1: 30 Hz + 2: 68 Hz + 3: 235 Hz + 4: 280 Hz + 5: 370 Hz + 6: No filter + default: 2 + reboot_required: true + SCH16T_ACC_FILT: + description: + short: Accel filter settings + type: enum + values: + 0: 13 Hz + 1: 30 Hz + 2: 68 Hz + 3: 235 Hz + 4: 280 Hz + 5: 370 Hz + 6: No filter + default: 6 + reboot_required: true + SCH16T_DECIM: + description: + short: Gyro and Accel decimation settings + type: enum + values: + 0: None + 1: 5900 Hz + 2: 2950 Hz + 3: 1475 Hz + 4: 738 Hz + default: 4 + reboot_required: true