AN2594: EEPROM emulation in STM32F10x microcontrollers: eeprom.h File Reference

AN2594: EEPROM

eeprom.h File Reference

Author:
MCD Application Team
More...

#include "stm32f10x.h"

Go to the source code of this file.


Defines

#define EEPROM_START_ADDRESS   ((uint32_t)0x08010000)
#define ERASED   ((uint16_t)0xFFFF)
#define NO_VALID_PAGE   ((uint16_t)0x00AB)
#define NumbOfVar   ((uint8_t)0x03)
#define PAGE0   ((uint16_t)0x0000)
#define PAGE0_BASE_ADDRESS   ((uint32_t)(EEPROM_START_ADDRESS + 0x000))
#define PAGE0_END_ADDRESS   ((uint32_t)(EEPROM_START_ADDRESS + (PAGE_SIZE - 1)))
#define PAGE1   ((uint16_t)0x0001)
#define PAGE1_BASE_ADDRESS   ((uint32_t)(EEPROM_START_ADDRESS + PAGE_SIZE))
#define PAGE1_END_ADDRESS   ((uint32_t)(EEPROM_START_ADDRESS + (2 * PAGE_SIZE - 1)))
#define PAGE_FULL   ((uint8_t)0x80)
#define READ_FROM_VALID_PAGE   ((uint8_t)0x00)
#define RECEIVE_DATA   ((uint16_t)0xEEEE)
#define VALID_PAGE   ((uint16_t)0x0000)
#define WRITE_IN_VALID_PAGE   ((uint8_t)0x01)

Functions

uint16_t EE_Init (void)
 Restore the pages to a known good state in case of page's status corruption after a power loss.
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.


Detailed Description

Author:
MCD Application Team

Version:
V3.1.0
Date:
07/27/2009 This file contains all the functions prototypes for the EEPROM emulation firmware library.

THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.

© COPYRIGHT 2009 STMicroelectronics

Definition in file eeprom.h.


Define Documentation

#define EEPROM_START_ADDRESS   ((uint32_t)0x08010000)

Definition at line 38 of file eeprom.h.

Referenced by EE_ReadVariable(), and EE_VerifyPageFullWriteVariable().

#define ERASED   ((uint16_t)0xFFFF)

Definition at line 56 of file eeprom.h.

Referenced by EE_Init().

#define NO_VALID_PAGE   ((uint16_t)0x00AB)

#define NumbOfVar   ((uint8_t)0x03)

Definition at line 68 of file eeprom.h.

Referenced by EE_Init(), and EE_PageTransfer().

#define PAGE0   ((uint16_t)0x0000)

#define PAGE0_BASE_ADDRESS   ((uint32_t)(EEPROM_START_ADDRESS + 0x000))

Definition at line 42 of file eeprom.h.

Referenced by EE_FindValidPage(), EE_Format(), EE_Init(), and EE_PageTransfer().

#define PAGE0_END_ADDRESS   ((uint32_t)(EEPROM_START_ADDRESS + (PAGE_SIZE - 1)))

Definition at line 43 of file eeprom.h.

#define PAGE1   ((uint16_t)0x0001)

Definition at line 50 of file eeprom.h.

Referenced by EE_FindValidPage(), and EE_PageTransfer().

#define PAGE1_BASE_ADDRESS   ((uint32_t)(EEPROM_START_ADDRESS + PAGE_SIZE))

Definition at line 45 of file eeprom.h.

Referenced by EE_FindValidPage(), EE_Format(), EE_Init(), and EE_PageTransfer().

#define PAGE1_END_ADDRESS   ((uint32_t)(EEPROM_START_ADDRESS + (2 * PAGE_SIZE - 1)))

Definition at line 46 of file eeprom.h.

#define PAGE_FULL   ((uint8_t)0x80)

Definition at line 65 of file eeprom.h.

Referenced by EE_VerifyPageFullWriteVariable(), and EE_WriteVariable().

#define READ_FROM_VALID_PAGE   ((uint8_t)0x00)

Definition at line 61 of file eeprom.h.

Referenced by EE_FindValidPage(), EE_PageTransfer(), and EE_ReadVariable().

#define RECEIVE_DATA   ((uint16_t)0xEEEE)

Definition at line 57 of file eeprom.h.

Referenced by EE_FindValidPage(), EE_Init(), and EE_PageTransfer().

#define VALID_PAGE   ((uint16_t)0x0000)

Definition at line 58 of file eeprom.h.

Referenced by EE_FindValidPage(), EE_Format(), EE_Init(), and EE_PageTransfer().

#define WRITE_IN_VALID_PAGE   ((uint8_t)0x01)

Definition at line 62 of file eeprom.h.

Referenced by EE_FindValidPage(), and EE_VerifyPageFullWriteVariable().

STM32F10x Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM32(CORTEX M3) 32-bit Microcontrollers platform visit www.st.com/STM32