This section describes the public APIs defined by the Emulated EEPROM.
Functions | |
| E_EEPROM_PSC1_STATUS_t | E_EEPROM_PSC1_Init (E_EEPROM_PSC1_t *const handle_ptr) |
| Initializes E_EEPROM_PSC1 APP with the associated configuration handle. More... | |
| E_EEPROM_PSC1_OPERATION_STATUS_t | E_EEPROM_PSC1_Write (uint8_t block_number, uint8_t *data_buffer_ptr) |
| Programs the user defined data block into the flash. More... | |
| E_EEPROM_PSC1_OPERATION_STATUS_t | E_EEPROM_PSC1_Read (uint8_t block_number, uint32_t block_offset, uint8_t *data_buffer_ptr, uint32_t length) |
| Reads the data block contents from flash for the requested block number. More... | |
| E_EEPROM_PSC1_OPERATION_STATUS_t | E_EEPROM_PSC1_StartGarbageCollection (void) |
| Executes garbage collection at runtime. More... | |
| E_EEPROM_PSC1_OPERATION_STATUS_t | E_EEPROM_PSC1_InvalidateBlock (uint8_t block_number) |
| Invalidate the user defined data block that was written into the flash. More... | |
| E_EEPROM_PSC1_STATUS_t | E_EEPROM_PSC1_GetStatus (void) |
| Checks the status of APP. More... | |
| bool | E_EEPROM_PSC1_IsGarbageCollectionNeeded (uint8_t block_number) |
| Check the availability of space in flash bank to write the data block. More... | |
| E_EEPROM_PSC1_OPERATION_STATUS_t | E_EEPROM_PSC1_GetPreviousData (uint8_t block_number, uint32_t block_offset, uint8_t *data_buffer_ptr, uint32_t length) |
| Reads the just previous copy of the block from flash for the requested block number. More... | |
| E_EEPROM_PSC1_STATUS_t E_EEPROM_PSC1_Init | ( | E_EEPROM_PSC1_t *const | handle_ptr | ) |
Initializes E_EEPROM_PSC1 APP with the associated configuration handle.
| handle_ptr | : Pointer to the handler of the instance for which this API is called |
| E_EEPROM_PSC1_OPERATION_STATUS_t E_EEPROM_PSC1_Write | ( | uint8_t | block_number, |
| uint8_t * | data_buffer_ptr | ||
| ) |
Programs the user defined data block into the flash.
| block_number | : Block ID Name/Number configured in the block table. Use the names defined in E_EEPROM_PSC1_BLOCK_t configuration structure array. |
| data_buffer_ptr | : Pointer to the user data buffer which need to be stored in flash |
NOTE :
It is advised to call this API when the APP in is IDLE state. This can be checked by calling E_EEPROM_PSC1_GetStatus() API and verifying the status.
Related APIs :
None
| E_EEPROM_PSC1_OPERATION_STATUS_t E_EEPROM_PSC1_Read | ( | uint8_t | block_number, |
| uint32_t | block_offset, | ||
| uint8_t * | data_buffer_ptr, | ||
| uint32_t | length | ||
| ) |
Reads the data block contents from flash for the requested block number.
| block_number | : Block ID Name/Number configured in the block table. Use the names defined in E_EEPROM_PSC1_BLOCK_t configuration structure array. |
| block_offset | : Offset position to start the read operation Range [0 - (Block size - 1)] |
| data_buffer_ptr | : Pointer to the data buffer where data has to be stored after read |
| length | : Number of the data block elements to be read from the FLASH Range [1 - (block size - block_offset)] |
IMPORTANT : This API do not perform any CRC verification for the read data.
NOTE :
If the flash is in busy state, the read will not be accepted.
| E_EEPROM_PSC1_OPERATION_STATUS_t E_EEPROM_PSC1_StartGarbageCollection | ( | void | ) |
Executes garbage collection at runtime.
NOTE :
If the flash is busy this will not be processed. It will check for any read write or erase errors and if any errors present it will return error.
| E_EEPROM_PSC1_OPERATION_STATUS_t E_EEPROM_PSC1_InvalidateBlock | ( | uint8_t | block_number | ) |
Invalidate the user defined data block that was written into the flash.
| block_number | : Block ID Name/Number configured in the block table |
NOTE :
It is advised to call this API when the APP in is IDLE state. This can be checked by calling E_EEPROM_PSC1_GetStatus() API and verifying the status.
Related APIs :
None
| E_EEPROM_PSC1_STATUS_t E_EEPROM_PSC1_GetStatus | ( | void | ) |
Checks the status of APP.
| bool E_EEPROM_PSC1_IsGarbageCollectionNeeded | ( | uint8_t | block_number | ) |
Check the availability of space in flash bank to write the data block.
| block_number | : Block ID Name/Number configured in the block table. Use the names defined in E_EEPROM_PSC1_BLOCK_t configuration structure array. |
IMPORTANT : This API shall be called only after the successful completion of E_EEPROM_PSC1_Init() API.
NOTE :
After initialization of the APP, calling this API can decide the need for Garbage collection. If this API returns true an explicit garbage collection can be done by calling the API E_EEPROM_PSC1_StartGarbageCollection().
| E_EEPROM_PSC1_OPERATION_STATUS_t E_EEPROM_PSC1_GetPreviousData | ( | uint8_t | block_number, |
| uint32_t | block_offset, | ||
| uint8_t * | data_buffer_ptr, | ||
| uint32_t | length | ||
| ) |
Reads the just previous copy of the block from flash for the requested block number.
| block_number | : Block ID Name/Number configured in the block table. Use the names defined in E_EEPROM_PSC1_BLOCK_t configuration structure array. |
| block_offset | : Offset position to start the read operation Range [0 - (Block size - 1)] |
| data_buffer_ptr | : Pointer to the data buffer where data has to be stored after read |
| length | : Number of the data block elements to be read from the FLASH Range [1 - (block size - block_offset)] |
IMPORTANT : This API do not perform any CRC verification for the read data.
NOTE :
If the flash is in busy state, the read will not be accepted.