PX4 Firmware
PX4 Autopilot Software http://px4.io
|
Driver for the PX4 audio alarm port, /dev/tone_alarm. More...
Go to the source code of this file.
Namespaces | |
ToneAlarmInterface | |
Macros | |
#define | CBRK_BUZZER_KEY 782097 |
#define | CBRK_OFF 0 |
#define | CBRK_ON 1 |
#define | CBRK_UNINIT 2 |
#define | _TONE_ALARM_BASE 0x7400 |
#define | TONE_SET_ALARM _PX4_IOC(_TONE_ALARM_BASE, 1) |
#define | TONE_ALARM0_DEVICE_PATH "/dev/tone_alarm0" |
Functions | |
void | ToneAlarmInterface::init () |
Activates/configures the hardware registers. More... | |
void | ToneAlarmInterface::start_note (unsigned frequency) |
Starts playing the note. More... | |
void | ToneAlarmInterface::stop_note () |
Stops playing the current note and makes the player 'safe'. More... | |
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.
Definition in file drv_tone_alarm.h.
#define _TONE_ALARM_BASE 0x7400 |
Definition at line 70 of file drv_tone_alarm.h.
#define CBRK_BUZZER_KEY 782097 |
Definition at line 65 of file drv_tone_alarm.h.
Referenced by ToneAlarm::start_note().
#define CBRK_OFF 0 |
Definition at line 66 of file drv_tone_alarm.h.
Referenced by ToneAlarm::start_note().
#define CBRK_ON 1 |
Definition at line 67 of file drv_tone_alarm.h.
#define CBRK_UNINIT 2 |
Definition at line 68 of file drv_tone_alarm.h.
Referenced by ToneAlarm::start_note().
#define TONE_ALARM0_DEVICE_PATH "/dev/tone_alarm0" |
Definition at line 72 of file drv_tone_alarm.h.
Referenced by MavlinkReceiver::handle_message_play_tune().
#define TONE_SET_ALARM _PX4_IOC(_TONE_ALARM_BASE, 1) |
Definition at line 71 of file drv_tone_alarm.h.
anonymous enum |
Definition at line 75 of file drv_tone_alarm.h.