nrfx 2.5
Macros | Enumerations | Functions
NVMC HAL

Hardware access layer (HAL) for managing the Non-Volatile Memory Controller (NVMC) peripheral. More...

Macros

#define NRF_NVMC_PARTIAL_ERASE_PRESENT
 Symbol indicating whether the option of page partial erase is present.
 

Enumerations

enum  nrf_nvmc_mode_t {
  NRF_NVMC_MODE_READONLY = NVMC_CONFIG_WEN_Ren,
  NRF_NVMC_MODE_WRITE = NVMC_CONFIG_WEN_Wen,
  NRF_NVMC_MODE_ERASE = NVMC_CONFIG_WEN_Een
}
 NVMC modes. More...
 
enum  nrf_nvmc_ns_mode_t {
  NRF_NVMC_NS_MODE_READONLY = NVMC_CONFIGNS_WEN_Ren,
  NRF_NVMC_NS_MODE_WRITE = NVMC_CONFIGNS_WEN_Wen,
  NRF_NVMC_NS_MODE_ERASE = NVMC_CONFIGNS_WEN_Een
}
 Non-secure NVMC modes. More...
 

Functions

NRF_STATIC_INLINE bool nrf_nvmc_ready_check (NRF_NVMC_Type const *p_reg)
 Function for checking if NVMC is ready to perform write or erase operation. More...
 
NRF_STATIC_INLINE bool nrf_nvmc_write_ready_check (NRF_NVMC_Type const *p_reg)
 Function for checking if NVMC is ready to accept the next write operation. More...
 
NRF_STATIC_INLINE void nrf_nvmc_mode_set (NRF_NVMC_Type *p_reg, nrf_nvmc_mode_t mode)
 Function for setting the NVMC mode. More...
 
NRF_STATIC_INLINE void nrf_nvmc_nonsecure_mode_set (NRF_NVMC_Type *p_reg, nrf_nvmc_ns_mode_t mode)
 Function for setting the NVMC mode for non-secure Flash page operations. More...
 
NRF_STATIC_INLINE void nrf_nvmc_page_erase_start (NRF_NVMC_Type *p_reg, uint32_t page_addr)
 Function for starting a single page erase in the Flash memory. More...
 
NRF_STATIC_INLINE void nrf_nvmc_uicr_erase_start (NRF_NVMC_Type *p_reg)
 Function for starting the user information configuration registers (UICR) erase. More...
 
NRF_STATIC_INLINE void nrf_nvmc_erase_all_start (NRF_NVMC_Type *p_reg)
 Function for starting the erase of the whole NVM, including UICR. More...
 
NRF_STATIC_INLINE void nrf_nvmc_partial_erase_duration_set (NRF_NVMC_Type *p_reg, uint32_t duration_ms)
 Function for configuring the page partial erase duration in milliseconds. More...
 
NRF_STATIC_INLINE uint32_t nrf_nvmc_partial_erase_duration_get (NRF_NVMC_Type const *p_reg)
 Function for getting the current setting for the page partial erase duration. More...
 
NRF_STATIC_INLINE void nrf_nvmc_page_partial_erase_start (NRF_NVMC_Type *p_reg, uint32_t page_addr)
 Function for starting a partial erase operation. More...
 

Detailed Description

Hardware access layer (HAL) for managing the Non-Volatile Memory Controller (NVMC) peripheral.

Enumeration Type Documentation

◆ nrf_nvmc_mode_t

NVMC modes.

Enumerator
NRF_NVMC_MODE_READONLY 

NVMC in read-only mode.

NRF_NVMC_MODE_WRITE 

NVMC in read and write mode.

NRF_NVMC_MODE_ERASE 

NVMC in read and erase mode.

◆ nrf_nvmc_ns_mode_t

Non-secure NVMC modes.

Enumerator
NRF_NVMC_NS_MODE_READONLY 

Non-secure NVMC in read-only mode.

NRF_NVMC_NS_MODE_WRITE 

Non-secure NVMC in read and write mode.

NRF_NVMC_NS_MODE_ERASE 

Non-secure NVMC in read and erase mode.

Function Documentation

◆ nrf_nvmc_erase_all_start()

NRF_STATIC_INLINE void nrf_nvmc_erase_all_start ( NRF_NVMC_Type *  p_reg)

Function for starting the erase of the whole NVM, including UICR.

This function purges all user code.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrf_nvmc_mode_set()

NRF_STATIC_INLINE void nrf_nvmc_mode_set ( NRF_NVMC_Type *  p_reg,
nrf_nvmc_mode_t  mode 
)

Function for setting the NVMC mode.

Only activate erase and write modes when they are actively used. If Instruction Cache (ICache) is present, enabling write or erase will invalidate the cache and keep it invalidated.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]modeDesired operating mode for NVMC.

◆ nrf_nvmc_nonsecure_mode_set()

NRF_STATIC_INLINE void nrf_nvmc_nonsecure_mode_set ( NRF_NVMC_Type *  p_reg,
nrf_nvmc_ns_mode_t  mode 
)

Function for setting the NVMC mode for non-secure Flash page operations.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]modeDesired operating mode for NVMC.

◆ nrf_nvmc_page_erase_start()

NRF_STATIC_INLINE void nrf_nvmc_page_erase_start ( NRF_NVMC_Type *  p_reg,
uint32_t  page_addr 
)

Function for starting a single page erase in the Flash memory.

The NVMC mode must be correctly configured with nrf_nvmc_mode_set before starting the erase operation.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]page_addrAddress of the first word of the page to erase.

◆ nrf_nvmc_page_partial_erase_start()

NRF_STATIC_INLINE void nrf_nvmc_page_partial_erase_start ( NRF_NVMC_Type *  p_reg,
uint32_t  page_addr 
)

Function for starting a partial erase operation.

It must be called successively until the page erase time is reached.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]page_addrAddress of the first word of the page to erase.

◆ nrf_nvmc_partial_erase_duration_get()

NRF_STATIC_INLINE uint32_t nrf_nvmc_partial_erase_duration_get ( NRF_NVMC_Type const *  p_reg)

Function for getting the current setting for the page partial erase duration.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
Intervalduration setting in milliseconds.

◆ nrf_nvmc_partial_erase_duration_set()

NRF_STATIC_INLINE void nrf_nvmc_partial_erase_duration_set ( NRF_NVMC_Type *  p_reg,
uint32_t  duration_ms 
)

Function for configuring the page partial erase duration in milliseconds.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]duration_msPage partial erase duration in milliseconds.

◆ nrf_nvmc_ready_check()

NRF_STATIC_INLINE bool nrf_nvmc_ready_check ( NRF_NVMC_Type const *  p_reg)

Function for checking if NVMC is ready to perform write or erase operation.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
trueNVMC can perform write or erase.
falseNVMC is busy and cannot perform next operation yet.

◆ nrf_nvmc_uicr_erase_start()

NRF_STATIC_INLINE void nrf_nvmc_uicr_erase_start ( NRF_NVMC_Type *  p_reg)

Function for starting the user information configuration registers (UICR) erase.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrf_nvmc_write_ready_check()

NRF_STATIC_INLINE bool nrf_nvmc_write_ready_check ( NRF_NVMC_Type const *  p_reg)

Function for checking if NVMC is ready to accept the next write operation.

NVM writing time can be reduced by using this function.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
trueNVMC can accept the next write. It will be buffered and will be taken into account as soon as the ongoing write operation is completed.
falseNVMC is busy and cannot accept the next write yet.

Documentation feedback | Developer Zone | Subscribe | Updated