diff --git a/Makefile b/Makefile index 269df0a68b..6b1befbc1f 100644 --- a/Makefile +++ b/Makefile @@ -464,7 +464,7 @@ shellcheck_all: @make px4_fmu-v5_default shellcheck validate_module_configs: - @find "$(SRC_DIR)"/src/modules "$(SRC_DIR)"/src/drivers "$(SRC_DIR)"/src/lib -name *.yaml -type f -print0 | xargs -0 "$(SRC_DIR)"/Tools/validate_yaml.py --schema-file "$(SRC_DIR)"/validation/module_schema.yaml + @find "$(SRC_DIR)"/src/modules "$(SRC_DIR)"/src/drivers "$(SRC_DIR)"/src/lib -name *.yaml -type f -not -path "$(SRC_DIR)/src/lib/mixer_module/*" -print0 | xargs -0 "$(SRC_DIR)"/Tools/validate_yaml.py --schema-file "$(SRC_DIR)"/validation/module_schema.yaml # Cleanup # -------------------------------------------------------------------- diff --git a/validation/module_schema.yaml b/validation/module_schema.yaml index b9f772d16a..47848d96df 100644 --- a/validation/module_schema.yaml +++ b/validation/module_schema.yaml @@ -97,11 +97,14 @@ parameters: definitions: type: dict keyschema: + # Parameter name type: string regex: '[0-9A-Z_]+(\$\{i\}[0-9A-Z_]*)?' valueschema: - type: dict - schema: + type: dict # This can also be a list containing multiple definitions + # (for multi-instance params with different instance_start) + # Not currently used in any yaml config file. + schema: ¶meter_definition description: type: dict required: true @@ -211,9 +214,127 @@ parameters: # [0, N-1] # Default: 0 type: integer + instance_start_label: + # Allows to use a different instance start for + # labels vs parameter name. + # Default: equal to 'instance_start' + type: integer requires_ethernet: # param is only added if the board has ethernet # support type: boolean +# Configuration for output drivers +actuator_output: + type: dict + schema: + output_groups: + type: list + minlength: 1 + schema: + type: dict + schema: + generator: + # Optional generator that uses additional information for + # param generation (e.g. board-specific config) + type: string + allowed: [ pwm ] + param_prefix: + # parameter prefix for the min/max/disarmed/func params, e.g. PWM_FMU. + # This also needs to be specified in the source code. + type: string + regex: '([0-9A-Z_]+|\$\{PWM_FMU_OR_HIL\})' + required: true + channel_label: + # Human-readable per-channel label (index will be added), e.g. 'PWM Main' + type: string + num_channels: + # (maximum) number of channels + type: integer + standard_params: + type: dict + schema: + disarmed: + type: dict + schema: + min: + # Minimum disarmed value + type: integer + min: 0 + max: 65536 + max: + # Maximum disarmed value + type: integer + min: 0 + max: 65536 + default: + # Default disarmed value + type: integer + min: 0 + max: 65536 + min: + type: dict + schema: + min: + # Minimum minimum value + type: integer + min: 0 + max: 65536 + max: + # Maximum minimum value + type: integer + min: 0 + max: 65536 + default: + # Default minimum value + type: integer + min: 0 + max: 65536 + max: + type: dict + schema: + min: + # Minimum maximum value + type: integer + min: 0 + max: 65536 + max: + # Maximum maximum value + type: integer + min: 0 + max: 65536 + default: + # Default maximum value + type: integer + min: 0 + max: 65536 + failsafe: + type: dict + schema: + min: + # Minimum failsafe value + type: integer + min: 0 + max: 65536 + max: + # Maximum failsafe value + type: integer + min: 0 + max: 65536 + extra_function_groups: + # Additional function groups to add, defined in output_functions.yaml + type: list + schema: + type: string + channel_labels: + # Only used for 'pwm' generator, specifies PWM and Capture pins + type: list + minlength: 2 + maxlength: 2 + schema: + type: string + pwm_timer_param: + # Only used for 'pwm' generator, per-timer config param + type: dict + schema: *parameter_definition