Firmware
|
Driver for the PX4 audio alarm port, /dev/tone_alarm. More...
#include <lib/tunes/tune_definition.h>
#include <uORB/topics/tune_control.h>
Go to the source code of this file.
Driver for the PX4 audio alarm port, /dev/tone_alarm.
The tone_alarm driver supports a set of predefined "alarm" patterns and one user-supplied pattern. Patterns are ordered by priority, with a higher-priority pattern interrupting any lower-priority pattern that might be playing.
The TONE_SET_ALARM ioctl can be used to select a predefined alarm pattern, from 1 - <TBD>. Selecting pattern zero silences the alarm.
To supply a custom pattern, write an array of 1 - <TBD> tone_note structures to /dev/tone_alarm. The custom pattern has a priority of zero.
Patterns will normally play once and then silence (if a pattern was overridden it will not resume). A pattern may be made to repeat by inserting a note with the duration set to DURATION_REPEAT. This pattern will loop until either a higher-priority pattern is started or pattern zero is requested via the ioctl.