Esp8266/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 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 #include <spi_flash.h>
19 #include <esp_attr.h>
20 
28 #define INTERNAL_FLASH_SECTOR_SIZE SPI_FLASH_SEC_SIZE
29 #define INTERNAL_FLASH_START_ADDRESS 0x40200000
30 
31 typedef enum {
32  MODE_QIO = 0,
33  MODE_QOUT = 1,
34  MODE_DIO = 2,
35  MODE_DOUT = 15,
36  MODE_SLOW_READ = 0xFE,
37  MODE_FAST_READ = 0xFF,
38 } SPIFlashMode;
39 
40 typedef enum {
46 
47 typedef enum {
53  SIZE_1MBIT = 0xFF,
54 } SPIFlashSize;
55 
63 uint32_t flashmem_write_internal(const void* from, uint32_t toaddr, uint32_t size);
64 
72 uint32_t flashmem_read_internal(void* to, uint32_t fromaddr, uint32_t size);
73 
74 #ifdef __cplusplus
75 }
76 #endif
77 
78 #include <flashmem.h>
SPIFlashSpeed
Definition: Esp8266/Components/spi_flash/include/esp_spi_flash.h:40
@ SPEED_80MHZ
Definition: Esp8266/Components/spi_flash/include/esp_spi_flash.h:44
@ SPEED_26MHZ
Definition: Esp8266/Components/spi_flash/include/esp_spi_flash.h:42
@ SPEED_20MHZ
Definition: Esp8266/Components/spi_flash/include/esp_spi_flash.h:43
@ SPEED_40MHZ
Definition: Esp8266/Components/spi_flash/include/esp_spi_flash.h:41
SPIFlashMode
Definition: Esp8266/Components/spi_flash/include/esp_spi_flash.h:31
@ MODE_QOUT
Definition: Esp8266/Components/spi_flash/include/esp_spi_flash.h:33
@ MODE_FAST_READ
Not supported.
Definition: Esp8266/Components/spi_flash/include/esp_spi_flash.h:37
@ MODE_DOUT
Definition: Esp8266/Components/spi_flash/include/esp_spi_flash.h:35
@ MODE_DIO
Definition: Esp8266/Components/spi_flash/include/esp_spi_flash.h:34
@ MODE_QIO
Definition: Esp8266/Components/spi_flash/include/esp_spi_flash.h:32
@ MODE_SLOW_READ
Not supported.
Definition: Esp8266/Components/spi_flash/include/esp_spi_flash.h:36
SPIFlashSize
Definition: Esp8266/Components/spi_flash/include/esp_spi_flash.h:47
@ SIZE_32MBIT
Definition: Esp8266/Components/spi_flash/include/esp_spi_flash.h:52
@ SIZE_1MBIT
Not supported.
Definition: Esp8266/Components/spi_flash/include/esp_spi_flash.h:53
@ SIZE_16MBIT
Definition: Esp8266/Components/spi_flash/include/esp_spi_flash.h:51
@ SIZE_8MBIT
Definition: Esp8266/Components/spi_flash/include/esp_spi_flash.h:50
@ SIZE_4MBIT
Definition: Esp8266/Components/spi_flash/include/esp_spi_flash.h:48
@ SIZE_2MBIT
Definition: Esp8266/Components/spi_flash/include/esp_spi_flash.h:49
uint32_t flashmem_read_internal(void *to, uint32_t fromaddr, uint32_t size)
Read from flash memory.
uint32_t flashmem_write_internal(const void *from, uint32_t toaddr, uint32_t size)
write to flash memory