4 #include "AudioTools/CoreAudio/AudioTimer/AudioTimerBase.h"
8 class TimerAlarmRepeatingDriverSTM32;
9 static TimerAlarmRepeatingDriverSTM32 *timerAlarmRepeating =
nullptr;
10 typedef void (*repeating_timer_callback_t)(
void *obj);
31 timer_index = timerIdx;
36 if (this->timer !=
nullptr) {
39 this->timer =
new HardwareTimer(timerDef);
48 bool begin(repeating_timer_callback_t callback_f, uint32_t time,
51 if (timer_index>=0) LOGI(
"Using timer TIM%d", timer_index + 1);
52 timer->attachInterrupt(std::bind(callback_f,
object));
57 timer->setOverflow(time * 1000, MICROSEC_FORMAT);
60 timer->setOverflow(time, MICROSEC_FORMAT);
65 timer->setOverflow(time_us, MICROSEC_FORMAT);
80 HardwareTimer *timer =
nullptr;
82 TIM_TypeDef *timers[6] = {TIM1, TIM2, TIM3, TIM4, TIM5};
TimeUnit
Time Units.
Definition: AudioTypes.h:45