feat(esp_psram): Add some helper APIs to get usable PSRAM memory size

This commit is contained in:
harshal.patil
2025-02-20 16:18:20 +05:30
parent 46225a4026
commit 0f628496c8
5 changed files with 164 additions and 26 deletions

View File

@@ -71,6 +71,17 @@ void esp_psram_bss_init(void);
*/
esp_err_t esp_psram_chip_init(void);
/**
* @brief Calculates the effective PSRAM memory that would be / is added into the heap.
*
* @return The size of PSRAM memory that would be / is added into the heap in bytes, or 0 if PSRAM hardware isn't successfully initialized
* @note The function pre-calculates the effective size of the PSRAM memory that would be added into the heap after performing the XIP or
* ext bss and ext noinit considerations, thus, even if the function is called before esp_psram_init(), it will return the final
* effective size of the PSRAM memory that would have been added into the heap after esp_psram_init() is performed
* instead of the vanilla size of the PSRAM memory.
*/
size_t esp_psram_get_heap_size_to_protect(void);
#if CONFIG_IDF_TARGET_ESP32
/**
* @brief Force a writeback of the data in the PSRAM cache. This is to be called whenever