3.8.19.10 SEFC_PageBufferWrite Function
C
bool SEFC_PageBufferWrite( uint32_t *data, const uint32_t address)
Summary
Writes data to the internal buffer of SEFCx known as the latch buffer
Description
Depending on which flash panel is mapped at the given address, the function calls the associated SEFC flash controller instance and writes data to the SEFCx latch buffer. It is useful for performing multiple updates to the same flash page without erasing it multiple times. Once all updates are complete, the data can be committed to the flash by calling the SEFC_PageBufferCommit() API.
Precondition
The SEFCx_Initialize() function should have been called once.
Parameters
Param | Description |
---|---|
data | pointer to data buffer. |
address | Data Flash address to be modified. |
Returns
true if the operation was successful, else returns false.
Example
uint32_t* data; //data - pointer to the buffer to be written to flash memory
uint32_t flashAddr; //flashAddr - variable containing flash address
//populate data and flashAddr
SEFC_PageBufferWrite((uint32_t*)data, (uint32_t)flashAddr);
//Commit the final data in the SEFC internal page buffer to the flash memory
SEFC_PageBufferCommit((uint32_t)flashAddr);
//Wait until the SEFC controller is busy
while (SEFC_IsBusy(flashAddr));
Remarks
None