#[non_exhaustive]pub struct Config {
pub rcc: Config,
pub rtc: RtcConfig,
pub min_stop_pause: Duration,
pub enable_debug_during_sleep: bool,
pub freeze_iwdg_when_halted: bool,
pub enable_independent_io_supply: bool,
pub enable_analog_switch_booster: bool,
pub bdma_interrupt_priority: Priority,
pub enable_ucpd1_dead_battery: bool,
}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.
rtc: RtcConfigRTC config.
Unless a low-power timer is the time driver, the RTC measures the time spent in Stop mode,
and init configures it with this. Pass the same config to rtc::Rtc::new.
min_stop_pause: DurationMinimum time to stop.
Stop mode is only entered if the next timer alarm is further away than this duration
(plus the time-driver wakeup margin). Defaults to 0 (Duration::from_micros(0)),
meaning Stop mode is entered whenever peripherals permit it.
This trades energy against latency; it is not an accuracy guarantee. Unless a low-power
timer is the time driver, time spent in Stop is measured at the RTC subsecond
resolution, so a Stop shorter than one tick is refused and spent in WFI instead. For a
region whose timing must be precise, hold a rcc::WakeGuard instead of tuning this.
enable_debug_during_sleep: boolEnable debug during sleep and stop.
May increase power consumption. Defaults to true.
freeze_iwdg_when_halted: boolStop the IWDG while a debugger halts the core. Defaults to false.
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_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.
bdma_interrupt_priority: PriorityBDMA interrupt priority.
Defaults to P0 (highest).
enable_ucpd1_dead_battery: boolEnables UCPD1 dead battery functionality.
Defaults to false (disabled).