APM:Libraries
Public Member Functions | Protected Attributes | Static Protected Attributes | Private Attributes | List of all members
Linux::ToneAlarm Class Reference

#include <ToneAlarm.h>

Inheritance diagram for Linux::ToneAlarm:
[legend]

Public Member Functions

 ToneAlarm ()
 
void set_tune (uint8_t tone)
 
virtual bool init ()
 
virtual void stop ()
 
virtual bool play ()
 
bool is_tune_comp ()
 
bool set_note ()
 
bool init_tune ()
 

Protected Attributes

bool tune_comp
 
bool tune_changed
 
uint8_t default_oct
 
uint8_t default_dur
 
uint16_t bpm
 
uint16_t wholenote
 
uint16_t cur_note
 
uint16_t duration
 
int32_t prev_tune_num
 
uint32_t prev_time
 
int8_t tune_num
 
uint8_t tune_pos
 

Static Protected Attributes

static const char * tune [TONE_NUMBER_OF_TUNES]
 
static bool tune_repeat [TONE_NUMBER_OF_TUNES] = {false,true,false,false,false,false,true,true,false,false,false}
 

Private Attributes

int32_t period_fd
 
int32_t duty_fd
 
int32_t run_fd
 

Detailed Description

Definition at line 113 of file ToneAlarm.h.

Constructor & Destructor Documentation

◆ ToneAlarm()

ToneAlarm::ToneAlarm ( )

Definition at line 39 of file ToneAlarm.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ init()

bool ToneAlarm::init ( void  )
virtual

Reimplemented in Linux::ToneAlarm_Disco.

Definition at line 53 of file ToneAlarm.cpp.

Here is the call graph for this function:

◆ init_tune()

bool ToneAlarm::init_tune ( )

Definition at line 202 of file ToneAlarm.cpp.

Referenced by Linux::Util::_toneAlarm_timer_tick().

Here is the caller graph for this function:

◆ is_tune_comp()

bool ToneAlarm::is_tune_comp ( )

Definition at line 72 of file ToneAlarm.cpp.

Referenced by Linux::Util::_toneAlarm_timer_tick().

Here is the caller graph for this function:

◆ play()

bool ToneAlarm::play ( )
virtual

Reimplemented in Linux::ToneAlarm_Disco.

Definition at line 82 of file ToneAlarm.cpp.

Here is the call graph for this function:

◆ set_note()

bool ToneAlarm::set_note ( )

Definition at line 113 of file ToneAlarm.cpp.

Referenced by Linux::Util::_toneAlarm_timer_tick().

Here is the caller graph for this function:

◆ set_tune()

void ToneAlarm::set_tune ( uint8_t  tone)

Definition at line 67 of file ToneAlarm.cpp.

Referenced by Linux::Util::toneAlarm_set_tune().

Here is the caller graph for this function:

◆ stop()

void ToneAlarm::stop ( )
virtual

Reimplemented in Linux::ToneAlarm_Disco.

Definition at line 77 of file ToneAlarm.cpp.

Referenced by play().

Here is the caller graph for this function:

Member Data Documentation

◆ bpm

uint16_t Linux::ToneAlarm::bpm
protected

Definition at line 131 of file ToneAlarm.h.

Referenced by init_tune().

◆ cur_note

uint16_t Linux::ToneAlarm::cur_note
protected

Definition at line 133 of file ToneAlarm.h.

Referenced by Linux::ToneAlarm_Disco::play(), play(), and set_note().

◆ default_dur

uint8_t Linux::ToneAlarm::default_dur
protected

Definition at line 130 of file ToneAlarm.h.

Referenced by init_tune().

◆ default_oct

uint8_t Linux::ToneAlarm::default_oct
protected

Definition at line 129 of file ToneAlarm.h.

Referenced by init_tune(), and set_note().

◆ duration

uint16_t Linux::ToneAlarm::duration
protected

Definition at line 134 of file ToneAlarm.h.

Referenced by Linux::ToneAlarm_Disco::play(), play(), and set_note().

◆ duty_fd

int32_t Linux::ToneAlarm::duty_fd
private

Definition at line 142 of file ToneAlarm.h.

Referenced by init(), play(), and ToneAlarm().

◆ period_fd

int32_t Linux::ToneAlarm::period_fd
private

Definition at line 141 of file ToneAlarm.h.

Referenced by init(), play(), and ToneAlarm().

◆ prev_time

uint32_t Linux::ToneAlarm::prev_time
protected

Definition at line 136 of file ToneAlarm.h.

Referenced by Linux::ToneAlarm_Disco::play(), and play().

◆ prev_tune_num

int32_t Linux::ToneAlarm::prev_tune_num
protected

Definition at line 135 of file ToneAlarm.h.

Referenced by init_tune(), Linux::ToneAlarm_Disco::play(), and play().

◆ run_fd

int32_t Linux::ToneAlarm::run_fd
private

Definition at line 143 of file ToneAlarm.h.

Referenced by init(), play(), stop(), and ToneAlarm().

◆ tune

const char * ToneAlarm::tune
staticprotected
Initial value:
= {
"Startup:d=8,o=6,b=480:a,d7,c7,a,d7,c7,a,d7,16d7,16c7,16d7,16c7,16d7,16c7,16d7,16c7",
"Error:d=4,o=6,b=400:8a,8a,8a,p,a,a,a,p",
"notify_pos:d=4,o=6,b=400:8e,8e,a",
"notify_neut:d=4,o=6,b=400:8e,e",
"notify_neg:d=4,o=6,b=400:8e,8c,8e,8c,8e,8c",
"arming_warn:d=1,o=4,b=75:g",
"batt_war_slow:d=4,o=6,b=200:8a",
"batt_war_fast:d=4,o=6,b=512:8a,8a,8a,8a,8a,8a,8a,8a,8a,8a,8a,8a,8a,8a,8a,8a,8a",
"GPS_war:d=4,o=6,b=512:a,a,a,1f#",
"Arm_fail:d=4,o=4,b=512:b,a,p",
"para_rel:d=16,o=6,b=512:a,g,a,g,a,g,a,g"}

Definition at line 126 of file ToneAlarm.h.

Referenced by init_tune(), Linux::ToneAlarm_Disco::play(), play(), and set_note().

◆ tune_changed

bool Linux::ToneAlarm::tune_changed
protected

Definition at line 128 of file ToneAlarm.h.

Referenced by Linux::ToneAlarm_Disco::play(), play(), and set_note().

◆ tune_comp

bool Linux::ToneAlarm::tune_comp
protected

Definition at line 125 of file ToneAlarm.h.

Referenced by init_tune(), is_tune_comp(), Linux::ToneAlarm_Disco::play(), and play().

◆ tune_num

int8_t Linux::ToneAlarm::tune_num
protected

◆ tune_pos

uint8_t Linux::ToneAlarm::tune_pos
protected

◆ tune_repeat

bool ToneAlarm::tune_repeat = {false,true,false,false,false,false,true,true,false,false,false}
staticprotected

Definition at line 127 of file ToneAlarm.h.

Referenced by Linux::ToneAlarm_Disco::play(), and play().

◆ wholenote

uint16_t Linux::ToneAlarm::wholenote
protected

Definition at line 132 of file ToneAlarm.h.

Referenced by init_tune(), and set_note().


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