Module stm32h7xx_hal::pwr[][src]

Power Configuration

This module configures the PWR unit to provide the core voltage VCORE. The voltage scaling mode is fixed at VOS1 (High Performance).

When the system starts up, it is in Run* mode. After the call to freeze, it will be in Run mode. See RM0433 Rev 7 Section 6.6.1 “System/D3 domain modes”.

Example

    let dp = pac::Peripherals::take().unwrap();

    let pwr = dp.PWR.constrain();
    let pwrcfg = pwr.freeze();

    assert_eq!(pwrcfg.vos(), VoltageScale::Scale1);

SMPS

Some parts include an integrated Switched Mode Power Supply (SMPS) to supply VCORE. For these parts, the method of supplying VCORE can be specified. Refer to RM0399 Rev 3 Table 32. for a more detailed descriptions of the possible modes.

Note: Specifying the wrong mode for your hardware will cause undefined results.

    let dp = pac::Peripherals::take().unwrap();

    let pwr = dp.PWR.constrain();
    let pwrcfg = pwr.smps().freeze();

    assert_eq!(pwrcfg.vos(), VoltageScale::Scale1);

The VCORE supply configuration can only be set once after each POR, and this is enforced by hardware. If you add or change the power supply method, freeze will panic until you power on reset your board.

Structs

PowerConfiguration

Power Configuration

Pwr

Constrained PWR peripheral

Enums

VoltageScale

Voltage Scale

Traits

PwrExt

Extension trait that constrains the PWR peripheral