File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
15
15
- Move SDIO card power handling to its own function.
16
16
- [ breaking-change] Add a 2 ms delay after changing SDIO card power setting.
17
17
- [ breaking-change] Changed sdio::{read, write}_ block buf argument to &[ u8; 512] .
18
+ - Voltage regulator overdrive is enabled where supported and required for selected HCLK.
18
19
19
20
### Added
20
21
Original file line number Diff line number Diff line change @@ -349,6 +349,27 @@ impl CFGR {
349
349
// Enable PLL
350
350
rcc. cr . modify ( |_, w| w. pllon ( ) . set_bit ( ) ) ;
351
351
352
+ // Enable voltage regulator overdrive if HCLK is above the limit
353
+ #[ cfg( any(
354
+ feature = "stm32f427" ,
355
+ feature = "stm32f429" ,
356
+ feature = "stm32f437" ,
357
+ feature = "stm32f439" ,
358
+ feature = "stm32f446" ,
359
+ feature = "stm32f469" ,
360
+ feature = "stm32f479"
361
+ ) ) ]
362
+ if hclk > 168_000_000 {
363
+ // Enable clock for PWR peripheral
364
+ rcc. apb1enr . modify ( |_, w| w. pwren ( ) . set_bit ( ) ) ;
365
+
366
+ let pwr = unsafe { & * crate :: stm32:: PWR :: ptr ( ) } ;
367
+ pwr. cr . modify ( |_, w| w. oden ( ) . set_bit ( ) ) ;
368
+ while pwr. csr . read ( ) . odrdy ( ) . bit_is_clear ( ) { }
369
+ pwr. cr . modify ( |_, w| w. odswen ( ) . set_bit ( ) ) ;
370
+ while pwr. csr . read ( ) . odswrdy ( ) . bit_is_clear ( ) { }
371
+ }
372
+
352
373
// Wait for PLL to stabilise
353
374
while rcc. cr . read ( ) . pllrdy ( ) . bit_is_clear ( ) { }
354
375
}
You can’t perform that action at this time.
0 commit comments