1 /* 2 * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 8 #pragma once 9 10 #include <stddef.h> 11 #include <stdint.h> 12 #include <stdbool.h> 13 #include "esp_err.h" 14 15 #ifdef __cplusplus 16 extern "C" { 17 #endif 18 19 /** 20 * @brief Initialize PSRAM interface/hardware. 21 * 22 * @return 23 * - ESP_OK: On success 24 * - ESP_FAIL: PSRAM isn't initialized successfully, potential reason would be: wrong VDDSDIO, invalid chip ID, etc. 25 * - ESP_ERR_INVALID_STATE: PSRAM is initialized already 26 */ 27 esp_err_t esp_psram_init(void); 28 29 /** 30 * @brief If PSRAM has been initialized 31 * 32 * @return 33 * - true: PSRAM has been initialized successfully 34 * - false: PSRAM hasn't been initialized or initialized failed 35 */ 36 bool esp_psram_is_initialized(void); 37 38 /** 39 * @brief Get the available size of the attached PSRAM chip 40 * 41 * @return Size in bytes, or 0 if PSRAM isn't successfully initialized 42 */ 43 size_t esp_psram_get_size(void); 44 45 #ifdef __cplusplus 46 } 47 #endif 48