This repository has been archived on 2020-06-14. You can view files and clone it, but cannot push or open issues or pull requests.

48 lines
2.1 KiB
C

/**********************************************************************
* NAME: eeprom.h *
* AUTHOR: Philip Johansson *
* PURPOSE: Virtual EEPROM driver *
* INFORMATION: *
* This file mainly has two functions of which one brings the settings *
* from EEPROM and the other stores them *
* *
* All values we want in EEPROM have to be added to the EEPROM_ID_t *
* struct as well as defined in eeprom_Arr with a pointer to the data *
* *
* GLOBAL VARIABLES: *
* Variable Type Description *
* -------- ---- ----------- *
* *
**********************************************************************/
#ifndef CONFIG_EEPROM_H_
#define CONFIG_EEPROM_H_
#include "stm32f4xx.h"
/* Defines where emulated EEPROM starts from - OBS! Also defined in LinkerScript.id */
#define EEPROM_BASE_ADDR 0x080E0000
#define EEPROM_PROFILE_SIZE 20 // Size in uint32_t
typedef enum {
PROFILE_1 = 1,
PROFILE_2,
PROFILE_3
} ACTIVE_PROFILE;
extern uint8_t active_profile;
/***********************************************************************
* BRIEF: Writes EEPROM data to FLASH *
* INFORMATION: passes all data directly from where they are defined *
***********************************************************************/
void writeEEPROM();
/***********************************************************************
* BRIEF: Reads EEPROM data from FLASH *
* INFORMATION: passes all data directly to where they are defined *
***********************************************************************/
void readEEPROM();
#endif /* CONFIG_EEPROM_H_ */