]> granicus.if.org Git - esp-idf/commitdiff
esp_flash: break the inappropriate include chain in spi_flash_host_drv.h
authorMichael (XIAO Xufeng) <xiaoxufeng@espressif.com>
Wed, 19 Jun 2019 08:37:55 +0000 (16:37 +0800)
committerMichael (XIAO Xufeng) <xiaoxufeng@espressif.com>
Thu, 20 Jun 2019 02:55:12 +0000 (10:55 +0800)
components/soc/esp32/include/hal/spi_flash_ll.h
components/soc/include/hal/spi_flash_hal.h
components/soc/include/hal/spi_flash_types.h [moved from components/soc/include/hal/spi_flash_host_drv.h with 87% similarity]
components/spi_flash/include/esp_flash.h

index f9adbd5f1bdf47f14c83129e3d476d5fa9cb9030..7155e0a872b5b3d62a3919fa3bb0cd46f3cff138 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <stdlib.h>
 #include "soc/spi_periph.h"
+#include "hal/spi_flash_types.h"
 #include <sys/param.h> // For MIN/MAX
 #include <stdbool.h>
 #include <string.h>
 ///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;
 
index 1a5c373614248a8d94d6ae983e1116aae7afd017..49972c519981791194858a4725dd9b7ca8398389 100644 (file)
@@ -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
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 5095bc8f5053d00f2e56320ee40ba5a51fc67f1b..067d10fd4b88f3eec60762c1b39685d0cd0b1d31 100644 (file)
@@ -14,7 +14,7 @@
 
 #pragma once
 
-#include "hal/spi_flash_ll.h"
+#include <esp_types.h>
 #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;
index 904b09b493c2aa0477997c66f8c35ec9d82c0b78..48eedcda37e28ce327839a2c1e7660915b946bcb 100644 (file)
@@ -17,7 +17,7 @@
 #include <stdint.h>
 #include <stdbool.h>
 
-#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;