Rp2040/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 <esp_system.h>
19 #include <sys/pgmspace.h>
20 
21 #define INTERNAL_FLASH_SECTOR_SIZE 4096
22 #define INTERNAL_FLASH_START_ADDRESS FLASH_BASE
23 
24 typedef enum {
25  MODE_QIO = 0,
26  MODE_QOUT = 1,
27  MODE_DIO = 2,
28  MODE_DOUT = 15,
29  MODE_SLOW_READ = 0xFE,
30  MODE_FAST_READ = 0xFF,
31 } SPIFlashMode;
32 
33 typedef enum {
39 
40 typedef enum {
46  SIZE_1MBIT = 0xFF,
47 } SPIFlashSize;
48 
49 /*
50  * @brief Read flash SFDP device information (standard for Serial Flash Discoverable Parameters)
51  * @param addr First memory location to read
52  * @param buffer Buffer for data
53  * @param count Number of bytes to read
54  * @ingroup flash
55  */
56 void flashmem_sfdp_read(uint32_t addr, void* buffer, size_t count);
57 
58 #ifdef __cplusplus
59 }
60 #endif
61 
62 #include <flashmem.h>
SPIFlashSpeed
Definition: Rp2040/Components/spi_flash/include/esp_spi_flash.h:33
SPIFlashMode
Definition: Rp2040/Components/spi_flash/include/esp_spi_flash.h:24
SPIFlashSize
Definition: Rp2040/Components/spi_flash/include/esp_spi_flash.h:40
void flashmem_sfdp_read(uint32_t addr, void *buffer, size_t count)
@ SPEED_80MHZ
Definition: Rp2040/Components/spi_flash/include/esp_spi_flash.h:37
@ SPEED_26MHZ
Definition: Rp2040/Components/spi_flash/include/esp_spi_flash.h:35
@ SPEED_20MHZ
Definition: Rp2040/Components/spi_flash/include/esp_spi_flash.h:36
@ SPEED_40MHZ
Definition: Rp2040/Components/spi_flash/include/esp_spi_flash.h:34
@ MODE_QOUT
Definition: Rp2040/Components/spi_flash/include/esp_spi_flash.h:26
@ MODE_FAST_READ
Not supported.
Definition: Rp2040/Components/spi_flash/include/esp_spi_flash.h:30
@ MODE_DOUT
Definition: Rp2040/Components/spi_flash/include/esp_spi_flash.h:28
@ MODE_DIO
Definition: Rp2040/Components/spi_flash/include/esp_spi_flash.h:27
@ MODE_QIO
Definition: Rp2040/Components/spi_flash/include/esp_spi_flash.h:25
@ MODE_SLOW_READ
Not supported.
Definition: Rp2040/Components/spi_flash/include/esp_spi_flash.h:29
@ SIZE_32MBIT
Definition: Rp2040/Components/spi_flash/include/esp_spi_flash.h:45
@ SIZE_1MBIT
Not supported.
Definition: Rp2040/Components/spi_flash/include/esp_spi_flash.h:46
@ SIZE_16MBIT
Definition: Rp2040/Components/spi_flash/include/esp_spi_flash.h:44
@ SIZE_8MBIT
Definition: Rp2040/Components/spi_flash/include/esp_spi_flash.h:43
@ SIZE_4MBIT
Definition: Rp2040/Components/spi_flash/include/esp_spi_flash.h:41
@ SIZE_2MBIT
Definition: Rp2040/Components/spi_flash/include/esp_spi_flash.h:42