aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2021-07-16 16:22:21 +0200
committerGitHub <[email protected]>2021-07-16 16:22:21 +0200
commit69fb1b5418a4fb355d48b3b4357d0cd7562b5c4d (patch)
treeeb2217d44e10b804b1c90ca43075e1646201963e
parent7ed43cd843bbb8e3fdbf8546d6cd4780bfa1bd78 (diff)
parent1b42b3020160e9a4d63f9fad5ca3dc00572823fc (diff)
Merge pull request #297 from embassy-rs/h7-smps
stm32/pwr: add initial H7 SMPS support
-rw-r--r--embassy-stm32/src/pwr/h7.rs10
-rw-r--r--embassy-stm32/src/pwr/mod.rs2
m---------stm32-data0
3 files changed, 11 insertions, 1 deletions
diff --git a/embassy-stm32/src/pwr/h7.rs b/embassy-stm32/src/pwr/h7.rs
index b298408a4..37b049a85 100644
--- a/embassy-stm32/src/pwr/h7.rs
+++ b/embassy-stm32/src/pwr/h7.rs
@@ -35,11 +35,21 @@ impl Power {
35 // RM0433 Rev 7 6.8.4. This is partially enforced by dropping 35 // RM0433 Rev 7 6.8.4. This is partially enforced by dropping
36 // `self` at the end of this method, but of course we cannot 36 // `self` at the end of this method, but of course we cannot
37 // know what happened between the previous POR and here. 37 // know what happened between the previous POR and here.
38 #[cfg(pwr_h7)]
38 PWR.cr3().modify(|w| { 39 PWR.cr3().modify(|w| {
39 w.set_scuen(true); 40 w.set_scuen(true);
40 w.set_ldoen(true); 41 w.set_ldoen(true);
41 w.set_bypass(false); 42 w.set_bypass(false);
42 }); 43 });
44
45 #[cfg(pwr_h7smps)]
46 PWR.cr3().modify(|w| {
47 // hardcode "Direct SPMS" for now, this is what works on nucleos with the
48 // default solderbridge configuration.
49 w.set_sden(true);
50 w.set_ldoen(false);
51 });
52
43 // Validate the supply configuration. If you are stuck here, it is 53 // Validate the supply configuration. If you are stuck here, it is
44 // because the voltages on your board do not match those specified 54 // because the voltages on your board do not match those specified
45 // in the D3CR.VOS and CR3.SDLEVEL fields. By default after reset 55 // in the D3CR.VOS and CR3.SDLEVEL fields. By default after reset
diff --git a/embassy-stm32/src/pwr/mod.rs b/embassy-stm32/src/pwr/mod.rs
index 0fe7030e6..5b563d725 100644
--- a/embassy-stm32/src/pwr/mod.rs
+++ b/embassy-stm32/src/pwr/mod.rs
@@ -1,4 +1,4 @@
1#[cfg_attr(pwr_h7, path = "h7.rs")] 1#[cfg_attr(any(pwr_h7, pwr_h7smps), path = "h7.rs")]
2mod _version; 2mod _version;
3 3
4pub use _version::*; 4pub use _version::*;
diff --git a/stm32-data b/stm32-data
Subproject b10a0dd9101038d9f93402565e9b9675f15c087 Subproject 32ca79020ec7523fe4c3fcfc02006cb1ea637a1