APM:Libraries
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
Buzzer Class Reference

#include <Buzzer.h>

Inheritance diagram for Buzzer:
[legend]
Collaboration diagram for Buzzer:
[legend]

Classes

struct  buzzer_flag_type
 buzzer_flag_type - bitmask of current state and ap_notify states we track More...
 

Public Types

enum  BuzzerPattern {
  NONE = 0, SINGLE_BUZZ = 1, DOUBLE_BUZZ = 2, GPS_GLITCH = 3,
  ARMING_BUZZ = 4, BARO_GLITCH = 5, EKF_BAD = 6
}
 

Public Member Functions

 Buzzer ()
 Constructor. More...
 
bool init (void)
 init - initialise the buzzer More...
 
void update ()
 update - updates buzzer according to timed_updated. Should be called at 50Hz More...
 
void on (bool on_off)
 on - turns the buzzer on or off More...
 
void play_pattern (BuzzerPattern pattern_id)
 play_pattern - plays the defined buzzer pattern More...
 
- Public Member Functions inherited from NotifyDevice
virtual ~NotifyDevice ()
 
virtual void handle_led_control (mavlink_message_t *msg)
 
virtual void handle_play_tune (mavlink_message_t *msg)
 

Private Attributes

struct Buzzer::buzzer_flag_type _flags
 
uint8_t _counter
 
BuzzerPattern _pattern
 
uint8_t _pattern_counter
 
uint32_t _arming_buzz_start_ms
 
uint8_t _pin
 

Additional Inherited Members

- Public Attributes inherited from NotifyDevice
const AP_NotifypNotify
 

Detailed Description

Definition at line 26 of file Buzzer.h.

Member Enumeration Documentation

◆ BuzzerPattern

Enumerator
NONE 
SINGLE_BUZZ 
DOUBLE_BUZZ 
GPS_GLITCH 
ARMING_BUZZ 
BARO_GLITCH 
EKF_BAD 

Definition at line 47 of file Buzzer.h.

Constructor & Destructor Documentation

◆ Buzzer()

Buzzer::Buzzer ( )
inline

Constructor.

Definition at line 30 of file Buzzer.h.

Here is the call graph for this function:

Member Function Documentation

◆ init()

bool Buzzer::init ( void  )
virtual

init - initialise the buzzer

Implements NotifyDevice.

Definition at line 34 of file Buzzer.cpp.

Referenced by Buzzer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on()

void Buzzer::on ( bool  on_off)

on - turns the buzzer on or off

Definition at line 210 of file Buzzer.cpp.

Referenced by Buzzer(), init(), and update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ play_pattern()

void Buzzer::play_pattern ( BuzzerPattern  pattern_id)

play_pattern - plays the defined buzzer pattern

Definition at line 225 of file Buzzer.cpp.

Referenced by update().

Here is the caller graph for this function:

◆ update()

void Buzzer::update ( void  )
virtual

update - updates buzzer according to timed_updated. Should be called at 50Hz

Implements NotifyDevice.

Definition at line 55 of file Buzzer.cpp.

Referenced by Buzzer().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _arming_buzz_start_ms

uint32_t Buzzer::_arming_buzz_start_ms
private

Definition at line 74 of file Buzzer.h.

Referenced by update().

◆ _counter

uint8_t Buzzer::_counter
private

Definition at line 71 of file Buzzer.h.

Referenced by update().

◆ _flags

struct Buzzer::buzzer_flag_type Buzzer::_flags
private

Referenced by init(), on(), and update().

◆ _pattern

BuzzerPattern Buzzer::_pattern
private

Definition at line 72 of file Buzzer.h.

Referenced by play_pattern(), and update().

◆ _pattern_counter

uint8_t Buzzer::_pattern_counter
private

Definition at line 73 of file Buzzer.h.

Referenced by play_pattern(), and update().

◆ _pin

uint8_t Buzzer::_pin
private

Definition at line 75 of file Buzzer.h.

Referenced by init(), and on().


The documentation for this class was generated from the following files: