nrfx 4.5.0
Loading...
Searching...
No Matches
MEMCONF HAL

Hardware access layer for managing the Memory Configuration (MEMCONF) peripheral. More...

Macros

#define NRF_MEMCONF_HAS_RET2   1
 Symbol indicating whether the second retention configuration register is present.
 
#define NRF_MEMCONF_HAS_REPAIR   1
 Symbol indicating whether the repair configuration for RAM blocks is present.
 
#define NRF_MEMCONF_HAS_TRIM   1
 Symbol indicating whether the trim configuration is present.
 
#define NRF_MEMCONF_POWERBLOCK_COUNT   MEMCONF_POWER_MaxCount
 Symbol specifying maximum number of available power blocks.
 
#define NRF_MEMCONF_POWERBLOCK_RAMBLOCK_CONTROL_COUNT   MEMCONF_POWER_CONTROL_MEM31_Pos
 Symbol specifying maximum number of control RAM blocks.
 
#define NRF_MEMCONF_POWERBLOCK_RAMBLOCK_RET_COUNT   MEMCONF_POWER_RET_MEM31_Pos
 Symbol specifying maximum number of retention RAM blocks.
 
#define NRF_MEMCONF_POWERBLOCK_RAMBLOCK_RET2_COUNT   MEMCONF_POWER_RET2_MEM31_Pos
 Symbol specifying maximum number of the second bank retention RAM blocks.
 
#define NRF_MEMCONF_MEMTRIM_MASK_BIT(idx, _)
 Macro to generate a mask bit for the memory read/write margin MEMCONF trim.
 
#define NRF_MEMCONF_MEMRETTRIM_MASK_BIT(idx, _)
 Macro to generate a mask bit for the memory retention read/write margin MEMCONF trim.
 
#define NRF_MEMCONF_MEMTRIM_SIZE_MAX   MEMCONF_NMEMTRIM_INTERNAL_SIZE
 Symbol determining the maximum memory read/write margin trim size across all MEMCONF variants.
 
#define NRF_MEMCONF_MEMRETTRIM_SIZE_MAX   MEMCONF_NMEMRETTRIM_INTERNAL_SIZE
 Symbol determining the maximum memory retention read/write margin trim size across all MEMCONF variants.
 
#define NRF_MEMCONF_BLOCKTYPE_TRIM_MEMTRIM_MASK    (NRFX_LISTIFY(NRF_MEMCONF_MEMTRIM_SIZE_MAX, NRF_MEMCONF_MEMTRIM_MASK_BIT, (|), _))
 Symbol specifying bitmask collecting all memory read and write margin trims.
 
#define NRF_MEMCONF_BLOCKTYPE_TRIM_MEMRETTRIM_MASK    (NRFX_LISTIFY(NRF_MEMCONF_MEMRETTRIM_SIZE_MAX, NRF_MEMCONF_MEMRETTRIM_MASK_BIT, (|), _))
 Symbol specifying bitmask collecting all memory retention trims.
 
#define NRF_MEMCONF_RAMBLOCK_INDEX(_ret, _mem)
 Macro for getting index of specified RAM block.
 
#define NRF_MEMCONF_RAMBLOCK_MASK(_ret, _mem)
 Macro for getting mask of specified RAM block.
 
#define NRF_MEMCONF_RAMBLOCK_RETENTION_ON_MASK(_ret, _mem)
 Macro for getting mask of retention enabled for specified RAM block.
 

Functions

NRF_STATIC_INLINE void nrf_memconf_ramblock_control_enable_set (NRF_MEMCONF_Type *p_reg, uint8_t power_id, uint8_t ramblock, bool enable)
 Function for enabling or disabling given RAM block.
 
NRF_STATIC_INLINE void nrf_memconf_ramblock_control_mask_enable_set (NRF_MEMCONF_Type *p_reg, uint8_t power_id, uint32_t ramblock_mask, bool enable)
 Function for enabling or disabling specified RAM blocks.
 
NRF_STATIC_INLINE void nrf_memconf_ramblock_control_mask_set (NRF_MEMCONF_Type *p_reg, uint8_t power_id, uint32_t ramblock_mask)
 Function for setting mask of RAM blocks powered-on in System ON mode.
 
NRF_STATIC_INLINE bool nrf_memconf_ramblock_control_enable_check (NRF_MEMCONF_Type const *p_reg, uint8_t power_id, uint8_t ramblock)
 Function for checking whether given RAM block is enabled.
 
NRF_STATIC_INLINE void nrf_memconf_ramblock_ret_enable_set (NRF_MEMCONF_Type *p_reg, uint8_t power_id, uint8_t ramblock, bool enable)
 Function for enabling or disabling the retention for given RAM block.
 
NRF_STATIC_INLINE void nrf_memconf_ramblock_ret_mask_enable_set (NRF_MEMCONF_Type *p_reg, uint8_t power_id, uint32_t ramblock_mask, bool enable)
 Function for enabling or disabling retention for the specified RAM blocks.
 
NRF_STATIC_INLINE void nrf_memconf_ramblock_ret_mask_set (NRF_MEMCONF_Type *p_reg, uint8_t power_id, uint32_t ramblock_mask)
 Function for setting mask of RAM blocks retained in System OFF mode.
 
NRF_STATIC_INLINE bool nrf_memconf_ramblock_ret_enable_check (NRF_MEMCONF_Type const *p_reg, uint8_t power_id, uint8_t ramblock)
 Function for checking whether the retention of specified RAM block is enabled.
 
NRF_STATIC_INLINE void nrf_memconf_ramblock_ret2_enable_set (NRF_MEMCONF_Type *p_reg, uint8_t power_id, uint8_t ramblock, bool enable)
 Function for enabling or disabling the retention within the second bank for given RAM block.
 
NRF_STATIC_INLINE bool nrf_memconf_ramblock_ret2_enable_check (NRF_MEMCONF_Type const *p_reg, uint8_t power_id, uint8_t ramblock)
 Function for checking whether the retention of the second bank in specified RAM block is enabled.
 
NRF_STATIC_INLINE void nrf_memconf_ramblock_ret2_mask_enable_set (NRF_MEMCONF_Type *p_reg, uint8_t power_id, uint32_t ramblock_mask, bool enable)
 Function for enabling or disabling retention of the second bank for the specified RAM blocks.
 
NRF_STATIC_INLINE void nrf_memconf_ramblock_ret2_mask_set (NRF_MEMCONF_Type *p_reg, uint8_t power_id, uint32_t ramblock_mask)
 Function for setting mask of RAM blocks whose secondary banks are to be retained in System OFF mode.
 
NRF_STATIC_INLINE void nrf_memconf_bitline_enable_set (NRF_MEMCONF_Type *p_reg, uint8_t bitline, bool enable)
 Function for enabling or disabling given bitline.
 
NRF_STATIC_INLINE bool nrf_memconf_bitline_enable_check (NRF_MEMCONF_Type const *p_reg, uint8_t bitline)
 Function for getting enable status for given bitline.
 
NRF_STATIC_INLINE void nrf_memconf_bitline_address_set (NRF_MEMCONF_Type *p_reg, uint8_t bitline, uint8_t address)
 Function for setting bitline address.
 
NRF_STATIC_INLINE uint32_t nrf_memconf_bitline_address_get (NRF_MEMCONF_Type const *p_reg, uint8_t bitline)
 Function for getting bitline address.
 
NRF_STATIC_INLINE void nrf_memconf_memtrim_set (NRF_MEMCONF_Type *p_reg, uint8_t trim_id, uint16_t trim_val)
 Function for setting memory trim value.
 
NRF_STATIC_INLINE uint16_t nrf_memconf_memtrim_get (NRF_MEMCONF_Type const *p_reg, uint8_t trim_id)
 Function for getting memory trim value.
 
NRF_STATIC_INLINE void nrf_memconf_rettrim_set (NRF_MEMCONF_Type *p_reg, uint8_t trim_id, uint16_t trim_val)
 Function for setting retention trim value.
 
