commit e6a3da75af39e1cea98c277b0b0eced27aef47f2 Author: cfif Date: Wed Dec 4 13:10:49 2024 +0300 Init diff --git a/Inc/StorageIO.h b/Inc/StorageIO.h new file mode 100644 index 0000000..a027271 --- /dev/null +++ b/Inc/StorageIO.h @@ -0,0 +1,28 @@ +// +// Created by cfif on 07.10.22. +// + +#ifndef MODULE_STORAGEIO_H +#define MODULE_STORAGEIO_H + +#include "stdint.h" + +typedef enum { + STORAGE_OK = 0, + STORAGE_ERR_DATA = 1, + STORAGE_ERR_DEVICE = 2, +} eStorageStatus; + +typedef eStorageStatus (*StorageIOTransaction )(void *env, void *mem, size_t size); + +typedef struct { + void *env; + StorageIOTransaction load; + StorageIOTransaction dump; +} tStorageInterface; + +#define StorageDump(STORAGE, MEM, SIZE) (STORAGE)->dump((STORAGE)->env, MEM, SIZE) +#define StorageLoad(STORAGE, MEM, SIZE) (STORAGE)->load((STORAGE)->env, MEM, SIZE) + + +#endif //MODULE_STORAGEIO_H diff --git a/modular.json b/modular.json new file mode 100644 index 0000000..9bdd478 --- /dev/null +++ b/modular.json @@ -0,0 +1,7 @@ +{ + "cmake": { + "inc_dirs": [ + "Inc" + ] + } +} \ No newline at end of file