diff options
| -rw-r--r-- | embassy-stm32/src/rtc/mod.rs | 10 | ||||
| -rw-r--r-- | embassy-stm32/src/rtc/v3.rs | 6 |
2 files changed, 13 insertions, 3 deletions
diff --git a/embassy-stm32/src/rtc/mod.rs b/embassy-stm32/src/rtc/mod.rs index 1ffb567b3..169505501 100644 --- a/embassy-stm32/src/rtc/mod.rs +++ b/embassy-stm32/src/rtc/mod.rs | |||
| @@ -43,7 +43,7 @@ pub(crate) enum WakeupPrescaler { | |||
| 43 | Div16 = 16, | 43 | Div16 = 16, |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | #[cfg(any(stm32wb, stm32f4, stm32l0, stm32g4, stm32l5))] | 46 | #[cfg(any(stm32wb, stm32f4, stm32l0, stm32g4, stm32l5, stm32g0))] |
| 47 | impl From<WakeupPrescaler> for crate::pac::rtc::vals::Wucksel { | 47 | impl From<WakeupPrescaler> for crate::pac::rtc::vals::Wucksel { |
| 48 | fn from(val: WakeupPrescaler) -> Self { | 48 | fn from(val: WakeupPrescaler) -> Self { |
| 49 | use crate::pac::rtc::vals::Wucksel; | 49 | use crate::pac::rtc::vals::Wucksel; |
| @@ -57,7 +57,7 @@ impl From<WakeupPrescaler> for crate::pac::rtc::vals::Wucksel { | |||
| 57 | } | 57 | } |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | #[cfg(any(stm32wb, stm32f4, stm32l0, stm32g4, stm32l5))] | 60 | #[cfg(any(stm32wb, stm32f4, stm32l0, stm32g4, stm32l5, stm32g0))] |
| 61 | impl From<crate::pac::rtc::vals::Wucksel> for WakeupPrescaler { | 61 | impl From<crate::pac::rtc::vals::Wucksel> for WakeupPrescaler { |
| 62 | fn from(val: crate::pac::rtc::vals::Wucksel) -> Self { | 62 | fn from(val: crate::pac::rtc::vals::Wucksel) -> Self { |
| 63 | use crate::pac::rtc::vals::Wucksel; | 63 | use crate::pac::rtc::vals::Wucksel; |
| @@ -423,7 +423,11 @@ impl Rtc { | |||
| 423 | #[cfg(any(rtc_v3, rtc_v3u5, rtc_v3l5))] | 423 | #[cfg(any(rtc_v3, rtc_v3u5, rtc_v3l5))] |
| 424 | regs.scr().write(|w| w.set_cwutf(Calrf::CLEAR)); | 424 | regs.scr().write(|w| w.set_cwutf(Calrf::CLEAR)); |
| 425 | 425 | ||
| 426 | #[cfg(not(stm32l5))] | 426 | #[cfg(all(stm32g0))] |
| 427 | crate::pac::EXTI | ||
| 428 | .rpr(0) | ||
| 429 | .modify(|w| w.set_line(RTC::EXTI_WAKEUP_LINE, true)); | ||
| 430 | #[cfg(all(not(stm32g0), not(stm32l5)))] | ||
| 427 | crate::pac::EXTI | 431 | crate::pac::EXTI |
| 428 | .pr(0) | 432 | .pr(0) |
| 429 | .modify(|w| w.set_line(RTC::EXTI_WAKEUP_LINE, true)); | 433 | .modify(|w| w.set_line(RTC::EXTI_WAKEUP_LINE, true)); |
diff --git a/embassy-stm32/src/rtc/v3.rs b/embassy-stm32/src/rtc/v3.rs index 114141b64..3d44a52ff 100644 --- a/embassy-stm32/src/rtc/v3.rs +++ b/embassy-stm32/src/rtc/v3.rs | |||
| @@ -132,6 +132,12 @@ impl sealed::Instance for crate::peripherals::RTC { | |||
| 132 | #[cfg(all(feature = "low-power", stm32g4))] | 132 | #[cfg(all(feature = "low-power", stm32g4))] |
| 133 | const EXTI_WAKEUP_LINE: usize = 20; | 133 | const EXTI_WAKEUP_LINE: usize = 20; |
| 134 | 134 | ||
| 135 | #[cfg(all(feature = "low-power", stm32g0))] | ||
| 136 | const EXTI_WAKEUP_LINE: usize = 19; | ||
| 137 | |||
| 138 | #[cfg(all(feature = "low-power", stm32g0))] | ||
| 139 | type WakeupInterrupt = crate::interrupt::typelevel::RTC_TAMP; | ||
| 140 | |||
| 135 | #[cfg(all(feature = "low-power", stm32g4))] | 141 | #[cfg(all(feature = "low-power", stm32g4))] |
| 136 | type WakeupInterrupt = crate::interrupt::typelevel::RTC_WKUP; | 142 | type WakeupInterrupt = crate::interrupt::typelevel::RTC_WKUP; |
| 137 | 143 | ||
