42 lines
829 B
C
42 lines
829 B
C
#ifndef _SPIFFS_H
|
|
#define _SPIFFS_H
|
|
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <sys/unistd.h>
|
|
#include <sys/stat.h>
|
|
#include "esp_err.h"
|
|
#include "esp_log.h"
|
|
#include "esp_spiffs.h"
|
|
|
|
|
|
#define FILE_TAG "spiffs"
|
|
|
|
|
|
typedef struct
|
|
{
|
|
uint8_t type;
|
|
uint32_t file_size;
|
|
uint16_t buff_size;
|
|
char file_name[20];
|
|
uint8_t buff[256];
|
|
}spiffs_data_t;
|
|
|
|
typedef struct spiffs_list_
|
|
{
|
|
uint32_t id;
|
|
char name[32];
|
|
uint32_t addr;
|
|
uint32_t size;
|
|
}spiffs_list_t;
|
|
|
|
extern esp_err_t init_spiffs(void);
|
|
extern esp_err_t sdmmc_init(void);
|
|
extern void list_files_in_spiffs(spiffs_list_t *directory, size_t max_files);
|
|
extern void delete_file(const char *file_path);
|
|
extern void delete_all_file();
|
|
// void Read_file(char* filename, Read_data data,uint16_t size);
|
|
|
|
|
|
|
|
#endif |