Skyward boardcore
Loading...
Searching...
No Matches
Boardcore::Buzzer Class Reference

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>

Public Member Functions

 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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Buzzer()

Boardcore::Buzzer::Buzzer ( TIM_TypeDef *  timer,
TimerUtils::Channel  channel 
)
inline

Note: The timer must be a General Purpose Timer.

Parameters
timerTimer used to provide the alternating on and off signal.
channelTimer channel to output the signal.

Definition at line 83 of file Buzzer.h.

Member Function Documentation

◆ continuouslyToggle()

void Boardcore::Buzzer::continuouslyToggle ( uint16_t  onTime,
uint16_t  offTime 
)
inline

Turns on and off the buzzer indefinitely with the given timings.

Parameters
onTimeBuzzer on time [ms].
offTimeBuzzer off time [ms].

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
msBeep duration in milliseconds.

Definition at line 107 of file Buzzer.h.


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