esp_hal

Module ulp_core

Source
Available on crate feature unstable only.
Expand description

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time. Control the ULP core

§Overview

The ULP CORE peripheral allows control over the Ultra-Low Power (ULP) core in ESP chips. The ULP core is a low-power processor designed for executing tasks in deep sleep mode, enabling efficient power management in ESP systems.

The UlpCore struct provides an interface to interact with the ULP CORE peripheral. It allows starting and configuring the ULP core for operation. The UlpCore struct is initialized with a peripheral reference to the ULP CORE instance.

§Examples

const CODE: &[u8] = &[
    0x17, 0x05, 0x00, 0x00, 0x13, 0x05, 0x05, 0x01, 0x81, 0x45, 0x85, 0x05,
    0x0c, 0xc1, 0xf5, 0xbf, 0x00, 0x00, 0x00, 0x00,
];

let mut ulp_core =
    esp_hal::ulp_core::UlpCore::new(peripherals.ULP_RISCV_CORE);
ulp_core.stop();

// copy code to RTC ram
let lp_ram = 0x5000_0000 as *mut u8;
unsafe {
    core::ptr::copy_nonoverlapping(
        CODE as *const _ as *const u8,
        lp_ram,
        CODE.len(),
    );
}

// start ULP core
ulp_core.run(esp_hal::ulp_core::UlpCoreWakeupSource::HpCpu);

unsafe {
    let data = 0x5000_0010 as *mut u32;
    loop {}
}

Structs§

  • Structure representing the ULP (Ultra-Low Power) core.

Enums§