111 virtual void reset();
168 virtual void setPrescaler(uint16_t prescalerValue)
final;
220 else if (
timer == TIM2)
222 else if (
timer == TIM3)
224 else if (
timer == TIM4)
226 else if (
timer == TIM5)
228 else if (
timer == TIM6)
230 else if (
timer == TIM7)
232 else if (
timer == TIM8)
234 else if (
timer == TIM9)
236 else if (
timer == TIM10)
238 else if (
timer == TIM11)
240 else if (
timer == TIM12)
242 else if (
timer == TIM13)
244 else if (
timer == TIM14)
268 timer->CR1 |= TIM_CR1_ARPE;
273 timer->CR1 &= ~TIM_CR1_ARPE;
278 timer->CR1 &= ~TIM_CR1_UDIS;
283 timer->CR1 |= TIM_CR1_UDIS;
292 timer->CNT = counterValue;
299 timer->PSC = prescalerValue;
316 timer->ARR = autoReloadValue;
323 timer->DIER &= ~TIM_DIER_UIE;
328 timer->DIER |= TIM_DIER_UDE;
333 timer->DIER &= ~TIM_DIER_UDE;
342 timer->CR1 &= ~TIM_CR1_URS;
347 timer->CR1 |= TIM_CR1_URS;
357 timer->CR2 &= ~TIM_CR2_MMS;
360 timer->CR2 |=
static_cast<uint32_t
>(masterMode);
365 timer->SR &= ~TIM_SR_UIF;
Driver for STM32 basic timers.
BasicTimer(TIM_TypeDef *timer)
Create a BasicTimer object. Note that this does not resets the timer configuration but automatically ...
virtual bool isEnabled() final
virtual void setMasterMode(TimerUtils::MasterMode masterMode)
virtual void enableAutoReloadPreload() final
The auto reload register is buffered.
virtual void enableUpdateInterrupt() final
virtual void disableUpdateInterrupt() final
virtual void enableUpdateDMARequest() final
virtual void disableAutoReloadPreload() final
Tha auto reload register is not buffered.
~BasicTimer()
Disables the peripheral clock.
virtual uint16_t readPrescaler() final
static void clearUpdateInterruptFlag(TIM_TypeDef *timer)
virtual void generateUpdate() final
Re-initializes the timer counter and generate an update of the registers (the prescaler is cleared to...
virtual void setPrescaler(uint16_t prescalerValue) final
Updated the prescaler value.
virtual void disableUGInterruptAndDMA() final
uint16_t readAutoReloadRegister()
virtual void disableOnePulseMode() final
virtual void enableUGInterruptAndDMA() final
virtual void setFrequency(int frequency) final
Allows to set directly the frequency of the timer's clock.
virtual void disableUpdateEventGeneration() final
The UEV is disabled.
virtual void enableUpdateEventGeneration() final
When enabled, the UEV is generated by the counter overflow and software UEV generation.
virtual void reset()
Resets the timer configuration to the default state.
void setAutoReloadRegister(uint16_t autoReloadValue)
virtual int getFrequency() final
virtual void disableUpdateDMARequest() final
void setCounter(uint16_t counterValue)
virtual void enableOnePulseMode() final
bool disablePeripheralClock(void *peripheral)
Disables a peripheral clock source from the APB1 and APB2 peripheral buses.
bool enablePeripheralClock(void *peripheral)
Enables a peripheral clock source from the APB1 and APB2 peripheral buses.
@ UPDATE
The UEV is selected as trigger output.
uint32_t getFrequency(TIM_TypeDef *timer)
Return the timer clock frequency.
uint16_t computePrescalerValue(TIM_TypeDef *timer, int targetFrequency)
Compute the prescaler value for the specified target frequency.
Driver for the VN100S IMU.