Electronic Components Datasheet Search
  New Zealand  ▼
ALLDATASHEET.CO.NZ

X  

AN2540 Datasheet(PDF) 12 Page - STMicroelectronics

Part # AN2540
Description  EEPROM emulation in STR91xFxx devices
PDF  25 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN2540 Datasheet(HTML) 12 Page - STMicroelectronics

Back Button AN2540 Datasheet HTML 8Page - STMicroelectronics AN2540 Datasheet HTML 9Page - STMicroelectronics AN2540 Datasheet HTML 10Page - STMicroelectronics AN2540 Datasheet HTML 11Page - STMicroelectronics AN2540 Datasheet HTML 12Page - STMicroelectronics AN2540 Datasheet HTML 13Page - STMicroelectronics AN2540 Datasheet HTML 14Page - STMicroelectronics AN2540 Datasheet HTML 15Page - STMicroelectronics AN2540 Datasheet HTML 16Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 12 / 25 page
background image
Implementing the EEPROM emulation
AN2540 - Application note
12/25
3.2.2.1 User API definition
Table 2.
EepromFormat
Function Name
EepromFormat
Function Prototype
u8 EepromFormat(void);
Behavior Description
This function erases sector0 and sector1 and writes a
VALID_SECTOR header to sector0.
Input Parameter
None
Return Parameter
Status of the operation.
Called functions
FMI_EraseSector,FMI_WaitForLastOperation,FMI_WriteHalfWord
Table 3.
FindValidSector
Function Name
FindValidSector
Function Prototype
u8 FindValidSector(u8 operation);
Behavior Description
This function reads both sector’s headers and returns the sector
number which contains valid data.
Input Parameter
A byte indicating that we are looking for a valid sector for write or read
operation(READ_FROM_VALID_SECTOR or
WRITE_IN_VALID_SECTOR
Return Parameter
Sector number.
Called functions
FMI_ReadWord.
Table 4.
ReadVariable
Function Name
ReadVariable
Function Prototype
u16 ReadVariable(u8 index, u32 *T);
Behavior Description
This function reads variable data. Only last update is read. The
function enters a loop in which it reads the variable entries until the
last one is found. Finally, the data is returned.
Input Parameter
– index: variable identifier
– T: variable array
Return Parameter
Returns 16-bit read data on success or error code on failure.
Called functions
FindValidSector.
Table 5.
WriteVariable
Function Name
WriteVariable
Function Prototype
u8 WriteVariable(u8 index, u32 *T, u16 data);
Behavior Description
This function is called by the user application to update a variable
Input Parameter
– index: variable identifier
– T: variable array
– data: 16-bit data to be written
Return Parameter
Returns 1 on success or error code on failure
Called functions
WriteVerifyVariableFull, EepromSectorTransfer.



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com