diff options
| author | Jan Špaček <[email protected]> | 2024-05-04 19:42:32 +0200 |
|---|---|---|
| committer | Jan Špaček <[email protected]> | 2024-05-04 19:44:03 +0200 |
| commit | 7b3939ca80f11f348bed4fcd2297a1e4ac07a7e8 (patch) | |
| tree | 22cc4dbf545088f8394637749aa322b7d2385dda /embassy-stm32 | |
| parent | 45a2abc392df91ce6963ac0956f48f22bfa1489b (diff) | |
stm32/timer: add `low_level::Timer::get_clock_frequency()`
Diffstat (limited to 'embassy-stm32')
| -rw-r--r-- | embassy-stm32/src/timer/low_level.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/embassy-stm32/src/timer/low_level.rs b/embassy-stm32/src/timer/low_level.rs index 294dff7ea..aa73986ea 100644 --- a/embassy-stm32/src/timer/low_level.rs +++ b/embassy-stm32/src/timer/low_level.rs | |||
| @@ -321,6 +321,11 @@ impl<'d, T: CoreInstance> Timer<'d, T> { | |||
| 321 | } | 321 | } |
| 322 | } | 322 | } |
| 323 | } | 323 | } |
| 324 | |||
| 325 | /// Get the clock frequency of the timer (before prescaler is applied). | ||
| 326 | pub fn get_clock_frequency(&self) -> Hertz { | ||
| 327 | T::frequency() | ||
| 328 | } | ||
| 324 | } | 329 | } |
| 325 | 330 | ||
| 326 | impl<'d, T: BasicNoCr2Instance> Timer<'d, T> { | 331 | impl<'d, T: BasicNoCr2Instance> Timer<'d, T> { |
