diff options
| author | Dario Nieuwenhuis <[email protected]> | 2025-03-26 16:01:37 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2025-03-27 15:18:06 +0100 |
| commit | d41eeeae79388f219bf6a84e2f7bde9f6b532516 (patch) | |
| tree | 678b6fc732216e529dc38e6f65b72a309917ac32 /embassy-stm32/src/timer/low_level.rs | |
| parent | 9edf5b7f049f95742b60b041e4443967d8a6b708 (diff) | |
Remove Peripheral trait, rename PeripheralRef->Peri.
Diffstat (limited to 'embassy-stm32/src/timer/low_level.rs')
| -rw-r--r-- | embassy-stm32/src/timer/low_level.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/embassy-stm32/src/timer/low_level.rs b/embassy-stm32/src/timer/low_level.rs index 5b0c95109..8fc32c1f3 100644 --- a/embassy-stm32/src/timer/low_level.rs +++ b/embassy-stm32/src/timer/low_level.rs | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | 8 | ||
| 9 | use core::mem::ManuallyDrop; | 9 | use core::mem::ManuallyDrop; |
| 10 | 10 | ||
| 11 | use embassy_hal_internal::{into_ref, Peripheral, PeripheralRef}; | 11 | use embassy_hal_internal::Peri; |
| 12 | // Re-export useful enums | 12 | // Re-export useful enums |
| 13 | pub use stm32_metapac::timer::vals::{FilterValue, Sms as SlaveMode, Ts as TriggerSource}; | 13 | pub use stm32_metapac::timer::vals::{FilterValue, Sms as SlaveMode, Ts as TriggerSource}; |
| 14 | 14 | ||
| @@ -181,7 +181,7 @@ impl From<OutputPolarity> for bool { | |||
| 181 | 181 | ||
| 182 | /// Low-level timer driver. | 182 | /// Low-level timer driver. |
| 183 | pub struct Timer<'d, T: CoreInstance> { | 183 | pub struct Timer<'d, T: CoreInstance> { |
| 184 | tim: PeripheralRef<'d, T>, | 184 | tim: Peri<'d, T>, |
| 185 | } | 185 | } |
| 186 | 186 | ||
| 187 | impl<'d, T: CoreInstance> Drop for Timer<'d, T> { | 187 | impl<'d, T: CoreInstance> Drop for Timer<'d, T> { |
| @@ -192,9 +192,7 @@ impl<'d, T: CoreInstance> Drop for Timer<'d, T> { | |||
| 192 | 192 | ||
| 193 | impl<'d, T: CoreInstance> Timer<'d, T> { | 193 | impl<'d, T: CoreInstance> Timer<'d, T> { |
| 194 | /// Create a new timer driver. | 194 | /// Create a new timer driver. |
| 195 | pub fn new(tim: impl Peripheral<P = T> + 'd) -> Self { | 195 | pub fn new(tim: Peri<'d, T>) -> Self { |
| 196 | into_ref!(tim); | ||
| 197 | |||
| 198 | rcc::enable_and_reset::<T>(); | 196 | rcc::enable_and_reset::<T>(); |
| 199 | 197 | ||
| 200 | Self { tim } | 198 | Self { tim } |
