spi_flash: refactor the spi_flash clock configuration, and add support for esp32c2

This commit is contained in:
Cao Sen Miao
2022-04-12 16:37:40 +08:00
parent 68d4c47b7e
commit 4418a855ba
57 changed files with 871 additions and 547 deletions

View File

@@ -21,6 +21,9 @@
#include "esp_system.h"
#include "soc/spi_pins.h"
// h2 and c2 will not support external flash
#define EXAMPLE_FLASH_FREQ_MHZ 40
static const char *TAG = "example";
// Handle of the wear levelling library instance
@@ -104,7 +107,7 @@ static esp_flash_t* example_init_ext_flash(void)
.cs_id = 0,
.cs_io_num = VSPI_IOMUX_PIN_NUM_CS,
.io_mode = SPI_FLASH_DIO,
.speed = ESP_FLASH_40MHZ,
.freq_mhz = EXAMPLE_FLASH_FREQ_MHZ,
};
ESP_LOGI(TAG, "Initializing external SPI Flash");