2016-06-27 15:06:06 +00:00
|
|
|
/**
|
|
|
|
* ESP8266 SPIFFS HAL configuration.
|
|
|
|
*
|
|
|
|
* Part of esp-open-rtos
|
|
|
|
* Copyright (c) 2016 sheinz https://github.com/sheinz
|
|
|
|
* MIT License
|
|
|
|
*/
|
|
|
|
#ifndef __ESP_SPIFFS_H__
|
|
|
|
#define __ESP_SPIFFS_H__
|
|
|
|
|
|
|
|
#include "spiffs.h"
|
|
|
|
|
|
|
|
extern spiffs fs;
|
|
|
|
|
2016-08-08 15:08:42 +00:00
|
|
|
#if SPIFFS_SINGLETON == 1
|
2016-06-27 15:06:06 +00:00
|
|
|
/**
|
2016-07-15 12:22:03 +00:00
|
|
|
* Prepare for SPIFFS mount.
|
2016-07-18 10:12:21 +00:00
|
|
|
*
|
2016-07-15 12:22:03 +00:00
|
|
|
* The function allocates all the necessary buffers.
|
|
|
|
*/
|
|
|
|
void esp_spiffs_init();
|
2016-08-08 15:08:42 +00:00
|
|
|
#else
|
|
|
|
/**
|
|
|
|
* Prepare for SPIFFS mount.
|
|
|
|
*
|
|
|
|
* The function allocates all the necessary buffers.
|
|
|
|
*
|
|
|
|
* @param addr Base address for spiffs in flash memory.
|
|
|
|
* @param size File sistem size.
|
|
|
|
*/
|
|
|
|
void esp_spiffs_init(uint32_t addr, uint32_t size);
|
|
|
|
#endif
|
|
|
|
|
2016-07-15 12:22:03 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Free all memory buffers that were used by SPIFFS.
|
2016-06-27 15:06:06 +00:00
|
|
|
*
|
2016-07-15 12:22:03 +00:00
|
|
|
* The function should be called after SPIFFS unmount if the file system is not
|
|
|
|
* going to need any more.
|
2016-06-27 15:06:06 +00:00
|
|
|
*/
|
2016-07-15 12:22:03 +00:00
|
|
|
void esp_spiffs_deinit();
|
2016-06-27 15:06:06 +00:00
|
|
|
|
|
|
|
/**
|
2016-07-15 12:22:03 +00:00
|
|
|
* Mount SPIFFS.
|
|
|
|
*
|
|
|
|
* esp_spiffs_init must be called first.
|
|
|
|
*
|
|
|
|
* Return SPIFFS return code.
|
2016-06-27 15:06:06 +00:00
|
|
|
*/
|
2016-07-15 12:22:03 +00:00
|
|
|
int32_t esp_spiffs_mount();
|
2016-06-27 15:06:06 +00:00
|
|
|
|
|
|
|
#endif // __ESP_SPIFFS_H__
|