diff --git a/src/drivers/distance_sensor/lightware_laser_i2c/CMakeLists.txt b/src/drivers/distance_sensor/lightware_laser_i2c/CMakeLists.txt index a19f16d5b9..953e74a093 100644 --- a/src/drivers/distance_sensor/lightware_laser_i2c/CMakeLists.txt +++ b/src/drivers/distance_sensor/lightware_laser_i2c/CMakeLists.txt @@ -35,6 +35,8 @@ px4_add_module( MAIN lightware_laser_i2c SRCS lightware_laser_i2c.cpp + MODULE_CONFIG + parameters.yaml DEPENDS drivers_rangefinder ) diff --git a/src/drivers/distance_sensor/lightware_laser_i2c/parameters.c b/src/drivers/distance_sensor/lightware_laser_i2c/parameters.c deleted file mode 100644 index d549144f9d..0000000000 --- a/src/drivers/distance_sensor/lightware_laser_i2c/parameters.c +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2017 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. - * - ****************************************************************************/ - -/** - * Lightware laser rangefinder (i2c) - * - * @reboot_required true - * @min 0 - * @max 9 - * @group Sensors - * @value 0 Disabled - * @value 1 SF10/a - * @value 2 SF10/b - * @value 3 SF10/c - * @value 4 SF11/c - * @value 5 SF/LW20/b - * @value 6 SF/LW20/c - * @value 7 SF/LW30/d - * @value 8 GRF250 - * @value 9 GRF500 - */ -PARAM_DEFINE_INT32(SENS_EN_SF1XX, 0); - -/** - * Lightware laser rangefinder Operation Mode - * - * @value 0 Disabled - * @value 1 Enabled - * @value 2 Enabled in VTOL MC mode, listen to request from system in FW mode - * - * @min 0 - * @max 2 - */ -PARAM_DEFINE_INT32(SF1XX_MODE, 1); - -/** - * Lightware laser rangefinder Rotation - * - * Distance sensor orientation as MAV_SENSOR_ORIENTATION enum. - * Applies to all models supported by SENS_EN_SF1XX. - * - * @reboot_required true - * @min 0 - * @max 25 - * @group Sensors - * @value 0 Forward - * @value 2 Right - * @value 4 Backward - * @value 6 Left - * @value 24 Upward - * @value 25 Downward - */ -PARAM_DEFINE_INT32(SF1XX_ROT, 25); diff --git a/src/drivers/distance_sensor/lightware_laser_i2c/parameters.yaml b/src/drivers/distance_sensor/lightware_laser_i2c/parameters.yaml new file mode 100644 index 0000000000..f5f3c45a7f --- /dev/null +++ b/src/drivers/distance_sensor/lightware_laser_i2c/parameters.yaml @@ -0,0 +1,54 @@ +module_name: lightware_laser_i2c +parameters: +- group: Sensors + definitions: + SENS_EN_SF1XX: + description: + short: Lightware laser rangefinder (i2c) + type: enum + values: + 0: Disabled + 1: SF10/a + 2: SF10/b + 3: SF10/c + 4: SF11/c + 5: SF/LW20/b + 6: SF/LW20/c + 7: SF/LW30/d + 8: GRF250 + 9: GRF500 + default: 0 + reboot_required: true + min: 0 + max: 9 + SF1XX_ROT: + description: + short: Lightware laser rangefinder Rotation + long: |- + Distance sensor orientation as MAV_SENSOR_ORIENTATION enum. + Applies to all models supported by SENS_EN_SF1XX. + type: enum + values: + 0: Forward + 2: Right + 4: Backward + 6: Left + 24: Upward + 25: Downward + default: 25 + reboot_required: true + min: 0 + max: 25 +- group: Miscellaneous + definitions: + SF1XX_MODE: + description: + short: Lightware laser rangefinder Operation Mode + type: enum + values: + 0: Disabled + 1: Enabled + 2: Enabled in VTOL MC mode, listen to request from system in FW mode + default: 1 + min: 0 + max: 2