Simple RAM file system.

Dependents:   modem_ref_helper

Committer:
Jeej
Date:
Thu Dec 14 18:24:53 2017 +0000
Revision:
5:d2b8d685f86f
Parent:
0:befc17558de9
Added data pointer fetching function.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Jeej 0:befc17558de9 1 #ifndef _FS_H_
Jeej 0:befc17558de9 2 #define _FS_H_
Jeej 0:befc17558de9 3
Jeej 0:befc17558de9 4 #include "mbed.h"
Jeej 0:befc17558de9 5
Jeej 0:befc17558de9 6 typedef struct {
Jeej 0:befc17558de9 7 uint8_t file_id;
Jeej 0:befc17558de9 8 uint8_t* header;
Jeej 0:befc17558de9 9 uint8_t* data;
Jeej 0:befc17558de9 10 void* next;
Jeej 0:befc17558de9 11 } ram_fs_file_t;
Jeej 0:befc17558de9 12
Jeej 0:befc17558de9 13 void ram_fs_new(uint8_t file_id, uint8_t* header, uint8_t* data);
Jeej 0:befc17558de9 14 bool ram_fs_delete(uint8_t file_id);
Jeej 0:befc17558de9 15 bool ram_fs_write(uint8_t file_id, uint16_t offset, uint16_t size, uint8_t* content);
Jeej 0:befc17558de9 16 bool ram_fs_read(uint8_t file_id, uint16_t offset, uint16_t size, uint8_t* buf);
Jeej 0:befc17558de9 17 void* ram_fs_get_header(uint8_t file_id);
Jeej 5:d2b8d685f86f 18 void* ram_fs_get_data(uint8_t file_id);
Jeej 0:befc17558de9 19
Jeej 0:befc17558de9 20 #endif // _FS_H_