mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-23 19:21:59 +03:00
cleanup/unify flash sector size define value (#5327)
* cleanup/unify sector size define value * replicate spi_flash_sec_size.h file for host tests * further flash geometry cleanup, remove host test duplicate file
This commit is contained in:
@ -21,39 +21,17 @@
|
||||
#ifndef FLASH_UTILS_H
|
||||
#define FLASH_UTILS_H
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int SPIEraseBlock(uint32_t block);
|
||||
int SPIEraseSector(uint32_t sector);
|
||||
int SPIRead(uint32_t addr, void *dest, size_t size);
|
||||
int SPIWrite(uint32_t addr, void *src, size_t size);
|
||||
int SPIEraseAreaEx(const uint32_t start, const uint32_t size);
|
||||
/* Definitions are placed in eboot. Include them here rather than duplicate them.
|
||||
* Also, prefer to have eboot standalone as much as possible and have the core depend on it
|
||||
* rather than have eboot depend on the core.
|
||||
*/
|
||||
#include <../../bootloaders/eboot/flash.h>
|
||||
|
||||
#define FLASH_SECTOR_SIZE 0x1000
|
||||
#define FLASH_BLOCK_SIZE 0x10000
|
||||
#define APP_START_OFFSET 0x1000
|
||||
|
||||
typedef struct {
|
||||
unsigned char magic;
|
||||
unsigned char num_segments;
|
||||
|
||||
/* SPI Flash Interface (0 = QIO, 1 = QOUT, 2 = DIO, 0x3 = DOUT) */
|
||||
unsigned char flash_mode;
|
||||
|
||||
/* High four bits: 0 = 512K, 1 = 256K, 2 = 1M, 3 = 2M, 4 = 4M, 8 = 8M, 9 = 16M
|
||||
Low four bits: 0 = 40MHz, 1= 26MHz, 2 = 20MHz, 0xf = 80MHz */
|
||||
unsigned char flash_size_freq;
|
||||
|
||||
uint32_t entry;
|
||||
} image_header_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint32_t address;
|
||||
uint32_t size;
|
||||
} section_header_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Reference in New Issue
Block a user