#[non_exhaustive]pub struct Config {
pub rcc: Config,
pub enable_debug_during_sleep: bool,
pub enable_independent_io_supply: bool,
pub enable_ulpmen: bool,
pub flash_fast_wakeup: bool,
pub stop_mode_sram: StopModeSramConfig,
pub enable_analog_switch_booster: bool,
pub gpdma_interrupt_priority: Priority,
}Expand description
embassy-stm32 global configuration.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.rcc: ConfigRCC config.
enable_debug_during_sleep: boolEnable debug during sleep and stop.
May increase power consumption. Defaults to true.
enable_independent_io_supply: boolOn low-power boards (eg. stm32l4, stm32l5, stm32wba and stm32u5),
some GPIO pins are powered by an auxiliary, independent power supply (VDDIO2),
which needs to be enabled before these pins can be used.
May increase power consumption. Defaults to true.
enable_ulpmen: boolEnable ultra-low-power BOR0 mode (discontinuous BOR monitoring) in Stop 1 and Standby modes.
This must be set to reach the lowest power consumption in low-power modes.
Constraints:
- Must not be set when autonomous peripherals use HSI as kernel clock.
- Only effective when BOR levels 1-4 and PVD are disabled; when they are enabled, continuous mode applies regardless of this setting.
Defaults to false (disabled).
flash_fast_wakeup: boolEnable flash fast wakeup from Stop 0/1 modes.
When true, flash stays in normal mode during stop (faster wakeup,
higher power). When false (default), flash enters low-power mode
(slower wakeup, lower power).
Defaults to false.
stop_mode_sram: StopModeSramConfigSRAM power-down configuration for Stop modes.
Controls which SRAM pages are powered down when entering Stop 0 or Stop 1 modes. Powered-down pages lose their content but reduce current draw.
Defaults to all SRAM retained.
enable_analog_switch_booster: boolEnable the I/O analog switch voltage booster.
The analog switch between a GPIO and the ADC (or comparator, or operational amplifier) has a much higher resistance when the analog supply is low, which distorts conversions of pin channels unless they are given a much longer sample time. The reference manuals ask for this booster below 2.4 V (2.7 V on the H5, H7 and H7RS). It draws extra current, so it is off by default.
On boards where only VDDA is low and VDD is not, the analog switches can instead be supplied from VDD, which this option does not do.
gpdma_interrupt_priority: PriorityGPDMA interrupt priority.
Defaults to P0 (highest).