Define basic EEPROM data structures and functions

This commit is contained in:
2024-09-20 15:31:45 +02:00
parent e47812d98e
commit 2cb677445d
3 changed files with 32 additions and 0 deletions

View File

@@ -4,6 +4,7 @@
#include "common/math.h"
#include "common/types.h"
#include "common/watchdog.h"
#include "common/eeprom.h"
#include <stddef.h>
#include <stdarg.h>

17
src/common/eeprom.c Normal file
View File

@@ -0,0 +1,17 @@
#include "common.h"
// TODO: Implement EEPROM storage with wear leveling
int MEM_Read(mem_data_t *out)
{
UNUSED(out);
return 0;
}
int MEM_Write(mem_data_t *in)
{
UNUSED(in);
return 0;
}

14
src/common/eeprom.h Normal file
View File

@@ -0,0 +1,14 @@
#ifndef MAD_CORE_COMMON_EEPROM_H
#define MAD_CORE_COMMON_EEPROM_H
typedef struct mem_data_s mem_data_t;
struct mem_data_s {
byte sentinel; // Data marker bit
word value[2]; // Values to be written
};
int MEM_Read(mem_data_t *out);
int MEM_Write(mem_data_t *in);
#endif // MAD_CORE_COMMON_EEPROM_H