Merge pull request #2908 from honzasp/timer-get-clock-frequency

stm32/timer: add `low_level::Timer::get_clock_frequency()`
This commit is contained in:
Dario Nieuwenhuis 2024-05-04 20:01:52 +00:00 committed by GitHub
commit 2ba8a7b015
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -321,6 +321,11 @@ impl<'d, T: CoreInstance> Timer<'d, T> {
}
}
}
/// Get the clock frequency of the timer (before prescaler is applied).
pub fn get_clock_frequency(&self) -> Hertz {
T::frequency()
}
}
impl<'d, T: BasicNoCr2Instance> Timer<'d, T> {