Storage Device Interface
A generic driver interface for storage devices that store data.
Note: currently designed for file systems (e.g. SD card, USB drive). We might need to change this interface if we ever use a storage device that doesn’t store data in files (e.g. EEPROM)
/* Check if a location exists in the storage device */
bool checkExist(const char* location);
/* Read bytes from a location with an optional offset */
uint8_t read(const char* location, char data[], size_t size, size_t offset = 0);
/* Write bytes from a location with an optional offset */
uint8_t write(const char* location, const char data[], size_t size, size_t offset = 0);
/* Returns the length of the data at a location */
size_t length(const char* location);
/* Clean up the storage device after I/O operations */
uint8_t cleanup();