software:firmware
MakAir Firmware
|
Buzzer related functions. More...
#include "Arduino.h"
#include "../includes/buzzer.h"
#include "../includes/buzzer_control.h"
#include "../includes/parameters.h"
Go to the source code of this file.
Macros | |
#define | BZ_OFF (0u) |
#define | BZ_ON (1u) |
#define | BUZZER_HIGH_PRIO_SIZE 40 |
High priority alarm buzzer pattern size. More... | |
#define | BUZZER_MEDIUM_PRIO_SIZE 8 |
Medium priority alarm buzzer pattern size. More... | |
#define | BUZZER_LOW_PRIO_SIZE 8 |
Low priority alarm buzzer pattern size. More... | |
#define | BUZZER_BOOT_SIZE 8 |
Boot buzzer pattern size. More... | |
Definition of bips durations | |
Internals 10 ticks = 1 ms
As waiting times defined below are greater than 2^16, the timer must be a 32 bits timer. | |
#define | TIMER_TICK_PER_MS 10 |
#define | BIP (100 * TIMER_TICK_PER_MS) |
#define | BIP_PAUSE BIP |
#define | BEEEEP (250 * TIMER_TICK_PER_MS) |
#define | BEEEEP_PAUSE BEEEEP |
#define | PAUSE_120S (120 * 1000 * TIMER_TICK_PER_MS) |
#define | PAUSE_20S (20 * 1000 * TIMER_TICK_PER_MS) |
#define | PAUSE_10S (10 * 1000 * TIMER_TICK_PER_MS) |
#define | PAUSE_1S (1 * 1000 * TIMER_TICK_PER_MS) |
Functions | |
void | Update_IT_callback (HardwareTimer *) |
When timer period expires, switch to next state in the pattern of the buzzer. More... | |
void | Buzzer_Init () |
Initialization of HardwareTimer for buzzer. More... | |
void | Buzzer_Start (const uint32_t *Buzzer, uint32_t Size, bool RepeatBuzzer) |
Generic function to activate a buzzer. More... | |
void | Buzzer_Mute () |
Mute the buzzer for 120s. More... | |
void | Buzzer_Resume () |
Resume the muted alarm. More... | |
void | Buzzer_High_Prio_Start (void) |
Activate the buzzer pattern for high priority alarms. More... | |
void | Buzzer_Medium_Prio_Start (void) |
Activate the buzzer pattern for medium priority alarms. More... | |
void | Buzzer_Low_Prio_Start (void) |
Activate the buzzer pattern for low priority alarms. More... | |
void | Buzzer_Boot_Start (void) |
Activate boot bip. More... | |
void | Buzzer_Stop (void) |
Stop Buzzer. More... | |
Variables | |
const uint32_t | Buzzer_High_Prio [BUZZER_HIGH_PRIO_SIZE] |
High priority alarm buzzer pattern definition, composed of multiple couple of states (Actif/Inactif) and duration (miliseconds) More... | |
const uint32_t | Buzzer_Medium_Prio [BUZZER_MEDIUM_PRIO_SIZE] |
Medium priority alarm buzzer pattern definition, composed of multiple couple of states (Actif/Inactif) and duration (miliseconds) More... | |
const uint32_t | Buzzer_Low_Prio [BUZZER_LOW_PRIO_SIZE] |
Low priority alarm buzzer pattern definition, composed of multiple couple of states (Actif/Inactif) and duration (miliseconds) More... | |
const uint32_t | Buzzer_Boot [BUZZER_BOOT_SIZE] |
Boot buzzer pattern definition, composed of multiple couple of states (Actif/Inactif) and duration (miliseconds) More... | |
const uint32_t * | Active_Buzzer = nullptr |
uint32_t | Active_Buzzer_Index = 0 |
uint32_t | Active_Buzzer_Size = 2 |
bool | Active_Buzzer_Repeat = false |
bool | Active_Buzzer_Has_Begun = false |
bool | Buzzer_Muted = false |
HardwareTimer * | BuzzerTim |
uint32_t | BuzzerTimerChannel |
Buzzer related functions.
Definition in file buzzer.cpp.
#define BEEEEP (250 * TIMER_TICK_PER_MS) |
Definition at line 36 of file buzzer.cpp.
#define BEEEEP_PAUSE BEEEEP |
Definition at line 37 of file buzzer.cpp.
#define BIP (100 * TIMER_TICK_PER_MS) |
Definition at line 34 of file buzzer.cpp.
#define BIP_PAUSE BIP |
Definition at line 35 of file buzzer.cpp.
#define BUZZER_BOOT_SIZE 8 |
Boot buzzer pattern size.
Definition at line 75 of file buzzer.cpp.
#define BUZZER_HIGH_PRIO_SIZE 40 |
High priority alarm buzzer pattern size.
Definition at line 48 of file buzzer.cpp.
#define BUZZER_LOW_PRIO_SIZE 8 |
Low priority alarm buzzer pattern size.
Definition at line 67 of file buzzer.cpp.
#define BUZZER_MEDIUM_PRIO_SIZE 8 |
Medium priority alarm buzzer pattern size.
Definition at line 59 of file buzzer.cpp.
#define BZ_OFF (0u) |
Definition at line 44 of file buzzer.cpp.
#define BZ_ON (1u) |
Definition at line 45 of file buzzer.cpp.
#define PAUSE_10S (10 * 1000 * TIMER_TICK_PER_MS) |
Definition at line 40 of file buzzer.cpp.
#define PAUSE_120S (120 * 1000 * TIMER_TICK_PER_MS) |
Definition at line 38 of file buzzer.cpp.
#define PAUSE_1S (1 * 1000 * TIMER_TICK_PER_MS) |
Definition at line 41 of file buzzer.cpp.
#define PAUSE_20S (20 * 1000 * TIMER_TICK_PER_MS) |
Definition at line 39 of file buzzer.cpp.
#define TIMER_TICK_PER_MS 10 |
Definition at line 33 of file buzzer.cpp.
void Buzzer_Boot_Start | ( | void | ) |
Activate boot bip.
Definition at line 194 of file buzzer.cpp.
void Buzzer_High_Prio_Start | ( | void | ) |
Activate the buzzer pattern for high priority alarms.
Definition at line 186 of file buzzer.cpp.
void Buzzer_Init | ( | ) |
Initialization of HardwareTimer for buzzer.
Definition at line 128 of file buzzer.cpp.
void Buzzer_Low_Prio_Start | ( | void | ) |
Activate the buzzer pattern for low priority alarms.
Definition at line 192 of file buzzer.cpp.
void Buzzer_Medium_Prio_Start | ( | void | ) |
Activate the buzzer pattern for medium priority alarms.
Definition at line 188 of file buzzer.cpp.
void Buzzer_Mute | ( | void | ) |
void Buzzer_Resume | ( | void | ) |
void Buzzer_Start | ( | const uint32_t * | Buzzer, |
uint32_t | Size, | ||
bool | RepeatBuzzer | ||
) |
Generic function to activate a buzzer.
Buzzer | Buzzer pattern array |
Size | Size of the buzzer pattern array |
RepeatBuzzer | Is pattern repeating after its end |
Definition at line 140 of file buzzer.cpp.
void Buzzer_Stop | ( | void | ) |
void Update_IT_callback | ( | HardwareTimer * | ) |
When timer period expires, switch to next state in the pattern of the buzzer.
Definition at line 102 of file buzzer.cpp.
const uint32_t* Active_Buzzer = nullptr |
Definition at line 84 of file buzzer.cpp.
bool Active_Buzzer_Has_Begun = false |
Definition at line 88 of file buzzer.cpp.
uint32_t Active_Buzzer_Index = 0 |
Definition at line 85 of file buzzer.cpp.
bool Active_Buzzer_Repeat = false |
Definition at line 87 of file buzzer.cpp.
uint32_t Active_Buzzer_Size = 2 |
Definition at line 86 of file buzzer.cpp.
const uint32_t Buzzer_Boot[BUZZER_BOOT_SIZE] |
Boot buzzer pattern definition, composed of multiple couple of states (Actif/Inactif) and duration (miliseconds)
Definition at line 79 of file buzzer.cpp.
const uint32_t Buzzer_High_Prio[BUZZER_HIGH_PRIO_SIZE] |
High priority alarm buzzer pattern definition, composed of multiple couple of states (Actif/Inactif) and duration (miliseconds)
Definition at line 52 of file buzzer.cpp.
const uint32_t Buzzer_Low_Prio[BUZZER_LOW_PRIO_SIZE] |
const uint32_t Buzzer_Medium_Prio[BUZZER_MEDIUM_PRIO_SIZE] |
Medium priority alarm buzzer pattern definition, composed of multiple couple of states (Actif/Inactif) and duration (miliseconds)
Definition at line 63 of file buzzer.cpp.
bool Buzzer_Muted = false |
Definition at line 89 of file buzzer.cpp.
HardwareTimer* BuzzerTim |
Definition at line 91 of file buzzer.cpp.
uint32_t BuzzerTimerChannel |
Definition at line 92 of file buzzer.cpp.