Esp32/Components/spi_flash/include/esp_spi_flash.h
Go to the documentation of this file.
1 /****
2  * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
3  * Created 2015 by Skurydin Alexey
4  * http://github.com/SmingHub/Sming
5  * All files of the Sming Core are provided under the LGPL v3 license.
6  *
7  * Based on NodeMCU platform_flash
8  * https://github.com/nodemcu/nodemcu-firmware
9  *
10  ****/
11 
12 #pragma once
13 
14 #include <esp_idf_version.h>
15 #if ESP_IDF_VERSION_MAJOR < 5
16 #include_next <esp_spi_flash.h>
17 #else
18 #include <spi_flash_mmap.h>
19 #endif
20 #include <rom/spi_flash.h>
21 #include <esp_app_format.h>
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #define INTERNAL_FLASH_SECTOR_SIZE SPI_FLASH_SEC_SIZE
28 
29 typedef enum {
30  MODE_QIO = ESP_IMAGE_SPI_MODE_QIO,
31  MODE_QOUT = ESP_IMAGE_SPI_MODE_QOUT,
32  MODE_DIO = ESP_IMAGE_SPI_MODE_DIO,
33  MODE_DOUT = ESP_IMAGE_SPI_MODE_DOUT,
34  MODE_FAST_READ = ESP_IMAGE_SPI_MODE_FAST_READ,
35  MODE_SLOW_READ = ESP_IMAGE_SPI_MODE_SLOW_READ,
36 } SPIFlashMode;
37 
38 typedef enum {
39  SPEED_40MHZ = 0, // ESP_IMAGE_SPI_SPEED_40M
40  SPEED_26MHZ = 1, // ESP_IMAGE_SPI_SPEED_26M
41  SPEED_20MHZ = 2, // ESP_IMAGE_SPI_SPEED_20M
42  SPEED_80MHZ = 0x0f, // ESP_IMAGE_SPI_SPEED_80M
44 
45 typedef enum {
46  SIZE_1MBIT = ESP_IMAGE_FLASH_SIZE_1MB,
47  SIZE_2MBIT = ESP_IMAGE_FLASH_SIZE_2MB,
48  SIZE_4MBIT = ESP_IMAGE_FLASH_SIZE_4MB,
49  SIZE_8MBIT = ESP_IMAGE_FLASH_SIZE_8MB,
50  SIZE_16MBIT = ESP_IMAGE_FLASH_SIZE_16MB,
51  SIZE_32MBIT = 0xFF,
52 } SPIFlashSize;
53 
54 #ifdef __cplusplus
55 }
56 #endif
57 
58 #include <flashmem.h>
SPIFlashSpeed
Definition: Esp32/Components/spi_flash/include/esp_spi_flash.h:38
SPIFlashMode
Definition: Esp32/Components/spi_flash/include/esp_spi_flash.h:29
SPIFlashSize
Definition: Esp32/Components/spi_flash/include/esp_spi_flash.h:45
@ SPEED_80MHZ
Definition: Esp32/Components/spi_flash/include/esp_spi_flash.h:42
@ SPEED_26MHZ
Definition: Esp32/Components/spi_flash/include/esp_spi_flash.h:40
@ SPEED_20MHZ
Definition: Esp32/Components/spi_flash/include/esp_spi_flash.h:41
@ SPEED_40MHZ
Definition: Esp32/Components/spi_flash/include/esp_spi_flash.h:39
@ MODE_QOUT
Definition: Esp32/Components/spi_flash/include/esp_spi_flash.h:31
@ MODE_FAST_READ
Definition: Esp32/Components/spi_flash/include/esp_spi_flash.h:34
@ MODE_DOUT
Definition: Esp32/Components/spi_flash/include/esp_spi_flash.h:33
@ MODE_DIO
Definition: Esp32/Components/spi_flash/include/esp_spi_flash.h:32
@ MODE_QIO
Definition: Esp32/Components/spi_flash/include/esp_spi_flash.h:30
@ MODE_SLOW_READ
Definition: Esp32/Components/spi_flash/include/esp_spi_flash.h:35
@ SIZE_32MBIT
Not listed.
Definition: Esp32/Components/spi_flash/include/esp_spi_flash.h:51
@ SIZE_1MBIT
Definition: Esp32/Components/spi_flash/include/esp_spi_flash.h:46
@ SIZE_16MBIT
Definition: Esp32/Components/spi_flash/include/esp_spi_flash.h:50
@ SIZE_8MBIT
Definition: Esp32/Components/spi_flash/include/esp_spi_flash.h:49
@ SIZE_4MBIT
Definition: Esp32/Components/spi_flash/include/esp_spi_flash.h:48
@ SIZE_2MBIT
Definition: Esp32/Components/spi_flash/include/esp_spi_flash.h:47