Make EEPROM transfers receive an operation and a buffer id parameter. This allows reading and writing both staging and validated user configurations which will aid future debugging. This API is also cleaner.
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
#ifndef __EEPROM_H__
|
||||
#define __EEPROM_H__
|
||||
|
||||
// Includes:
|
||||
|
||||
#include "config_parser/config_globals.h"
|
||||
|
||||
// Macros:
|
||||
|
||||
#define EEPROM_SIZE (32*1024)
|
||||
#define HARDWARE_CONFIG_SIZE 64
|
||||
#define USER_CONFIG_SIZE (EEPROM_SIZE - HARDWARE_CONFIG_SIZE)
|
||||
|
||||
#define EEPROM_ADDRESS_LENGTH 2
|
||||
#define EEPROM_PAGE_SIZE 64
|
||||
#define EEPROM_BUFFER_SIZE (EEPROM_ADDRESS_LENGTH + EEPROM_PAGE_SIZE)
|
||||
@@ -11,21 +18,18 @@
|
||||
// Typedefs:
|
||||
|
||||
typedef enum {
|
||||
EepromTransfer_ReadHardwareConfiguration,
|
||||
EepromTransfer_WriteHardwareConfiguration,
|
||||
EepromTransfer_ReadUserConfiguration,
|
||||
EepromTransfer_WriteUserConfiguration,
|
||||
} eeprom_transfer_t;
|
||||
EepromOperation_Read,
|
||||
EepromOperation_Write,
|
||||
} eeprom_operation_t;
|
||||
|
||||
// Variables:
|
||||
|
||||
extern bool IsEepromBusy;
|
||||
extern eeprom_transfer_t CurrentEepromTransfer;
|
||||
extern status_t EepromTransferStatus;
|
||||
|
||||
// Functions:
|
||||
|
||||
void EEPROM_Init(void);
|
||||
status_t EEPROM_LaunchTransfer(eeprom_transfer_t transferType, void (*successCallback));
|
||||
status_t EEPROM_LaunchTransfer(eeprom_operation_t operation, config_buffer_id_t config_buffer_id, void (*successCallback));
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user