Define basic EEPROM data structures and functions
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
#include "common/math.h"
|
#include "common/math.h"
|
||||||
#include "common/types.h"
|
#include "common/types.h"
|
||||||
#include "common/watchdog.h"
|
#include "common/watchdog.h"
|
||||||
|
#include "common/eeprom.h"
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|||||||
17
src/common/eeprom.c
Normal file
17
src/common/eeprom.c
Normal 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
14
src/common/eeprom.h
Normal 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
|
||||||
Reference in New Issue
Block a user