1.31.10.4 NVMCTRL_RowErase Function
C
bool NVMCTRL_RowErase( uint32_t address)
Summary
Erases a Row in the NVM
Description
This function will erase one row in NVM. The address of the row to be erased is specified by the address parameter. This address can be any address in the row. Calling this function will cause the CPU execution to stall, hence blocking execution of any other thread. Execution resumes when the Erase operation has completed.
If the interrupt operation was enabled and if a callback was registered, then the callback function will be called. The NVMCTRL_IsBusy() function can be used to poll for completion of the operation. The application should ensure that there are no other operations in progress before calling this function. Once the operation is complete, the NVMCTRL_ErrorGet() function can be called to check operation success. Erasing a row will erase all the contents of all the pages in the row.
Precondition
The NVMCTRL_Initialize() function should have been called once. Also validate if NVM controller is ready to accept new request by calling NVMCTRL_IsBusy().
Parameters
Param | Description |
---|---|
address | Any address in the row to be erased. |
Returns
Always returns true.
Example
// This code snippet shows how the NVMCTRL_RowErase function is called to
// erase the row at locatioin 0x30000.
NVMCTRL_Initialize();
// Erase the row. This will erase all the pages in the row.
NVMCTRL_RowErase(0x00030000);
while(NVMCTRL_IsBusy());
if(NVMCTRL_ErrorGet() == NVMCTRL_ERROR_NONE)
{
// Operation was successful.
}
Remarks
None.