1.32.16.10 NVMCTRL_RegionUnlock Function
C
The prototype of NVMCTRL_RegionUnlock() varies based on device family. Refer to the generated header file for the actual prototype to be used.
void NVMCTRL_RegionUnlock (uint32_t address); void NVMCTRL_RegionUnlock (NVMCTRL_MEMORY_REGION region);
Summary
Unlocks a NVM region.
Description
This function unlocks a region that was locked using the NVMCTRL_RegionLock() function. The address parameter can be any address within the region. Unlocking a region unlocks all pages in the region and makes these pages accessible to write and erase operations.
Precondition
Validate if NVM controller is ready to accept new request by calling NVMCTRL_IsBusy();
Parameters
Param | Description |
---|---|
address | Any address in the region to be unlocked. |
region | Region to be unlocked. |
Returns
None.
Example
// Wait till the NVMCTRL module is available and then un-lock the region containing address 0x30000.
while(NVMCTRL_IsBusy());
NVMCTRL_RegionUnlock(0x00030000);
while(NVMCTRL_IsBusy());
// Wait till the NVMCTRL module is available and then un-lock the application region. while(NVMCTRL_IsBusy()); NVMCTRL_RegionUnlock(NVMCTRL_MEMORY_REGION_APPLICATION); while(NVMCTRL_IsBusy());
Remarks
None.