NRF_STATIC_INLINE uint16_t nrf_memconf_rettrim_get (NRF_MEMCONF_Type const *p_reg, uint8_t trim_id)
 Function for getting retention trim value.
 

Detailed Description

Hardware access layer for managing the Memory Configuration (MEMCONF) peripheral.

Macro Definition Documentation

◆ NRF_MEMCONF_MEMRETTRIM_MASK_BIT

#define NRF_MEMCONF_MEMRETTRIM_MASK_BIT ( idx,
_ )
Value:
(NRFX_CONCAT(MEMCONF_BLOCKTYPE_TRIM_MEMRETTRIM, idx, _Msk))
#define NRFX_CONCAT(...)
Macro for concatenating multiple arguments.
Definition nrfx_utils.h:777

Macro to generate a mask bit for the memory retention read/write margin MEMCONF trim.

Parameters
[in]idxZero based memory margin retention trim index.
[in]_Internal placeholder, to be ignored.

◆ NRF_MEMCONF_MEMTRIM_MASK_BIT

#define NRF_MEMCONF_MEMTRIM_MASK_BIT ( idx,
_ )
Value:
(NRFX_CONCAT(MEMCONF_BLOCKTYPE_TRIM_MEMTRIM, idx, _Msk))

Macro to generate a mask bit for the memory read/write margin MEMCONF trim.

Parameters
[in]idxZero-based memory margin trim index.
[in]_Internal placeholder, to be ignored.

◆ NRF_MEMCONF_RAMBLOCK_INDEX

#define NRF_MEMCONF_RAMBLOCK_INDEX ( _ret,
_mem )
Value:
NRFX_CONCAT(MEMCONF_POWER_RET, _ret, _MEM, _mem, _Pos)

Macro for getting index of specified RAM block.

Parameters
[in]_retRAM bank index. Can be empty if specified bank has no index.
[in]_memRAM block number.
Returns
RAM block index.

◆ NRF_MEMCONF_RAMBLOCK_MASK

#define NRF_MEMCONF_RAMBLOCK_MASK ( _ret,
_mem )
Value:
NRFX_CONCAT(MEMCONF_POWER_RET, _ret, _MEM, _mem, _Msk)

Macro for getting mask of specified RAM block.

Parameters
[in]_retRAM bank index. Can be empty if specified bank has no index.
[in]_memRAM block number.
Returns
RAM block mask.

◆ NRF_MEMCONF_RAMBLOCK_RETENTION_ON_MASK

#define NRF_MEMCONF_RAMBLOCK_RETENTION_ON_MASK ( _ret,
_mem )
Value:
(NRFX_CONCAT(MEMCONF_POWER_RET, _ret, _MEM, _mem, _On) << \
NRFX_CONCAT(MEMCONF_POWER_RET, _ret, _MEM, _mem, _Pos))

Macro for getting mask of retention enabled for specified RAM block.

Parameters
[in]_retRAM bank index. Can be empty if specified bank has no index.
[in]_memRAM block number.
Returns
Retention of specified RAM block mask.

Function Documentation

◆ nrf_memconf_bitline_address_get()

NRF_STATIC_INLINE uint32_t nrf_memconf_bitline_address_get ( NRF_MEMCONF_Type const * p_reg,
uint8_t bitline )

Function for getting bitline address.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]bitlineBitline index.
Returns
Address of requested bitline.

◆ nrf_memconf_bitline_address_set()

NRF_STATIC_INLINE void nrf_memconf_bitline_address_set ( NRF_MEMCONF_Type * p_reg,
uint8_t bitline,
uint8_t address )

Function for setting bitline address.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]bitlineBitline index.
[in]addressAddres for given bitline.

◆ nrf_memconf_bitline_enable_check()

NRF_STATIC_INLINE bool nrf_memconf_bitline_enable_check ( NRF_MEMCONF_Type const * p_reg,
uint8_t bitline )

Function for getting enable status for given bitline.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]bitlineBitline index.
Returns
Status of requested bitline.

◆ nrf_memconf_bitline_enable_set()

