42 ssize_t (*
program)(
int address,
const void *data,
size_t size);
50 ssize_t (*
read)(
int address,
void *data,
size_t size);
int ringfs_count_exact(struct ringfs *fs)
Calculate exact object count.
int sector_size
Sector size, in bytes.
int sector_count
Partition size, in sectors.
int ringfs_rewind(struct ringfs *fs)
Rewind the read cursor back to the oldest object.
Flash memory+parition descriptor.
int ringfs_discard(struct ringfs *fs)
Discard all fetched objects up to the read cursor.
int ringfs_format(struct ringfs *fs)
Format the flash memory.
int ringfs_append(struct ringfs *fs, const void *object)
Append an object at the end of the ring.
ssize_t(* program)(int address, const void *data, size_t size)
Program flash memory bits by toggling them from 1 to 0.
ssize_t(* read)(int address, void *data, size_t size)
Read flash memory.
int ringfs_capacity(struct ringfs *fs)
Calculate maximum RingFS capacity.
int ringfs_scan(struct ringfs *fs)
Scan the flash memory for a valid filesystem.
int sector_offset
Partition offset, in sectors.
static const struct ringfs_flash_partition flash
int ringfs_fetch(struct ringfs *fs, void *object)
Fetch next object from the ring, oldest-first.
int ringfs_count_estimate(struct ringfs *fs)
Calculate approximate object count.
int(* sector_erase)(int address)
Erase a sector.
const struct ringfs_flash_partition * flash
int ringfs_init(struct ringfs *fs, const struct ringfs_flash_partition *flash, uint32_t version, int object_size)
Initialize a RingFS instance.