Working port of Little FS
This commit is contained in:
28
kernel/fs/portlfs/portlfs.h
Normal file
28
kernel/fs/portlfs/portlfs.h
Normal file
@ -0,0 +1,28 @@
|
||||
#ifndef FS_PORTLFS_PORTLFS_H_
|
||||
#define FS_PORTLFS_PORTLFS_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "fs/littlefs/lfs.h"
|
||||
|
||||
#define LITTLEFS_BLOCK_SIZE 4096
|
||||
|
||||
struct VfsMountPoint;
|
||||
|
||||
typedef struct {
|
||||
lfs_t instance;
|
||||
} LittleFs;
|
||||
|
||||
int32_t littlefs_read(struct VfsMountPoint *vmp, const char *path, uint8_t *const buffer, size_t n, size_t off);
|
||||
int32_t littlefs_write(struct VfsMountPoint *vmp, const char *path, const uint8_t *const buffer, size_t n, size_t off);
|
||||
int32_t littlefs_remove(struct VfsMountPoint *vmp, const char *path);
|
||||
int32_t littlefs_create(struct VfsMountPoint *vmp, const char *path, int32_t type);
|
||||
int32_t littlefs_cleanup(struct VfsMountPoint *vmp);
|
||||
bool littlefs_check(void);
|
||||
|
||||
int portlfs_read(const struct lfs_config *c, lfs_block_t block, lfs_off_t off, void *buffer, lfs_size_t size);
|
||||
int portlfs_prog(const struct lfs_config *c, lfs_block_t block, lfs_off_t off, const void *buffer, lfs_size_t size);
|
||||
int portlfs_erase(const struct lfs_config *c, lfs_block_t block);
|
||||
int portlfs_sync(const struct lfs_config *c);
|
||||
|
||||
#endif // FS_PORTLFS_PORTLFS_H_
|
Reference in New Issue
Block a user