This driver does not provide a square wave signal but instead is a simple utility that provides long PWM signals to make the buzzer beep on and off.
More...
#include <Buzzer.h>
|
| Buzzer (TIM_TypeDef *timer, TimerUtils::Channel channel) |
|
void | on () |
| Turns on the buzzer.
|
|
void | off () |
| Turns off the buzzer.
|
|
void | oneTimeToggle (uint16_t ms) |
| Turns on the buzzer for the specified amount of time.
|
|
void | continuouslyToggle (uint16_t onTime, uint16_t offTime) |
| Turns on and off the buzzer indefinitely with the given timings.
|
|
This driver does not provide a square wave signal but instead is a simple utility that provides long PWM signals to make the buzzer beep on and off.
Definition at line 36 of file Buzzer.h.
◆ Buzzer()
Note: The timer must be a General Purpose Timer.
- Parameters
-
timer | Timer used to provide the alternating on and off signal. |
channel | Timer channel to output the signal. |
Definition at line 83 of file Buzzer.h.
◆ continuouslyToggle()
void Boardcore::Buzzer::continuouslyToggle |
( |
uint16_t |
onTime, |
|
|
uint16_t |
offTime |
|
) |
| |
|
inline |
Turns on and off the buzzer indefinitely with the given timings.
- Parameters
-
Definition at line 137 of file Buzzer.h.
◆ off()
void Boardcore::Buzzer::off |
( |
| ) |
|
|
inline |
Turns off the buzzer.
Note: disables and resets the timer.
Definition at line 101 of file Buzzer.h.
◆ on()
void Boardcore::Buzzer::on |
( |
| ) |
|
|
inline |
Turns on the buzzer.
Note: Keeps the timer off.
Definition at line 88 of file Buzzer.h.
◆ oneTimeToggle()
void Boardcore::Buzzer::oneTimeToggle |
( |
uint16_t |
ms | ) |
|
|
inline |
Turns on the buzzer for the specified amount of time.
Note: This function wait for the given duration with Thread::sleep.
- Parameters
-
ms | Beep duration in milliseconds. |
Definition at line 107 of file Buzzer.h.
The documentation for this class was generated from the following file: