2021-06-02 14:34:38 +00:00
|
|
|
/*
|
2023-08-28 02:20:56 +00:00
|
|
|
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
2021-06-02 14:34:38 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2019-05-10 03:34:06 +00:00
|
|
|
|
2022-03-23 12:16:08 +00:00
|
|
|
#pragma once
|
2019-05-10 03:34:06 +00:00
|
|
|
|
|
|
|
#include "esp_err.h"
|
|
|
|
#include "sdkconfig.h"
|
|
|
|
|
2022-03-23 12:16:08 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define PSRAM_SIZE_2MB (2 * 1024 * 1024)
|
|
|
|
#define PSRAM_SIZE_4MB (4 * 1024 * 1024)
|
|
|
|
#define PSRAM_SIZE_8MB (8 * 1024 * 1024)
|
2022-05-11 02:32:56 +00:00
|
|
|
#define PSRAM_SIZE_16MB (16 * 1024 * 1024)
|
|
|
|
#define PSRAM_SIZE_32MB (32 * 1024 * 1024)
|
2023-05-15 07:36:43 +00:00
|
|
|
#define PSRAM_SIZE_64MB (64 * 1024 * 1024)
|
2019-05-10 03:34:06 +00:00
|
|
|
|
|
|
|
/**
|
2022-03-23 12:16:08 +00:00
|
|
|
* @brief To get the physical psram size in bytes.
|
|
|
|
*
|
|
|
|
* @param[out] out_size_bytes physical psram size in bytes.
|
|
|
|
*/
|
2022-05-11 02:32:56 +00:00
|
|
|
esp_err_t esp_psram_impl_get_physical_size(uint32_t *out_size_bytes);
|
2022-03-23 12:16:08 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief To get the available physical psram size in bytes.
|
|
|
|
*
|
|
|
|
* @param[out] out_size_bytes availabe physical psram size in bytes.
|
2019-05-10 03:34:06 +00:00
|
|
|
*/
|
2022-05-11 02:32:56 +00:00
|
|
|
esp_err_t esp_psram_impl_get_available_size(uint32_t *out_size_bytes);
|
2019-05-10 03:34:06 +00:00
|
|
|
|
|
|
|
/**
|
2022-05-11 02:32:56 +00:00
|
|
|
* @brief Enable psram and configure it to a ready state
|
2019-05-10 03:34:06 +00:00
|
|
|
*
|
2022-05-11 02:32:56 +00:00
|
|
|
* @return
|
2022-11-10 11:46:24 +00:00
|
|
|
* - ESP_OK: On success
|
|
|
|
* - ESP_ERR_NOT_SUPPORTED: PSRAM ID / vendor ID check fail
|
|
|
|
* - ESP_ERR_INVALID_STATE: On esp32, when VSPI peripheral is needed but cannot be claimed
|
2019-05-10 03:34:06 +00:00
|
|
|
*/
|
2023-08-28 02:20:56 +00:00
|
|
|
esp_err_t esp_psram_impl_enable(void);
|
2019-05-10 03:34:06 +00:00
|
|
|
|
2021-07-02 13:46:49 +00:00
|
|
|
/**
|
|
|
|
* @brief get psram CS IO
|
|
|
|
*
|
|
|
|
* @return psram CS IO
|
|
|
|
*/
|
2022-05-11 02:32:56 +00:00
|
|
|
uint8_t esp_psram_impl_get_cs_io(void);
|