| 数据搜索系统,热门电子元器件搜索 |
|
AN2540 数据表(PDF) 13 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2540 数据表(HTML) 13 Page - STMicroelectronics |
|
13 / 25 page ![]() AN2540 - Application note Implementing the EEPROM emulation 13/25 The procedure of updating a variable entry in the EEPROM is shown in Figure 4. Figure 4. 1st method: WriteVariable flowchart If the data to be written is equal to 0xFFFF, it is necessary to find the last data equal to 0xFFFF and to write 0x0000 into the next location to indicate that 0xFFFF represents data and not a blank location. If the data to be written is different from 0xFFFF, it is then written to the last location that contains 0xFFFFh (the following location should not contain 0x0000). This function returns 0 on success, VARIABLE_FULL if there is not enough memory space for a variable update, or a Flash error code indicating an operation failure (erase or program). Table 6. WriteVerifyVariableFull Function Name WriteVerifyVariableFull Function Prototype u16 WriteVerifyVariableFull(u8 index, u32 *T, u16Data); Behavior Description If a write operation takes place, the write process must either update a variable, or create the first instance of a variable. Input Parameter – variable index, in the demonstration example provided: (0 for A, 1 for B or 2 for C). – T: variable Array – 16-bit data to be written Return Parameter Returns 1 on success or 0x80 if variable is full or Flash error code Called functions FindValidSector,FMI_ReadWord,FMI_WriteHalfWord Add element request full current record Add new element at the 1st empty element place in the current record of active sector Erase previous active sector End End Change the active sector Find Valid sector Yes No FindValidSector() WriteVerifyVariableFull() Copy each latest element of each available record by reading from bottom taking into account the new updated element. EepromSectorTransfer() ReadVariable() Function call ai14088 |
|
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| 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 |