17 #include "../includes/buzzer.h"
18 #include "../includes/buzzer_control.h"
19 #include "../includes/parameters.h"
33 #define TIMER_TICK_PER_MS 10
34 #define BIP (100 * TIMER_TICK_PER_MS)
36 #define BEEEEP (250 * TIMER_TICK_PER_MS)
37 #define BEEEEP_PAUSE BEEEEP
38 #define PAUSE_120S (120 * 1000 * TIMER_TICK_PER_MS)
39 #define PAUSE_20S (20 * 1000 * TIMER_TICK_PER_MS)
40 #define PAUSE_10S (10 * 1000 * TIMER_TICK_PER_MS)
41 #define PAUSE_1S (1 * 1000 * TIMER_TICK_PER_MS)
48 #define BUZZER_HIGH_PRIO_SIZE 40
53 BZ_ON,
BIP,
BZ_OFF,
BIP_PAUSE,
BZ_ON,
BIP,
BZ_OFF,
BIP_PAUSE,
BZ_ON,
BIP,
54 BZ_OFF,
BIP_PAUSE,
BZ_ON,
BIP,
BZ_OFF,
BIP_PAUSE,
BZ_ON,
BEEEEP,
BZ_OFF,
PAUSE_1S,
55 BZ_ON,
BIP,
BZ_OFF,
BIP_PAUSE,
BZ_ON,
BIP,
BZ_OFF,
BIP_PAUSE,
BZ_ON,
BIP,
59 #define BUZZER_MEDIUM_PRIO_SIZE 8
67 #define BUZZER_LOW_PRIO_SIZE 8
75 #define BUZZER_BOOT_SIZE 8
100 #if (STM32_CORE_VERSION < 0x01090000)
140 void Buzzer_Start(
const uint32_t* Buzzer, uint32_t Size,
bool RepeatBuzzer) {
150 BuzzerTim->setOverflow(100, TICK_FORMAT);
const uint32_t Buzzer_High_Prio[BUZZER_HIGH_PRIO_SIZE]
High priority alarm buzzer pattern definition, composed of multiple couple of states (Actif/Inactif) ...
#define BUZZER_HIGH_PRIO_SIZE
High priority alarm buzzer pattern size.
bool Active_Buzzer_Repeat
const uint32_t Buzzer_Boot[BUZZER_BOOT_SIZE]
Boot buzzer pattern definition, composed of multiple couple of states (Actif/Inactif) and duration (m...
const uint32_t Buzzer_Low_Prio[BUZZER_LOW_PRIO_SIZE]
Low priority alarm buzzer pattern definition, composed of multiple couple of states (Actif/Inactif) a...
void Update_IT_callback(HardwareTimer *)
When timer period expires, switch to next state in the pattern of the buzzer.
void Buzzer_Resume()
Resume the muted alarm.
const uint32_t * Active_Buzzer
void Buzzer_High_Prio_Start(void)
Activate the buzzer pattern for high priority alarms.
#define BUZZER_BOOT_SIZE
Boot buzzer pattern size.
void Buzzer_Low_Prio_Start(void)
Activate the buzzer pattern for low priority alarms.
#define BUZZER_LOW_PRIO_SIZE
Low priority alarm buzzer pattern size.
void Buzzer_Start(const uint32_t *Buzzer, uint32_t Size, bool RepeatBuzzer)
Generic function to activate a buzzer.
uint32_t Active_Buzzer_Index
bool Active_Buzzer_Has_Begun
void Buzzer_Mute()
Mute the buzzer for 120s.
void Buzzer_Boot_Start(void)
Activate boot bip.
const uint32_t Buzzer_Medium_Prio[BUZZER_MEDIUM_PRIO_SIZE]
Medium priority alarm buzzer pattern definition, composed of multiple couple of states (Actif/Inactif...
#define TIMER_TICK_PER_MS
HardwareTimer * BuzzerTim
uint32_t Active_Buzzer_Size
#define BUZZER_MEDIUM_PRIO_SIZE
Medium priority alarm buzzer pattern size.
void Buzzer_Stop(void)
Stop Buzzer.
void Buzzer_Init()
Initialization of HardwareTimer for buzzer.
uint32_t BuzzerTimerChannel
void Buzzer_Medium_Prio_Start(void)
Activate the buzzer pattern for medium priority alarms.
#define BUZZER_TIMER
Hardware Timer to use for the buzzer.
#define BUZZER_TIM_CHANNEL
Hardware Timer channel to use for the buzzer.
void BuzzerControl_On(void)
Switch buzzer ON.
void BuzzerControl_Off(void)
Switch buzzer OFF.