diff options
| author | Ulf Lilleengen <[email protected]> | 2024-10-23 10:30:13 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-10-23 10:30:13 +0000 |
| commit | 8803128707b8bd9fc9dcea392a62dfd42aa822d2 (patch) | |
| tree | f7ce53e194af927e02b015bf8e5dcd837169a70e /embassy-stm32/src/timer/low_level.rs | |
| parent | 8eb80c6816a1f6ea7814acd4f48f07e79891f804 (diff) | |
| parent | f2646b29a6b0a741fc424f88c5ca3dc25fce9369 (diff) | |
Merge pull request #3317 from GrantM11235/simplepwmchannel
embassy-stm32: Add SimplePwmChannel
Diffstat (limited to 'embassy-stm32/src/timer/low_level.rs')
| -rw-r--r-- | embassy-stm32/src/timer/low_level.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/embassy-stm32/src/timer/low_level.rs b/embassy-stm32/src/timer/low_level.rs index e643722aa..3136ea4e9 100644 --- a/embassy-stm32/src/timer/low_level.rs +++ b/embassy-stm32/src/timer/low_level.rs | |||
| @@ -6,6 +6,8 @@ | |||
| 6 | //! | 6 | //! |
| 7 | //! The available functionality depends on the timer type. | 7 | //! The available functionality depends on the timer type. |
| 8 | 8 | ||
| 9 | use core::mem::ManuallyDrop; | ||
| 10 | |||
| 9 | use embassy_hal_internal::{into_ref, Peripheral, PeripheralRef}; | 11 | use embassy_hal_internal::{into_ref, Peripheral, PeripheralRef}; |
| 10 | // Re-export useful enums | 12 | // Re-export useful enums |
| 11 | 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}; |
| @@ -198,6 +200,11 @@ impl<'d, T: CoreInstance> Timer<'d, T> { | |||
| 198 | Self { tim } | 200 | Self { tim } |
| 199 | } | 201 | } |
| 200 | 202 | ||
| 203 | pub(crate) unsafe fn clone_unchecked(&self) -> ManuallyDrop<Self> { | ||
| 204 | let tim = unsafe { self.tim.clone_unchecked() }; | ||
| 205 | ManuallyDrop::new(Self { tim }) | ||
| 206 | } | ||
| 207 | |||
| 201 | /// Get access to the virutal core 16bit timer registers. | 208 | /// Get access to the virutal core 16bit timer registers. |
| 202 | /// | 209 | /// |
| 203 | /// Note: This works even if the timer is more capable, because registers | 210 | /// Note: This works even if the timer is more capable, because registers |
