diff options
| author | Tobias Naumann <[email protected]> | 2024-07-26 14:25:10 +0200 |
|---|---|---|
| committer | Tobias Naumann <[email protected]> | 2024-07-26 14:25:10 +0200 |
| commit | 60aa9c15a8a246d1d099beec8a1e3cbf08f52a8f (patch) | |
| tree | f5553b5da9d3a86b5be41b15e541d0231459b444 /embassy-stm32/src/rtc | |
| parent | b88dc137e766d89eca5472bfa6f3bb78cfd1f7e0 (diff) | |
Implement low-power feature for stm32l4 MCUs
Diffstat (limited to 'embassy-stm32/src/rtc')
| -rw-r--r-- | embassy-stm32/src/rtc/low_power.rs | 4 | ||||
| -rw-r--r-- | embassy-stm32/src/rtc/v2.rs | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/embassy-stm32/src/rtc/low_power.rs b/embassy-stm32/src/rtc/low_power.rs index a4ff1acbc..6042389ac 100644 --- a/embassy-stm32/src/rtc/low_power.rs +++ b/embassy-stm32/src/rtc/low_power.rs | |||
| @@ -65,7 +65,7 @@ pub(crate) enum WakeupPrescaler { | |||
| 65 | Div16 = 16, | 65 | Div16 = 16, |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | #[cfg(any(stm32f4, stm32l0, stm32g4, stm32l5, stm32wb, stm32h5, stm32g0))] | 68 | #[cfg(any(stm32f4, stm32l0, stm32g4, stm32l4, stm32l5, stm32wb, stm32h5, stm32g0))] |
| 69 | impl From<WakeupPrescaler> for crate::pac::rtc::vals::Wucksel { | 69 | impl From<WakeupPrescaler> for crate::pac::rtc::vals::Wucksel { |
| 70 | fn from(val: WakeupPrescaler) -> Self { | 70 | fn from(val: WakeupPrescaler) -> Self { |
| 71 | use crate::pac::rtc::vals::Wucksel; | 71 | use crate::pac::rtc::vals::Wucksel; |
| @@ -79,7 +79,7 @@ impl From<WakeupPrescaler> for crate::pac::rtc::vals::Wucksel { | |||
| 79 | } | 79 | } |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | #[cfg(any(stm32f4, stm32l0, stm32g4, stm32l5, stm32wb, stm32h5, stm32g0))] | 82 | #[cfg(any(stm32f4, stm32l0, stm32g4, stm32l4, stm32l5, stm32wb, stm32h5, stm32g0))] |
| 83 | impl From<crate::pac::rtc::vals::Wucksel> for WakeupPrescaler { | 83 | impl From<crate::pac::rtc::vals::Wucksel> for WakeupPrescaler { |
| 84 | fn from(val: crate::pac::rtc::vals::Wucksel) -> Self { | 84 | fn from(val: crate::pac::rtc::vals::Wucksel) -> Self { |
| 85 | use crate::pac::rtc::vals::Wucksel; | 85 | use crate::pac::rtc::vals::Wucksel; |
diff --git a/embassy-stm32/src/rtc/v2.rs b/embassy-stm32/src/rtc/v2.rs index cdc1cb299..5d9025bbe 100644 --- a/embassy-stm32/src/rtc/v2.rs +++ b/embassy-stm32/src/rtc/v2.rs | |||
| @@ -131,10 +131,13 @@ impl SealedInstance for crate::peripherals::RTC { | |||
| 131 | #[cfg(all(feature = "low-power", stm32f4))] | 131 | #[cfg(all(feature = "low-power", stm32f4))] |
| 132 | const EXTI_WAKEUP_LINE: usize = 22; | 132 | const EXTI_WAKEUP_LINE: usize = 22; |
| 133 | 133 | ||
| 134 | #[cfg(all(feature = "low-power", stm32l4))] | ||
| 135 | const EXTI_WAKEUP_LINE: usize = 20; | ||
| 136 | |||
| 134 | #[cfg(all(feature = "low-power", stm32l0))] | 137 | #[cfg(all(feature = "low-power", stm32l0))] |
| 135 | const EXTI_WAKEUP_LINE: usize = 20; | 138 | const EXTI_WAKEUP_LINE: usize = 20; |
| 136 | 139 | ||
| 137 | #[cfg(all(feature = "low-power", stm32f4))] | 140 | #[cfg(all(feature = "low-power", any(stm32f4, stm32l4)))] |
| 138 | type WakeupInterrupt = crate::interrupt::typelevel::RTC_WKUP; | 141 | type WakeupInterrupt = crate::interrupt::typelevel::RTC_WKUP; |
| 139 | 142 | ||
| 140 | #[cfg(all(feature = "low-power", stm32l0))] | 143 | #[cfg(all(feature = "low-power", stm32l0))] |
