2021-04-05 14:23:58 +03:00
|
|
|
// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD
|
2020-01-20 22:07:04 +02:00
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
2021-04-05 14:23:58 +03:00
|
|
|
#ifndef _LITTLEFS_H_
|
|
|
|
#define _LITTLEFS_H_
|
2020-01-20 22:07:04 +02:00
|
|
|
|
2021-04-05 14:23:58 +03:00
|
|
|
#include "FS.h"
|
2020-01-20 22:07:04 +02:00
|
|
|
|
2021-04-05 14:23:58 +03:00
|
|
|
namespace fs
|
|
|
|
{
|
2020-01-20 22:07:04 +02:00
|
|
|
|
2021-07-16 15:46:38 +03:00
|
|
|
class LittleFSFS : public FS
|
2021-04-05 14:23:58 +03:00
|
|
|
{
|
|
|
|
public:
|
2021-07-16 15:46:38 +03:00
|
|
|
LittleFSFS();
|
|
|
|
~LittleFSFS();
|
2021-04-15 07:31:01 -04:00
|
|
|
bool begin(bool formatOnFail=false, const char * basePath="/littlefs", uint8_t maxOpenFiles=10, const char * partitionLabel="spiffs");
|
2021-04-05 14:23:58 +03:00
|
|
|
bool format();
|
|
|
|
size_t totalBytes();
|
|
|
|
size_t usedBytes();
|
|
|
|
void end();
|
2021-04-15 07:31:01 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
char * partitionLabel_;
|
2021-04-05 14:23:58 +03:00
|
|
|
};
|
2020-01-20 22:07:04 +02:00
|
|
|
|
2021-04-05 14:23:58 +03:00
|
|
|
}
|
|
|
|
|
2021-07-16 15:46:38 +03:00
|
|
|
extern fs::LittleFSFS LittleFS;
|
2020-01-20 22:07:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
#endif
|