spi_flash: Add auto suspend mode on esp32c3

This commit is contained in:
Cao Sen Miao
2020-12-18 12:57:55 +08:00
parent 1f37a5f162
commit 9905da46e0
30 changed files with 759 additions and 170 deletions

View File

@@ -22,6 +22,7 @@
#include "esp_log.h"
#include "sdkconfig.h"
#include "esp_flash_internal.h"
#include "spi_flash_defs.h"
static const char TAG[] = "spi_flash";
@@ -173,9 +174,6 @@ bool esp_flash_chip_driver_initialized(const esp_flash_t *chip)
return true;
}
#ifdef CONFIG_SPI_FLASH_AUTO_SUSPEND
spi_flash_ll_auto_suspend_init(spi_flash_ll_get_hw(SPI_HOST), val);
#endif
esp_err_t IRAM_ATTR esp_flash_init(esp_flash_t *chip)
{
// Chip init flow
@@ -835,6 +833,12 @@ IRAM_ATTR esp_err_t esp_flash_set_io_mode(esp_flash_t* chip, bool qe)
}
#endif //CONFIG_SPI_FLASH_ROM_IMPL
//init suspend mode cmd, uses internal.
esp_err_t esp_flash_suspend_cmd_init(esp_flash_t* chip)
{
return chip->chip_drv->sus_setup(chip);
}
#ifndef CONFIG_SPI_FLASH_USE_LEGACY_IMPL
esp_err_t esp_flash_app_disable_protect(bool disable)
{