embassy-stm32

Crates

git

Versions

stm32h757ai-cm4

Flavors

📣 We want to hear from you! Fill the Rust Embedded 2024 micro-survey.

Function embassy_stm32::init_primary

source ·
pub fn init_primary(
    config: Config,
    shared_data: &'static MaybeUninit<SharedData>,
) -> Peripherals
Expand description

Initialize the embassy-stm32 HAL with the provided configuration. This function does the actual initialization of the hardware, in contrast to init_secondary or try_init_secondary. Any core can do the init, but it’s important only one core does it.

This returns the peripheral singletons that can be used for creating drivers.

This should only be called once at startup, otherwise it panics.

The shared_data is used to coordinate the init with the second core. Read the SharedData docs for more information on its requirements.