aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerzain Mata <[email protected]>2025-07-18 14:23:52 -0700
committerGerzain Mata <[email protected]>2025-07-18 14:25:15 -0700
commitd9cd93ca228b7d4d38066d88b50ff06bb7a5297a (patch)
treef9c4db9bc8902b0d0aece737e45f7940815db1e1
parent3e1b0e4aec11888d6ea41ef5c62d6d2912d81eae (diff)
Added RTC low-power support for STM32WBA65
Also added low-power feature for STM32WBA65RI build
-rwxr-xr-xci.sh2
-rw-r--r--embassy-stm32/src/rtc/low_power.rs12
-rw-r--r--embassy-stm32/src/rtc/mod.rs2
-rw-r--r--embassy-stm32/src/rtc/v3.rs2
4 files changed, 12 insertions, 6 deletions
diff --git a/ci.sh b/ci.sh
index 842215a6b..229ddaae8 100755
--- a/ci.sh
+++ b/ci.sh
@@ -172,7 +172,7 @@ cargo batch \
172 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32wba50ke,defmt,exti,time-driver-any,time \ 172 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32wba50ke,defmt,exti,time-driver-any,time \
173 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32wba55ug,defmt,exti,time-driver-any,time \ 173 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32wba55ug,defmt,exti,time-driver-any,time \
174 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32wba62cg,defmt,exti,time-driver-any,time \ 174 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32wba62cg,defmt,exti,time-driver-any,time \
175 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32wba65ri,defmt,exti,time-driver-any,time \ 175 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32wba65ri,defmt,exti,time-driver-any,low-power,time \
176 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32u5f9zj,defmt,exti,time-driver-any,time \ 176 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32u5f9zj,defmt,exti,time-driver-any,time \
177 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32u5g9nj,defmt,exti,time-driver-any,time \ 177 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32u5g9nj,defmt,exti,time-driver-any,time \
178 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wb35ce,defmt,exti,time-driver-any,time \ 178 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wb35ce,defmt,exti,time-driver-any,time \
diff --git a/embassy-stm32/src/rtc/low_power.rs b/embassy-stm32/src/rtc/low_power.rs
index cd075f3de..78ccd3e6c 100644
--- a/embassy-stm32/src/rtc/low_power.rs
+++ b/embassy-stm32/src/rtc/low_power.rs
@@ -66,7 +66,7 @@ pub(crate) enum WakeupPrescaler {
66} 66}
67 67
68#[cfg(any( 68#[cfg(any(
69 stm32f4, stm32l0, stm32g4, stm32l4, stm32l5, stm32wb, stm32h5, stm32g0, stm32u5, stm32u0 69 stm32f4, stm32l0, stm32g4, stm32l4, stm32l5, stm32wb, stm32h5, stm32g0, stm32u5, stm32u0, stm32wba
70))] 70))]
71impl From<WakeupPrescaler> for crate::pac::rtc::vals::Wucksel { 71impl From<WakeupPrescaler> for crate::pac::rtc::vals::Wucksel {
72 fn from(val: WakeupPrescaler) -> Self { 72 fn from(val: WakeupPrescaler) -> Self {
@@ -82,7 +82,7 @@ impl From<WakeupPrescaler> for crate::pac::rtc::vals::Wucksel {
82} 82}
83 83
84#[cfg(any( 84#[cfg(any(
85 stm32f4, stm32l0, stm32g4, stm32l4, stm32l5, stm32wb, stm32h5, stm32g0, stm32u5, stm32u0 85 stm32f4, stm32l0, stm32g4, stm32l4, stm32l5, stm32wb, stm32h5, stm32g0, stm32u5, stm32u0, stm32wba
86))] 86))]
87impl From<crate::pac::rtc::vals::Wucksel> for WakeupPrescaler { 87impl From<crate::pac::rtc::vals::Wucksel> for WakeupPrescaler {
88 fn from(val: crate::pac::rtc::vals::Wucksel) -> Self { 88 fn from(val: crate::pac::rtc::vals::Wucksel) -> Self {
@@ -227,7 +227,7 @@ impl Rtc {
227 <RTC as crate::rtc::SealedInstance>::WakeupInterrupt::unpend(); 227 <RTC as crate::rtc::SealedInstance>::WakeupInterrupt::unpend();
228 unsafe { <RTC as crate::rtc::SealedInstance>::WakeupInterrupt::enable() }; 228 unsafe { <RTC as crate::rtc::SealedInstance>::WakeupInterrupt::enable() };
229 229
230 #[cfg(not(any(stm32u5, stm32u0)))] 230 #[cfg(not(any(stm32u5, stm32u0, stm32wba)))]
231 { 231 {
232 use crate::pac::EXTI; 232 use crate::pac::EXTI;
233 EXTI.rtsr(0).modify(|w| w.set_line(RTC::EXTI_WAKEUP_LINE, true)); 233 EXTI.rtsr(0).modify(|w| w.set_line(RTC::EXTI_WAKEUP_LINE, true));
@@ -247,5 +247,11 @@ impl Rtc {
247 RCC.srdamr().modify(|w| w.set_rtcapbamen(true)); 247 RCC.srdamr().modify(|w| w.set_rtcapbamen(true));
248 RCC.apb3smenr().modify(|w| w.set_rtcapbsmen(true)); 248 RCC.apb3smenr().modify(|w| w.set_rtcapbsmen(true));
249 } 249 }
250 #[cfg(stm32wba)]
251 {
252 use crate::pac::RCC;
253 // RCC.srdamr().modify(|w| w.set_rtcapbamen(true));
254 RCC.apb7smenr().modify(|w| w.set_rtcapbsmen(true));
255 }
250 } 256 }
251} 257}
diff --git a/embassy-stm32/src/rtc/mod.rs b/embassy-stm32/src/rtc/mod.rs
index 2c5aaca35..449f3008a 100644
--- a/embassy-stm32/src/rtc/mod.rs
+++ b/embassy-stm32/src/rtc/mod.rs
@@ -296,7 +296,7 @@ trait SealedInstance {
296 const BACKUP_REGISTER_COUNT: usize; 296 const BACKUP_REGISTER_COUNT: usize;
297 297
298 #[cfg(feature = "low-power")] 298 #[cfg(feature = "low-power")]
299 #[cfg(not(any(stm32u5, stm32u0)))] 299 #[cfg(not(any(stm32wba, stm32u5, stm32u0)))]
300 const EXTI_WAKEUP_LINE: usize; 300 const EXTI_WAKEUP_LINE: usize;
301 301
302 #[cfg(feature = "low-power")] 302 #[cfg(feature = "low-power")]
diff --git a/embassy-stm32/src/rtc/v3.rs b/embassy-stm32/src/rtc/v3.rs
index 39aa6c5cb..d0b52049e 100644
--- a/embassy-stm32/src/rtc/v3.rs
+++ b/embassy-stm32/src/rtc/v3.rs
@@ -146,7 +146,7 @@ impl SealedInstance for crate::peripherals::RTC {
146 type WakeupInterrupt = crate::interrupt::typelevel::RTC_WKUP; 146 type WakeupInterrupt = crate::interrupt::typelevel::RTC_WKUP;
147 } else if #[cfg(any(stm32g0, stm32u0))] { 147 } else if #[cfg(any(stm32g0, stm32u0))] {
148 type WakeupInterrupt = crate::interrupt::typelevel::RTC_TAMP; 148 type WakeupInterrupt = crate::interrupt::typelevel::RTC_TAMP;
149 } else if #[cfg(any(stm32l5, stm32h5, stm32u5))] { 149 } else if #[cfg(any(stm32l5, stm32h5, stm32u5, stm32wba))] {
150 type WakeupInterrupt = crate::interrupt::typelevel::RTC; 150 type WakeupInterrupt = crate::interrupt::typelevel::RTC;
151 } 151 }
152 ); 152 );