diff --git a/src/drivers/uavcannode/CMakeLists.txt b/src/drivers/uavcannode/CMakeLists.txt index d170bde437..2027237ab8 100644 --- a/src/drivers/uavcannode/CMakeLists.txt +++ b/src/drivers/uavcannode/CMakeLists.txt @@ -148,6 +148,8 @@ px4_add_module( UavcanNode.hpp UavcanNodeParamManager.hpp UavcanNodeParamManager.cpp + MODULE_CONFIG + uavcannode_params.yaml DEPENDS arch_watchdog_iwdg px4_uavcan_dsdlc diff --git a/src/drivers/uavcannode/uavcannode_params.c b/src/drivers/uavcannode/uavcannode_params.c deleted file mode 100644 index a87817b885..0000000000 --- a/src/drivers/uavcannode/uavcannode_params.c +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2014-2020 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. - * - ****************************************************************************/ - -/** - * UAVCAN CAN node ID (0 for dynamic allocation). - * - * @min 0 - * @max 127 - * @group UAVCAN - */ -PARAM_DEFINE_INT32(CANNODE_NODE_ID, 0); - -/** - * UAVCAN CAN bus bitrate. - * - * @min 20000 - * @max 1000000 - * @group UAVCAN - */ -PARAM_DEFINE_INT32(CANNODE_BITRATE, 1000000); - -/** - * CAN built-in bus termination - * - * @boolean - * @max 1 - * @group UAVCAN - */ -PARAM_DEFINE_INT32(CANNODE_TERM, 0); - -/** - * Enable MovingBaselineData subscription - * - * @boolean - * @max 1 - * @reboot_required true - * @group UAVCAN - */ -PARAM_DEFINE_INT32(CANNODE_SUB_MBD, 0); - -/** - * Enable RTCM subscription - * - * @boolean - * @reboot_required true - * @group UAVCAN - */ -PARAM_DEFINE_INT32(CANNODE_SUB_RTCM, 0); - -/** - * Enable MovingBaselineData publication - * - * @boolean - * @reboot_required true - * @group UAVCAN - */ -PARAM_DEFINE_INT32(CANNODE_PUB_MBD, 0); - -/** - * Enable RawIMU pub - * - * @boolean - * @max 1 - * @group UAVCAN - */ -PARAM_DEFINE_INT32(CANNODE_PUB_IMU, 0); - -/** - * Enable barometer publication - * - * Enables publication of static pressure and static temperature - * from the barometer sensor over UAVCAN. - * - * @boolean - * @max 1 - * @reboot_required true - * @group UAVCAN - */ -PARAM_DEFINE_INT32(CANNODE_PUB_BAR, 1); - -/** - * Enable magnetometer publication - * - * Enables publication of magnetic field strength - * from the magnetometer sensor over UAVCAN. - * - * @boolean - * @max 1 - * @reboot_required true - * @group UAVCAN - */ -PARAM_DEFINE_INT32(CANNODE_PUB_MAG, 1); diff --git a/src/drivers/uavcannode/uavcannode_params.yaml b/src/drivers/uavcannode/uavcannode_params.yaml new file mode 100644 index 0000000000..3fad17cbaf --- /dev/null +++ b/src/drivers/uavcannode/uavcannode_params.yaml @@ -0,0 +1,69 @@ +module_name: uavcannode +parameters: +- group: UAVCAN + definitions: + CANNODE_NODE_ID: + description: + short: UAVCAN CAN node ID (0 for dynamic allocation) + type: int32 + default: 0 + min: 0 + max: 127 + CANNODE_BITRATE: + description: + short: UAVCAN CAN bus bitrate + type: int32 + default: 1000000 + min: 20000 + max: 1000000 + CANNODE_TERM: + description: + short: CAN built-in bus termination + type: boolean + default: 0 + max: 1 + CANNODE_SUB_MBD: + description: + short: Enable MovingBaselineData subscription + type: boolean + default: 0 + max: 1 + reboot_required: true + CANNODE_SUB_RTCM: + description: + short: Enable RTCM subscription + type: boolean + default: 0 + reboot_required: true + CANNODE_PUB_MBD: + description: + short: Enable MovingBaselineData publication + type: boolean + default: 0 + reboot_required: true + CANNODE_PUB_IMU: + description: + short: Enable RawIMU pub + type: boolean + default: 0 + max: 1 + CANNODE_PUB_BAR: + description: + short: Enable barometer publication + long: |- + Enables publication of static pressure and static temperature + from the barometer sensor over UAVCAN. + type: boolean + default: 1 + max: 1 + reboot_required: true + CANNODE_PUB_MAG: + description: + short: Enable magnetometer publication + long: |- + Enables publication of magnetic field strength + from the magnetometer sensor over UAVCAN. + type: boolean + default: 1 + max: 1 + reboot_required: true