2016-09-16 10:10:18 +02:00
|
|
|
#ifndef __FLASH_API_H__
|
|
|
|
#define __FLASH_API_H__
|
|
|
|
#include "platform.h"
|
2016-09-22 09:18:22 +02:00
|
|
|
#include "esp_spi_flash.h"
|
2016-09-16 10:10:18 +02:00
|
|
|
|
|
|
|
uint32_t flash_safe_get_size_byte(void);
|
|
|
|
uint16_t flash_safe_get_sec_num(void);
|
2016-09-22 06:56:40 +02:00
|
|
|
|
2016-09-16 10:10:18 +02:00
|
|
|
uint32_t flash_rom_get_size_byte(void);
|
2016-09-22 06:56:40 +02:00
|
|
|
bool flash_rom_set_size_byte(uint32_t);
|
2016-09-16 10:10:18 +02:00
|
|
|
uint16_t flash_rom_get_sec_num(void);
|
2016-09-22 06:56:40 +02:00
|
|
|
uint8_t flash_rom_get_mode(void);
|
2016-09-16 10:10:18 +02:00
|
|
|
uint32_t flash_rom_get_speed(void);
|
|
|
|
|
2016-09-22 09:18:22 +02:00
|
|
|
#define FLASH_SIZE_1MBYTE ( 1 * 1024 * 1024)
|
|
|
|
#define FLASH_SIZE_2MBYTE ( 2 * 1024 * 1024)
|
|
|
|
#define FLASH_SIZE_4MBYTE ( 4 * 1024 * 1024)
|
|
|
|
#define FLASH_SIZE_8MBYTE ( 8 * 1024 * 1024)
|
|
|
|
#define FLASH_SIZE_16MBYTE (16 * 1024 * 1024)
|
|
|
|
|
|
|
|
#define flash_write spi_flash_write
|
2018-04-02 21:17:18 +02:00
|
|
|
esp_err_t flash_erase(size_t sector);
|
2016-09-22 09:18:22 +02:00
|
|
|
#define flash_read spi_flash_read
|
|
|
|
|
2016-09-16 10:10:18 +02:00
|
|
|
#endif // __FLASH_API_H__
|