32#define FS_MAX_FILES 16
33#define FS_MAX_NAME_LEN 12
34#define FS_MAX_FILE_SIZE 2048
35#define FS_TOTAL_BYTES (FS_MAX_FILES * FS_MAX_FILE_SIZE)
bool __fs_write(fs_file_t *f, const uint8_t *data, uint16_t len)
Privileged implementation of fs_write().
bool fs_write(fs_file_t *f, const uint8_t *data, uint16_t len)
Append data to an open file.
bool fs_create(const char *name, fs_file_t *out)
Create a new file with the given name.
bool fs_delete(const char *name)
Delete a file by name.
void __fs_init(void)
Privileged implementation of fs_init().
uint8_t __fs_list(fs_file_info_t *out, uint8_t max)
Privileged implementation of fs_list().
bool __fs_open(const char *name, fs_file_t *out)
Privileged implementation of fs_open().
uint16_t fs_read(fs_file_t *f, uint8_t *buf, uint16_t len, uint16_t offset)
Read bytes from an open file at a given offset.
bool __fs_create(const char *name, fs_file_t *out)
Privileged implementation of fs_create().
void fs_stats(fs_stats_t *out)
Return aggregate filesystem statistics.
uint8_t fs_list(fs_file_info_t *out, uint8_t max)
Enumerate all files currently in the filesystem.
bool fs_open(const char *name, fs_file_t *out)
Open an existing file by name.
void fs_init(void)
Clear all file table entries and zero the data store.
void __fs_stats(fs_stats_t *out)
Privileged implementation of fs_stats().
uint16_t __fs_read(fs_file_t *f, uint8_t *buf, uint16_t len, uint16_t offset)
Privileged implementation of fs_read().
bool __fs_delete(const char *name)
Privileged implementation of fs_delete().
Per-file metadata returned by fs_list().
uint16_t size
Current number of bytes written.
Opaque file handle — callers hold one of these per open file.
uint8_t slot
Index into internal file table (0-based).
bool valid
True if handle references a live file entry.
Aggregate filesystem statistics.
uint32_t free_bytes
Bytes available for new data.
uint32_t used_bytes
Bytes occupied by all file data.
uint32_t total_bytes
Total storage capacity in bytes.
uint8_t file_count
Number of files currently stored.