ChibiOS/HAL  6.1.0
mfs.h File Reference

Managed Flash Storage module header. More...

#include "hal_flash.h"

Go to the source code of this file.

Data Structures

union  mfs_bank_header_t
 Type of a bank header. More...
 
union  mfs_data_header_t
 Type of a data block header. More...
 
struct  MFSConfig
 Type of a MFS configuration structure. More...
 
struct  MFSDriver
 Type of an MFS instance. More...
 

Macros

Configuration options
#define MFS_CFG_MAX_RECORDS   32
 Maximum number of indexed records in the managed storage. More...
 
#define MFS_CFG_MAX_REPAIR_ATTEMPTS   3
 Maximum number of repair attempts on partition mount. More...
 
#define MFS_CFG_WRITE_VERIFY   TRUE
 Verify written data. More...
 
#define MFS_CFG_STRONG_CHECKING   TRUE
 Enables a stronger and slower check procedure on mount. More...
 
#define MFS_CFG_BUFFER_SIZE   32
 Size of the buffer used for data copying. More...
 
Error codes handling macros
#define MFS_IS_ERROR(err)   ((err) < MFS_NO_ERROR)
 
#define MFS_IS_WARNING(err)   ((err) > MFS_NO_ERROR)
 

Typedefs

typedef uint32_t mfs_id_t
 Type of a record identifier. More...
 

Enumerations

Functions

void mfsObjectInit (MFSDriver *mfsp)
 Initializes an instance. More...
 
mfs_error_t mfsStart (MFSDriver *mfsp, const MFSConfig *config)
 Configures and activates a MFS driver. More...
 
void mfsStop (MFSDriver *mfsp)
 Deactivates a MFS driver. More...
 
mfs_error_t mfsErase (MFSDriver *mfsp)
 Destroys the state of the managed storage by erasing the flash. More...
 
mfs_error_t mfsReadRecord (MFSDriver *mfsp, mfs_id_t id, size_t *np, uint8_t *buffer)
 Retrieves and reads a data record. More...
 
mfs_error_t mfsWriteRecord (MFSDriver *mfsp, mfs_id_t id, size_t n, const uint8_t *buffer)
 Creates or updates a data record. More...
 
mfs_error_t mfsEraseRecord (MFSDriver *mfsp, mfs_id_t id)
 Erases a data record. More...
 
mfs_error_t mfsPerformGarbageCollection (MFSDriver *mfsp)
 Enforces a garbage collection operation. More...
 

Detailed Description

Managed Flash Storage module header.

Definition in file mfs.h.