Qdatasheet_Logo
Integrated circuits, Transistor, Semiconductors Search and Datasheet PDF Download Site

AN2077 View Datasheet(PDF) - STMicroelectronics

Part Name
Description
MFG CO.
AN2077
ST-Microelectronics
STMicroelectronics ST-Microelectronics
'AN2077' PDF : 19 Pages View PDF
EEPROM Emulation with STR71x
With this order of execution we ensure that, even if a reset event or a power cut event occurs,
the last valid Data-Set cannot be lost.
This function returns the following status messages:
– EEPROM_FULL_ERASE_REQUIRED: To indicate if a full erase is required,
– EEPROM_SUCCESSFUL_DATA_WRITE: To indicate if the new Data-set is written suc-
cessfully.
The function EEPROM_DataWrite uses three internal functions:
– EEPROM_GetValidSector: This function returns the valid sector,
– EEPROM_ValidDataSet: This function returns the offset of the valid Data-set (if it exists),
– EEPROM_UpdateDataSet: This function is used to update the corresponding status bit.
As an example of how to use this function:
/* Declaration */
u32 Write_Status; /* The status of the write operation */
u32 Data_Set; /* The new Data-set */
/* Initialize the new Data-set */
Data_Set = 0x12345678
/* Write the new Data-set to the valid sector */
Write_Status = EEPROM_DataWrite(&Data_Set);
4.3 EEPROM OUTPUT FUNCTIONS USE EXAMPLE
In this subsection an example of how to use the three output functions of the EEPROM Emu-
lation is presented.
The following example allows to write and read three Data-set.
15/19
Share Link: GO URL

All Rights Reserved © qdatasheet.com  [ Privacy Policy ] [ Contact Us ]