Module psram

Source
Available on crate feature unstable only.
Expand description

§PSRAM (Pseudo-static RAM, SPI RAM) driver

§Overview

The PSRAM module provides support for accessing and controlling the Pseudo Static Random Access Memory (PSRAM). PSRAM provides additional external memory to supplement the internal memory of the MCU, allowing for increased storage capacity and improved performance in certain applications.

The mapped start address for PSRAM depends on the amount of mapped flash memory.

§Examples

§PSRAM as heap memory

This example shows how to use PSRAM as heap-memory via esp-alloc. You need an MCU with at least 2 MB of PSRAM memory.

The PSRAM example must be built in release mode!

// Add PSRAM to the heap.
esp_alloc::psram_allocator!(&peripherals.PSRAM, esp_hal::psram);

let mut large_vec: Vec<u32> = Vec::with_capacity(500 * 1024 / 4);

for i in 0..(500 * 1024 / 4) {
    large_vec.push((i & 0xff) as u32);
}

let string = String::from("A string allocated in PSRAM");

Structs§

PsramConfigpsram
PSRAM configuration

Enums§

PsramCacheSpeedpsram
PsramSize
Size of PSRAM

Functions§

psram_raw_parts
Returns the address and size of the available in external memory.