From ea43d74780fd801a6e68820d01fd7dd21287acf8 Mon Sep 17 00:00:00 2001
From: Badr Bouslikhin <bouslikhin.badr@gmail.com>
Date: Sat, 2 Dec 2023 14:55:00 +0100
Subject: [PATCH] stm32/rcc: add missing h7 power config

---
 embassy-stm32/src/rcc/h.rs | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/embassy-stm32/src/rcc/h.rs b/embassy-stm32/src/rcc/h.rs
index 644647d91..1889eb280 100644
--- a/embassy-stm32/src/rcc/h.rs
+++ b/embassy-stm32/src/rcc/h.rs
@@ -158,6 +158,11 @@ pub enum SupplyConfig {
     /// SMPS step-down converter enabled according to SDLEVEL used to supply external circuits and may supply the external source for V CORE .
     /// SMPS step-down converter forced ON in MR mode.
     SMPSExternalLDOBypass(SMPSSupplyVoltage),
+
+    /// Power supply configuration from an external source, SMPS disabled and the LDO bypassed.
+    /// V CORE supplied from external source
+    /// SMPS step-down converter disabled and LDO bypassed, voltage monitoring still active.
+    SMPSDisabledLDOBypass,
 }
 
 /// SMPS step-down converter voltage output level.
@@ -308,6 +313,13 @@ pub(crate) unsafe fn init(config: Config) {
                     w.set_bypass(matches!(config.supply_config, SupplyConfig::SMPSExternalLDOBypass(_)));
                 });
             }
+            SupplyConfig::SMPSDisabledLDOBypass => {
+                PWR.cr3().modify(|w| {
+                    w.set_sden(false);
+                    w.set_ldoen(false);
+                    w.set_bypass(true);
+                });
+            }
         }
     }