54#ifdef USE_EEPROM_EMULATION
57#include "stm32f4xx_hal.h"
61#define EE_OK (uint32_t)HAL_OK
62#define EE_ERROR (uint32_t)HAL_ERROR
63#define EE_BUSY (uint32_t)HAL_BUSY
64#define EE_TIMEOUT (uint32_t)HAL_TIMEOUT
70#define VOLTAGE_RANGE (uint8_t)VOLTAGE_RANGE_3
82#define PAGE0_BASE_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + 0x0000))
83#define PAGE0_END_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + (PAGE_SIZE - 1)))
85#define PAGE0_ID FLASH_SECTOR_1
88#define PAGE1_BASE_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + PAGE_SIZE))
89#define PAGE1_END_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + (2 * PAGE_SIZE - 1)))
91#define PAGE1_ID FLASH_SECTOR_2
95#define PAGE0 ((uint16_t)0x0000)
96#define PAGE1 ((uint16_t)0x0001)
99#define NO_VALID_PAGE ((uint16_t)0x00AB)
102#define ERASED ((uint16_t)0xFFFF)
103#define RECEIVE_DATA ((uint16_t)0xEEEE)
104#define VALID_PAGE ((uint16_t)0x0000)
107#define READ_FROM_VALID_PAGE ((uint8_t)0x00)
108#define WRITE_IN_VALID_PAGE ((uint8_t)0x01)
111#define PAGE_FULL ((uint8_t)0x80)
uint16_t EE_ReadVariable(uint16_t VirtAddress, uint16_t *Data)
Returns the last stored variable data, if found, which correspond to the passed virtual address.
uint16_t EE_WriteVariable(uint16_t VirtAddress, uint16_t Data)
Writes/upadtes variable data in EEPROM.
HAL_StatusTypeDef EE_Format()
Erases PAGE and PAGE1 and writes VALID_PAGE header to PAGE.
uint16_t EE_Init(void)
Restore the pages to a known good state in case of page's status corruption after a power loss.