Skip to main content

Module timer

Module timer 

Source
Expand description

Timers: the counter core shared by every TIMER peripheral.

A timer counts CK_TIMERx ticks divided by PSC + 1, and restarts from zero once the count reaches CAR. Everything else a timer can do — PWM, input capture, triggering other peripherals — is built on top of that core.

ⓘ
let timer = dp.timer5.constrain(&mut rcu);
let mut timer = timer.start_interval(500.millis());
timer.wait();

Structs§

Capture
A free running timer whose channels timestamp edges on their pins.
CaptureChannel
One capture input of a timer, configured and ready to be armed.
CountDownTimer
A running timer, counting down the interval Timer::start was given.
Delay
A timer given over to blocking delays.
Pwm
A timer running as the period behind one or more PWM channels.
PwmChannel
One PWM output of a timer, configured and ready to take a duty value.
Timer
A stopped timer, holding the peripheral and the frequency feeding it.

Enums§

Edge
Which edge on the pin makes a channel take its snapshot.
Error
What can go wrong while reading a capture.
Event
A timer event that can raise an interrupt.

Traits§

CaptureOps
The input capture half of one channel, numbered by C like PwmOps.
ChannelEnable
The switch turning channel C on, whichever direction it points.
ChannelPin
Marks a pin the silicon routes to channel C of TIMERX, in the right alternate function.
Instance
A timer peripheral, tying it to the bus that clocks it.
PrimaryOutput
The output switch shared by every channel of a timer that has one.
PwmOps
Register operations on compare channel C of a timer.
TimerExt
Entry point on the raw peripheral.