Loading...
Searching...
No Matches

RIOT integration of SPIFFS. More...

Detailed Description

RIOT integration of SPIFFS.

The RIOT integration of SPIFFS follows the SPIFFS wiki: https://github.com/pellepl/spiffs/wiki/Integrate-spiffs#integrating-spiffs

The RIOT integration uses by default the SPIFFS_HAL_CALLBACK_EXTRA option and needs a mtd device, passed as spiffs_desc_t::dev.

If one disable SPIFFS_HAL_CALLBACK_EXTRA, the mtd device is passed through the SPIFFS_MTD_DEV macro as a mtd_dev_t pointer.

Note that only one filesystem can be used if SPIFFS_HAL_CALLBACK_EXTRA is disabled.

SPIFFS_SINGLETON is disabled by default, the memory layout is retrieved from the mtd device used. If SPIFFS_SINGLETON is enabled, the proper SPIFFS variables must be set (see spiffs_config.h from SPIFFS).

The default integration enable SPIFFS_CACHE and uses the macro SPIFFS_FS_CACHE_SIZE as cache size.

SPIFFS_LOCK and SPIFFS_UNLOCK are also defined in the RIOT custom spiffs_config.h to use spiffs_lock() and spiffs_unlock()

Files

file  spiffs_fs.h
 SPIFFS integration with vfs.
 

Data Structures

struct  spiffs_desc
 This contains everything needed to run an instance of SPIFFS. More...
 

Macros

#define SPIFFS_DIR_SIZE   (12)
 Size of the buffer needed for directory.
 

Typedefs

typedef struct spiffs_desc spiffs_desc_t
 This contains everything needed to run an instance of SPIFFS.
 

Functions

void spiffs_lock (struct spiffs_t *fs)
 SPIFFS lock function.
 
void spiffs_unlock (struct spiffs_t *fs)
 SPIFFS unlock function.
 

Variables

const vfs_file_system_t spiffs_file_system
 The SPIFFS vfs driver, a pointer to a spiffs_desc_t must be provided as vfs_mountp::private_data.
 

SPIFFS config constants

#define SPIFFS_FS_CACHE_SIZE   (512)
 the size of the cache buffer
 
#define SPIFFS_FS_WORK_SIZE   (512)
 The size of the work buffer.
 
#define SPIFFS_FS_FD_SPACE_SIZE   (4 * 32)
 the size of the file descriptor buffer
 

Macro Definition Documentation

◆ SPIFFS_DIR_SIZE

#define SPIFFS_DIR_SIZE   (12)

Size of the buffer needed for directory.

Definition at line 58 of file spiffs_fs.h.

◆ SPIFFS_FS_CACHE_SIZE

#define SPIFFS_FS_CACHE_SIZE   (512)

the size of the cache buffer

Ignored if cache is disabled in build config. One cache page will be slightly larger than the logical page size. The more ram, the more cache pages, the quicker the system.

Definition at line 77 of file spiffs_fs.h.

◆ SPIFFS_FS_FD_SPACE_SIZE

#define SPIFFS_FS_FD_SPACE_SIZE   (4 * 32)

the size of the file descriptor buffer

A file descriptor normally is around 32 bytes depending on the build config - the bigger the buffer, the more file descriptors are available.

Definition at line 99 of file spiffs_fs.h.

◆ SPIFFS_FS_WORK_SIZE

#define SPIFFS_FS_WORK_SIZE   (512)

The size of the work buffer.

A ram memory buffer being double the size of the logical page size This buffer is used extensively by the spiffs stack. If logical page size is 256, this buffer must be 512 bytes.

Definition at line 90 of file spiffs_fs.h.

Function Documentation

◆ spiffs_lock()

void spiffs_lock ( struct spiffs_t *  fs)

SPIFFS lock function.

This function must be used by SPIFFS_LOCK to lock the file system using the spiffs_desc_t::lock.

Parameters
fsspiffs descriptor

◆ spiffs_unlock()

void spiffs_unlock ( struct spiffs_t *  fs)

SPIFFS unlock function.

This function must be used by SPIFFS_UNLOCK to lock the file system using the spiffs_desc_t::lock.

Parameters
fsspiffs descriptor