mirror of
				https://github.com/espressif/esp-idf.git
				synced 2025-10-31 13:09:38 +00:00 
			
		
		
		
	esp_flash: break the inappropriate include chain in spi_flash_host_drv.h
This commit is contained in:
		| @@ -24,6 +24,7 @@ | |||||||
|  |  | ||||||
| #include <stdlib.h> | #include <stdlib.h> | ||||||
| #include "soc/spi_periph.h" | #include "soc/spi_periph.h" | ||||||
|  | #include "hal/spi_flash_types.h" | ||||||
| #include <sys/param.h> // For MIN/MAX | #include <sys/param.h> // For MIN/MAX | ||||||
| #include <stdbool.h> | #include <stdbool.h> | ||||||
| #include <string.h> | #include <string.h> | ||||||
| @@ -43,18 +44,6 @@ | |||||||
| ///Slowest io mode supported by ESP32, currently SlowRd | ///Slowest io mode supported by ESP32, currently SlowRd | ||||||
| #define SPI_FLASH_READ_MODE_MIN SPI_FLASH_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 | /// type to store pre-calculated register value in above layers | ||||||
| typedef typeof(SPI1.clock) spi_flash_ll_clock_reg_t; | typedef typeof(SPI1.clock) spi_flash_ll_clock_reg_t; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -23,7 +23,7 @@ | |||||||
| #pragma once | #pragma once | ||||||
|  |  | ||||||
| #include "hal/spi_flash_ll.h" | #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" | #include "soc/soc_memory_layout.h" | ||||||
|  |  | ||||||
| #define ESP_FLASH_DEFAULT_FREQ ESP_FLASH_20MHZ | #define ESP_FLASH_DEFAULT_FREQ ESP_FLASH_20MHZ | ||||||
|   | |||||||
| @@ -14,7 +14,7 @@ | |||||||
| 
 | 
 | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include "hal/spi_flash_ll.h" | #include <esp_types.h> | ||||||
| #include "hal/esp_flash_err.h" | #include "hal/esp_flash_err.h" | ||||||
| 
 | 
 | ||||||
| /** Definition of a common transaction. Also holds the return value. */ | /** 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
 |     uint32_t miso_data[2];  ///< [out] Input data from slave, little endian
 | ||||||
| } spi_flash_trans_t; | } 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; | struct spi_flash_host_driver_t; | ||||||
| typedef struct spi_flash_host_driver_t spi_flash_host_driver_t; | typedef struct spi_flash_host_driver_t spi_flash_host_driver_t; | ||||||
| @@ -17,7 +17,7 @@ | |||||||
| #include <stdint.h> | #include <stdint.h> | ||||||
| #include <stdbool.h> | #include <stdbool.h> | ||||||
|  |  | ||||||
| #include "hal/spi_flash_host_drv.h" | #include "hal/spi_flash_types.h" | ||||||
|  |  | ||||||
| struct spi_flash_chip_t; | struct spi_flash_chip_t; | ||||||
| typedef struct spi_flash_chip_t spi_flash_chip_t; | typedef struct spi_flash_chip_t spi_flash_chip_t; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Michael (XIAO Xufeng)
					Michael (XIAO Xufeng)