NRF_STATIC_INLINE void nrf_memconf_bitline_enable_set ( NRF_MEMCONF_Type * p_reg,
uint8_t bitline,
bool enable )

Function for enabling or disabling given bitline.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]bitlineBitline to be enabled/disabled.
[in]enableTrue if bitline is to be enabled, false otherwise.

◆ nrf_memconf_memtrim_get()

NRF_STATIC_INLINE uint16_t nrf_memconf_memtrim_get ( NRF_MEMCONF_Type const * p_reg,
uint8_t trim_id )

Function for getting memory trim value.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]trim_idTrim index.
Returns
Requested trim value.

◆ nrf_memconf_memtrim_set()

NRF_STATIC_INLINE void nrf_memconf_memtrim_set ( NRF_MEMCONF_Type * p_reg,
uint8_t trim_id,
uint16_t trim_val )

Function for setting memory trim value.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]trim_idTrim index.
[in]trim_valTrim value.

◆ nrf_memconf_ramblock_control_enable_check()

NRF_STATIC_INLINE bool nrf_memconf_ramblock_control_enable_check ( NRF_MEMCONF_Type const * p_reg,
uint8_t power_id,
uint8_t ramblock )

Function for checking whether given RAM block is enabled.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]power_idPower block index.
[in]ramblockRAM block index. Use NRF_MEMCONF_RAMBLOCK_INDEX for indexing RAM blocks.
Return values
trueRAM block is enabled.
falseRAM block is disabled.

◆ nrf_memconf_ramblock_control_enable_set()

NRF_STATIC_INLINE void nrf_memconf_ramblock_control_enable_set ( NRF_MEMCONF_Type * p_reg,
uint8_t power_id,
uint8_t ramblock,
bool enable )

Function for enabling or disabling given RAM block.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]power_idPower block index.
[in]ramblockRAM block index. Use NRF_MEMCONF_RAMBLOCK_INDEX for indexing RAM blocks.
[in]enableTrue if RAM block is to be enabled, false otherwise.

◆ nrf_memconf_ramblock_control_mask_enable_set()

NRF_STATIC_INLINE void nrf_memconf_ramblock_control_mask_enable_set ( NRF_MEMCONF_Type * p_reg,
uint8_t power_id,
uint32_t ramblock_mask,
bool enable )

Function for enabling or disabling specified RAM blocks.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]power_idPower block index.
[in]ramblock_maskMask of RAM blocks. Use NRF_MEMCONF_RAMBLOCK_MASK for creating RAM block masks.
[in]enableTrue if RAM blocks are to be enabled, false otherwise.

◆ nrf_memconf_ramblock_control_mask_set()

NRF_STATIC_INLINE void nrf_memconf_ramblock_control_mask_set ( NRF_MEMCONF_Type * p_reg,
uint8_t power_id,
uint32_t ramblock_mask )

Function for setting mask of RAM blocks powered-on in System ON mode.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]power_idPower block index. Use NRF_MEMCONF_RAMBLOCK_INDEX for indexing RAM blocks.
[in]ramblock_maskMask of RAM blocks.

◆ nrf_memconf_ramblock_ret2_enable_check()

NRF_STATIC_INLINE bool nrf_memconf_ramblock_ret2_enable_check ( NRF_MEMCONF_Type const * p_reg,
uint8_t power_id,
uint8_t ramblock )

Function for checking whether the retention of the second bank in specified RAM block is enabled.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]power_idPower block index.
[in]ramblockRAM block index. Use NRF_MEMCONF_RAMBLOCK_INDEX for indexing RAM blocks.
Return values
trueRAM block is enabled.
falseRAM block is disabled.

◆ nrf_memconf_ramblock_ret2_enable_set()

NRF_STATIC_INLINE void nrf_memconf_ramblock_ret2_enable_set ( NRF_MEMCONF_Type * p_reg,
uint8_t power_id,
uint8_t ramblock,
bool enable )

Function for enabling or disabling the retention within the second bank for given RAM block.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]power_idPower block index.
[in]ramblockRAM block index. Use NRF_MEMCONF_RAMBLOCK_INDEX for indexing RAM blocks.
[in]enableTrue if RAM block retention is to be enabled, false otherwise.

