Port-Configurable Serial Drivers
This topic explains how to set up a serial driver so that it can be end-user configured (via parameters) to run on any of a flight controller board's configurable serial ports.
Preconditions
The driver is assumed to already exist, and be started in the shell using the command syntax:
where,
-d
: serial port name.-b
: Baud rate (optional) if the driver supports multiple baud rates. If supported, the driver must allow you to specify the rate as both a bare baudrate and as a parameter name in the form-b p:<param_name>
(which can be parsed withpx4_get_parameter_value()
). :::tip See the gps driver for an example. :::
Making the Driver Configurable
To make driver configurable:
Create a YAML module configuration file:
Add a new file in the driver's source directory named module.yaml
Insert the following text and adjust as needed:
:::note The full documentation of the module configuration file can be found in the validation/module_schema.yaml file. This is also used to validate all configuration files in CI. :::
Add the module configuration to the CMakeLists.txt file for the driver module:
Last updated