esp_psram.h 1.0 KB

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