diff --git a/components/soc/esp32/include/hal/spi_flash_ll.h b/components/soc/esp32/include/hal/spi_flash_ll.h index f9adbd5f1b..7155e0a872 100644 --- a/components/soc/esp32/include/hal/spi_flash_ll.h +++ b/components/soc/esp32/include/hal/spi_flash_ll.h @@ -24,6 +24,7 @@ #include #include "soc/spi_periph.h" +#include "hal/spi_flash_types.h" #include // For MIN/MAX #include #include @@ -43,18 +44,6 @@ ///Slowest io mode supported by ESP32, currently SlowRd #define SPI_FLASH_READ_MODE_MIN SPI_FLASH_SLOWRD -/** @brief Mode used for reading from SPI flash */ -typedef enum { - SPI_FLASH_SLOWRD = 0, ///< Data read using single I/O, some limits on speed - SPI_FLASH_FASTRD, ///< Data read using single I/O, no limit on speed - SPI_FLASH_DOUT, ///< Data read using dual I/O - SPI_FLASH_DIO, ///< Both address & data transferred using dual I/O - SPI_FLASH_QOUT, ///< Data read using quad I/O - SPI_FLASH_QIO, ///< Both address & data transferred using quad I/O - - SPI_FLASH_READ_MODE_MAX, ///< The fastest io mode supported by the host is ``ESP_FLASH_READ_MODE_MAX-1``. -} esp_flash_read_mode_t; - /// type to store pre-calculated register value in above layers typedef typeof(SPI1.clock) spi_flash_ll_clock_reg_t; diff --git a/components/soc/include/hal/spi_flash_hal.h b/components/soc/include/hal/spi_flash_hal.h index 1a5c373614..49972c5199 100644 --- a/components/soc/include/hal/spi_flash_hal.h +++ b/components/soc/include/hal/spi_flash_hal.h @@ -23,7 +23,7 @@ #pragma once #include "hal/spi_flash_ll.h" -#include "hal/spi_flash_host_drv.h" +#include "hal/spi_flash_types.h" #include "soc/soc_memory_layout.h" #define ESP_FLASH_DEFAULT_FREQ ESP_FLASH_20MHZ diff --git a/components/soc/include/hal/spi_flash_host_drv.h b/components/soc/include/hal/spi_flash_types.h similarity index 87% rename from components/soc/include/hal/spi_flash_host_drv.h rename to components/soc/include/hal/spi_flash_types.h index 5095bc8f50..067d10fd4b 100644 --- a/components/soc/include/hal/spi_flash_host_drv.h +++ b/components/soc/include/hal/spi_flash_types.h @@ -14,7 +14,7 @@ #pragma once -#include "hal/spi_flash_ll.h" +#include #include "hal/esp_flash_err.h" /** Definition of a common transaction. Also holds the return value. */ @@ -26,6 +26,18 @@ typedef struct { uint32_t miso_data[2]; ///< [out] Input data from slave, little endian } spi_flash_trans_t; +/** @brief Mode used for reading from SPI flash */ +typedef enum { + SPI_FLASH_SLOWRD = 0, ///< Data read using single I/O, some limits on speed + SPI_FLASH_FASTRD, ///< Data read using single I/O, no limit on speed + SPI_FLASH_DOUT, ///< Data read using dual I/O + SPI_FLASH_DIO, ///< Both address & data transferred using dual I/O + SPI_FLASH_QOUT, ///< Data read using quad I/O + SPI_FLASH_QIO, ///< Both address & data transferred using quad I/O + + SPI_FLASH_READ_MODE_MAX, ///< The fastest io mode supported by the host is ``ESP_FLASH_READ_MODE_MAX-1``. +} esp_flash_read_mode_t; + struct spi_flash_host_driver_t; typedef struct spi_flash_host_driver_t spi_flash_host_driver_t; diff --git a/components/spi_flash/include/esp_flash.h b/components/spi_flash/include/esp_flash.h index 904b09b493..48eedcda37 100644 --- a/components/spi_flash/include/esp_flash.h +++ b/components/spi_flash/include/esp_flash.h @@ -17,7 +17,7 @@ #include #include -#include "hal/spi_flash_host_drv.h" +#include "hal/spi_flash_types.h" struct spi_flash_chip_t; typedef struct spi_flash_chip_t spi_flash_chip_t;