mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
spiram: add getter function to check psram initialization state
This commit is contained in:
parent
6352a7ee07
commit
21067a0455
@ -2,7 +2,7 @@
|
||||
#
|
||||
# sourced into the "SPIRAM config" submenu for ESP32 or ESP32S2
|
||||
|
||||
# invisible option selected by ESP32_SPIRAM_SUPPORT || ESP32S2_SPIRAM_SUPPORT
|
||||
# invisible option selected by ${target}_SPIRAM_SUPPORT
|
||||
config SPIRAM
|
||||
bool
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
COMPONENT_SRCDIRS := . port/$(IDF_TARGET)
|
||||
COMPONENT_ADD_INCLUDEDIRS := . include port/$(IDF_TARGET)/ include/soc port/$(IDF_TARGET)/private_include
|
||||
COMPONENT_ADD_INCLUDEDIRS := . include port/$(IDF_TARGET)/ include/soc include/soc/${IDF_TARGET} port/$(IDF_TARGET)/private_include
|
||||
COMPONENT_ADD_LDFRAGMENTS := linker.lf
|
||||
|
||||
ifdef IS_BOOTLOADER_BUILD
|
||||
|
@ -91,6 +91,15 @@ void esp_spiram_writeback_cache(void);
|
||||
*/
|
||||
esp_err_t esp_spiram_reserve_dma_pool(size_t size);
|
||||
|
||||
/**
|
||||
* @brief If SPI RAM(PSRAM) has been initialized
|
||||
*
|
||||
* @return
|
||||
* - true SPI RAM has been initialized successfully
|
||||
* - false SPI RAM hasn't been initialized or initialized failed
|
||||
*/
|
||||
bool esp_spiram_is_initialized(void);
|
||||
|
||||
#if CONFIG_SPIRAM_FETCH_INSTRUCTIONS
|
||||
|
||||
extern int _instruction_reserved_start, _instruction_reserved_end;
|
||||
|
@ -78,7 +78,14 @@ size_t esp_spiram_get_size(void);
|
||||
*/
|
||||
void esp_spiram_writeback_cache(void);
|
||||
|
||||
|
||||
/**
|
||||
* @brief If SPI RAM(PSRAM) has been initialized
|
||||
*
|
||||
* @return
|
||||
* - true SPI RAM has been initialized successfully
|
||||
* - false SPI RAM hasn't been initialized or initialized failed
|
||||
*/
|
||||
bool esp_spiram_is_initialized(void);
|
||||
|
||||
/**
|
||||
* @brief Reserve a pool of internal memory for specific DMA/internal allocations
|
||||
@ -91,6 +98,15 @@ void esp_spiram_writeback_cache(void);
|
||||
*/
|
||||
esp_err_t esp_spiram_reserve_dma_pool(size_t size);
|
||||
|
||||
/**
|
||||
* @brief If SPI RAM(PSRAM) has been initialized
|
||||
*
|
||||
* @return
|
||||
* - true SPI RAM has been initialized successfully
|
||||
* - false SPI RAM hasn't been initialized or initialized failed
|
||||
*/
|
||||
bool esp_spiram_is_initialized(void);
|
||||
|
||||
#if CONFIG_SPIRAM_FETCH_INSTRUCTIONS
|
||||
|
||||
extern int _instruction_reserved_start, _instruction_reserved_end;
|
||||
|
@ -375,6 +375,15 @@ void IRAM_ATTR esp_spiram_writeback_cache(void)
|
||||
Cache_WriteBack_All();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief If SPI RAM(PSRAM) has been initialized
|
||||
*
|
||||
* @return true SPI RAM has been initialized successfully
|
||||
* @return false SPI RAM hasn't been initialized or initialized failed
|
||||
*/
|
||||
bool esp_spiram_is_initialized(void)
|
||||
{
|
||||
return spiram_inited;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -329,4 +329,15 @@ void IRAM_ATTR esp_spiram_writeback_cache(void)
|
||||
Cache_WriteBack_All();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief If SPI RAM(PSRAM) has been initialized
|
||||
*
|
||||
* @return true SPI RAM has been initialized successfully
|
||||
* @return false SPI RAM hasn't been initialized or initialized failed
|
||||
*/
|
||||
bool esp_spiram_is_initialized(void)
|
||||
{
|
||||
return s_spiram_inited;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user