◆ nrf_memconf_ramblock_ret2_mask_enable_set()

NRF_STATIC_INLINE void nrf_memconf_ramblock_ret2_mask_enable_set ( NRF_MEMCONF_Type * p_reg,
uint8_t power_id,
uint32_t ramblock_mask,
bool enable )

Function for enabling or disabling retention of the second bank for the specified RAM blocks.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]power_idPower block index.
[in]ramblock_maskMask of RAM blocks. Use NRF_MEMCONF_RAMBLOCK_MASK for creating RAM block masks.
[in]enableTrue if retention for RAM blocks is to be enabled, false otherwise.

◆ nrf_memconf_ramblock_ret2_mask_set()

NRF_STATIC_INLINE void nrf_memconf_ramblock_ret2_mask_set ( NRF_MEMCONF_Type * p_reg,
uint8_t power_id,
uint32_t ramblock_mask )

Function for setting mask of RAM blocks whose secondary banks are to be retained in System OFF mode.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]power_idPower block index.
[in]ramblock_maskMask of RAM blocks. Use NRF_MEMCONF_RAMBLOCK_MASK for creating RAM block masks.

◆ nrf_memconf_ramblock_ret_enable_check()

NRF_STATIC_INLINE bool nrf_memconf_ramblock_ret_enable_check ( NRF_MEMCONF_Type const * p_reg,
uint8_t power_id,
uint8_t ramblock )

Function for checking whether the retention of specified RAM block is enabled.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]power_idPower block index.
[in]ramblockRAM block index. Use NRF_MEMCONF_RAMBLOCK_INDEX for indexing RAM blocks.
Return values
trueRAM block is enabled.
falseRAM block is disabled.

◆ nrf_memconf_ramblock_ret_enable_set()

NRF_STATIC_INLINE void nrf_memconf_ramblock_ret_enable_set ( NRF_MEMCONF_Type * p_reg,
uint8_t power_id,
uint8_t ramblock,
bool enable )

Function for enabling or disabling the retention for given RAM block.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]power_idPower block index.
[in]ramblockRAM block index. Use NRF_MEMCONF_RAMBLOCK_INDEX for indexing RAM blocks.
[in]enableTrue if RAM block retention is to be enabled, false otherwise.

◆ nrf_memconf_ramblock_ret_mask_enable_set()

NRF_STATIC_INLINE void nrf_memconf_ramblock_ret_mask_enable_set ( NRF_MEMCONF_Type * p_reg,
uint8_t power_id,
uint32_t ramblock_mask,
bool enable )

Function for enabling or disabling retention for the specified RAM blocks.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]power_idPower block index.
[in]ramblock_maskMask of RAM blocks. Use NRF_MEMCONF_RAMBLOCK_MASK for creating RAM block masks.
[in]enableTrue if retention for RAM blocks is to be enabled, false otherwise.

◆ nrf_memconf_ramblock_ret_mask_set()

NRF_STATIC_INLINE void nrf_memconf_ramblock_ret_mask_set ( NRF_MEMCONF_Type * p_reg,
uint8_t power_id,
uint32_t ramblock_mask )

Function for setting mask of RAM blocks retained in System OFF mode.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]power_idPower block index.
[in]ramblock_maskMask of RAM blocks. Use NRF_MEMCONF_RAMBLOCK_MASK for creating RAM block masks.

◆ nrf_memconf_rettrim_get()

NRF_STATIC_INLINE uint16_t nrf_memconf_rettrim_get ( NRF_MEMCONF_Type const * p_reg,
uint8_t trim_id )

Function for getting retention trim value.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]trim_idTrim index.
Returns
Requested trim value.

◆ nrf_memconf_rettrim_set()

NRF_STATIC_INLINE void nrf_memconf_rettrim_set ( NRF_MEMCONF_Type * p_reg,
uint8_t trim_id,
uint16_t trim_val )

Function for setting retention trim value.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]trim_idTrim index.
[in]trim_valTrim value.