Drivers
Subcategories:
adc
Source: drivers/adc/board_adc
Description
ADC driver.
Usage
ads1115
Source: drivers/adc/ads1115
Usage
atxxxx
Source: drivers/osd/atxxxx
Description
OSD driver for the ATXXXX chip that is mounted on the OmnibusF4SD board for example.
It can be enabled with the OSD_ATXXXX_CFG parameter.
Usage
batmon
Source: drivers/smart_battery/batmon
Description
Driver for SMBUS Communication with BatMon enabled smart-battery Setup/usage information: https://rotoye.com/batmon-tutorial/
Examples
To start at address 0x0B, on bus 4
Usage
batt_smbus
Source: drivers/batt_smbus
Description
Smart battery driver for the BQ40Z50 fuel gauge IC.
Examples
To write to flash to set parameters. address, number_of_bytes, byte0, ... , byteN
Usage
bst
Source: drivers/telemetry/bst
Usage
dshot
Source: drivers/dshot
Description
This is the DShot output driver. It is similar to the fmu driver, and can be used as drop-in replacement to use DShot as ESC communication protocol instead of PWM.
On startup, the module tries to occupy all available pins for DShot output. It skips all pins already in use (e.g. by a camera trigger module).
It supports:
DShot150, DShot300, DShot600, DShot1200
telemetry via separate UART and publishing as esc_status message
sending DShot commands via CLI
Examples
Permanently reverse motor 1:
After saving, the reversed direction will be regarded as the normal one. So to reverse again repeat the same commands.
Usage
fake_gps
Source: examples/fake_gps
Description
Usage
fake_imu
Source: examples/fake_imu
Description
Usage
fake_magnetometer
Source: examples/fake_magnetometer
Description
Publish the earth magnetic field as a fake magnetometer (sensor_mag). Requires vehicle_attitude and vehicle_gps_position.
Usage
gps
Source: drivers/gps
Description
GPS driver module that handles the communication with the device and publishes the position via uORB. It supports multiple protocols (device vendors) and by default automatically selects the correct one.
The module supports a secondary GPS device, specified via -e
parameter. The position will be published on the second uORB topic instance, but it's currently not used by the rest of the system (however the data will be logged, so that it can be used for comparisons).
Implementation
There is a thread for each device polling for data. The GPS protocol classes are implemented with callbacks so that they can be used in other projects as well (eg. QGroundControl uses them too).
Examples
Starting 2 GPS devices (the main GPS on /dev/ttyS3 and the secondary on /dev/ttyS4):
Initiate warm restart of GPS device
Usage
ina226
Source: drivers/power_monitor/ina226
Description
Driver for the INA226 power monitor.
Multiple instances of this driver can run simultaneously, if each instance has a separate bus OR I2C address.
For example, one instance can run on Bus 2, address 0x41, and one can run on Bus 2, address 0x43.
If the INA226 module is not powered, then by default, initialization of the driver will fail. To change this, use the -f flag. If this flag is set, then if initialization fails, the driver will keep trying to initialize again every 0.5 seconds. With this flag set, you can plug in a battery after the driver starts, and it will work. Without this flag set, the battery must be plugged in before starting the driver.
Usage
ina228
Source: drivers/power_monitor/ina228
Description
Driver for the INA228 power monitor.
Multiple instances of this driver can run simultaneously, if each instance has a separate bus OR I2C address.
For example, one instance can run on Bus 2, address 0x45, and one can run on Bus 2, address 0x45.
If the INA228 module is not powered, then by default, initialization of the driver will fail. To change this, use the -f flag. If this flag is set, then if initialization fails, the driver will keep trying to initialize again every 0.5 seconds. With this flag set, you can plug in a battery after the driver starts, and it will work. Without this flag set, the battery must be plugged in before starting the driver.
Usage
ina238
Source: drivers/power_monitor/ina238
Description
Driver for the INA238 power monitor.
Multiple instances of this driver can run simultaneously, if each instance has a separate bus OR I2C address.
For example, one instance can run on Bus 2, address 0x45, and one can run on Bus 2, address 0x45.
If the INA238 module is not powered, then by default, initialization of the driver will fail. To change this, use the -f flag. If this flag is set, then if initialization fails, the driver will keep trying to initialize again every 0.5 seconds. With this flag set, you can plug in a battery after the driver starts, and it will work. Without this flag set, the battery must be plugged in before starting the driver.
Usage
iridiumsbd
Source: drivers/telemetry/iridiumsbd
Description
IridiumSBD driver.
Creates a virtual serial port that another module can use for communication (e.g. mavlink).
Usage
irlock
Source: drivers/irlock
Usage
linux_pwm_out
Source: drivers/linux_pwm_out
Description
Linux PWM output driver with board-specific backend implementation.
Usage
lsm303agr
Source: drivers/magnetometer/lsm303agr
Usage
newpixel
Source: drivers/lights/neopixel
Description
This module is responsible for driving interfasing to the Neopixel Serial LED
Examples
It is typically started with:
To drive all available leds.
Usage
paw3902
Source: drivers/optical_flow/paw3902
Usage
pca9685
Source: drivers/pca9685
Usage
pca9685_pwm_out
Source: drivers/pca9685_pwm_out
Description
This module is responsible for generate pwm pulse with PCA9685 chip.
It listens on the actuator_controls topics, does the mixing and writes the PWM outputs.
Implementation
This module depends on ModuleBase and OutputModuleInterface. IIC communication is based on CDev::I2C
Examples
It is typically started with:
Use the mixer
command to load mixer files. mixer load /dev/pwm_outputX etc/mixers/quad_x.main.mix
The number X can be acquired by executing pca9685_pwm_out status
when this driver is running.
Usage
pcf8583
Source: drivers/rpm/pcf8583
Usage
pmw3901
Source: drivers/optical_flow/pmw3901
Usage
pwm_out
Source: drivers/pwm_out
Description
This module is responsible for driving the output pins. For boards without a separate IO chip (eg. Pixracer), it uses the main channels. On boards with an IO chip (eg. Pixhawk), it uses the AUX channels, and the px4io driver is used for main ones.
It listens on the actuator_controls topics, does the mixing and writes the PWM outputs.
On startup, the module tries to occupy all available pins for PWM/Oneshot output. It skips all pins already in use (e.g. by a camera trigger module).
Implementation
By default the module runs on a work queue with a callback on the uORB actuator_controls topic.
Usage
pwm_out_sim
Source: drivers/pwm_out_sim
Description
Driver for simulated PWM outputs.
Its only function is to take actuator_control
uORB messages, mix them with any loaded mixer and output the result to the actuator_output
uORB topic.
It is used in SITL and HITL.
Usage
px4flow
Source: drivers/optical_flow/px4flow
Usage
px4io
Source: drivers/px4io
Description
Output driver communicating with the IO co-processor.
Usage
rc_input
Source: drivers/rc_input
Description
This module does the RC input parsing and auto-selecting the method. Supported methods are:
PPM
SBUS
DSM
SUMD
ST24
TBS Crossfire (CRSF)
Usage
rgbled
Source: drivers/lights/rgbled_ncp5623c
Usage
roboclaw
Source: drivers/roboclaw
Description
This driver communicates over UART with the Roboclaw motor driver. It performs two tasks:
Control the motors based on the
actuator_controls_0
UOrb topic.Read the wheel encoders and publish the raw data in the
wheel_encoders
UOrb topic
In order to use this driver, the Roboclaw should be put into Packet Serial mode (see the linked documentation), and your flight controller's UART port should be connected to the Roboclaw as shown in the documentation. For Pixhawk 4, use the UART & I2C B
port, which corresponds to /dev/ttyS3
.
Implementation
The main loop of this module (Located in RoboClaw.cpp::task_main()
) performs 2 tasks:
Write
actuator_controls_0
messages to the Roboclaw as they become availableRead encoder data from the Roboclaw at a constant, fixed rate.
Because of the latency of UART, this driver does not write every single actuator_controls_0
message to the Roboclaw immediately. Instead, it is rate limited based on the parameter RBCLW_WRITE_PER
.
On startup, this driver will attempt to read the status of the Roboclaw to verify that it is connected. If this fails, the driver terminates immediately.
Examples
The command to start this driver is:
$ roboclaw start
<device>
is the name of the UART port. On the Pixhawk 4, this is /dev/ttyS3
. <baud>
is te baud rate.
All available commands are:
$ roboclaw start <device> <baud>
$ roboclaw status
$ roboclaw stop
Usage
safety_button
Source: drivers/safety_button
Description
This module is responsible for the safety button. Pressing the safety button 3 times quickly will trigger a GCS pairing request.
Usage
tap_esc
Source: drivers/tap_esc
Description
This module controls the TAP_ESC hardware via UART. It listens on the actuator_controls topics, does the mixing and writes the PWM outputs.
Implementation
Currently the module is implementd as a threaded version only, meaning that it runs in its own thread instead of on the work queue.
Example
The module is typically started with: tap_esc start -d /dev/ttyS2 -n <1-8>
Usage
tone_alarm
Source: drivers/tone_alarm
Description
This module is responsible for the tone alarm.
Usage
vmount
Source: modules/vmount
Description
Mount (Gimbal) control driver. It maps several different input methods (eg. RC or MAVLink) to a configured output (eg. AUX channels or MAVLink).
Documentation how to use it is on the gimbal_control page.
Implementation
Each method is implemented in its own class, and there is a common base class for inputs and outputs. They are connected via an API, defined by the ControlData
data structure. This makes sure that each input method can be used with each output method and new inputs/outputs can be added with minimal effort.
Examples
Test the output by setting a fixed yaw angle (and the other axes to 0):
Usage
voxlpm
Source: drivers/power_monitor/voxlpm
Usage
Last updated