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

The hardware access layer for managing the CACHE peripheral. More...

Macros

#define NRF_CACHE_HAS_CACHEDATA   1
 Symbol indicating whether CACHEDATA structure is present.
 
#define NRF_CACHE_HAS_DCACHEDATA   1
 Symbol indicating whether DCACHEDATA structure is present.
 
#define NRF_CACHE_HAS_ICACHEDATA   1
 Symbol indicating whether ICACHEDATA structure is present.
 
#define NRF_CACHE_HAS_ANY_CACHEDATA   1
 Symbol indicating whether any CACHEDATA structure is present.
 
#define NRF_CACHE_HAS_CACHEDATA_DU   1
 Symbol indicating whether CACHEDATA data units field is present.
 
#define NRF_CACHE_HAS_CACHEINFO   1
 Symbol indicating whether CACHEINFO structure is present.
 
#define NRF_CACHE_HAS_DCACHEINFO   1
 Symbol indicating whether DCACHEINFO structure is present.
 
#define NRF_CACHE_HAS_ICACHEINFO   1
 Symbol indicating whether ICACHEINFO structure is present.
 
#define NRF_CACHE_HAS_ANY_CACHEINFO   1
 Symbol indicating whether any CACHEINFO structure is present.
 
#define NRF_CACHE_HAS_CACHEINFO_DU_DIRTY   1
 Symbol indicating whether dirtiness check functionality for cache is supported.
 
#define NRF_CACHE_HAS_CACHEINFO_DU_VALIDATION   1
 Symbol indicating whether data unit validation functionality for cache is supported.
 
#define NRF_CACHE_HAS_CACHEINFO_SET_WAY_INFO   1
 Symbol indicating whether cache info has INFO register.
 
#define NRF_CACHE_HAS_TASKS   1
 Symbol indicating whether cache tasks are supported.
 
#define NRF_CACHE_HAS_TASK_CLEAN   1
 Symbol indicating whether the CLEAN cache/line tasks are supported.
 
#define NRF_CACHE_HAS_TASK_ERASE   1
 Symbol indicating whether the cache ERASE task is supported.
 
#define NRF_CACHE_HAS_ERASE   1
 Symbol indicating whether the cache ERASE is supported.
 
#define NRF_CACHE_HAS_TASK_INVALIDATELINE   1
 Symbol indicating whether the cache INVALIDATELINE task is supported.
 
#define NRF_CACHE_HAS_LINEADDR   1
 Symbol indicating whether the cache LINEADDR task is supported.
 
#define NRF_CACHE_HAS_WRITELOCK   1
 Symbol indicating whether the cache WRITELOCK task is supported.
 
#define NRF_CACHE_HAS_TASK_FLUSH   1
 Symbol indicating whether the FLUSH cache/line tasks are supported.
 
#define NRF_CACHE_HAS_TASK_SAVE_RESTORE   1
 Symbol indicating whether save and restore tasks are supported.
 
#define NRF_CACHE_HAS_STATUS   1
 Symbol indicating whether status check is supported.
 
#define NRF_CACHE_HAS_RAM_MODE   1
 Symbol indicating whether splitting the dedicated RAM between cache and generic memory is supported.
 
#define NRF_CACHE_HAS_RAMSIZE   1
 Symbol indicating whether configuration of split of dedicated RAM between cache and generic memory is supported.
 
#define NRF_CACHE_HAS_DEBUGLOCK   1
 Symbol indicating whether cache DEBUGLOCK is supported.
 
#define NRF_CACHEDATA_DATA_WORDS_IN_UNIT_MAX   CACHEDATA_SET_WAY_DU_DATA_MaxCount
 Max number of words in CACHEDATA data units.
 
#define NRF_CACHEDATA_DATA_UNITS_MAX   CACHEDATA_SET_WAY_DU_MaxCount
 Max number of CACHEDATA data units.
 
#define NRF_CACHEDATA_WORD_INDEX_MAX    (NRF_CACHEDATA_DATA_WORDS_IN_UNIT_MAX * NRF_CACHEDATA_DATA_UNITS_MAX)
 Max number of CACHEDATA words.
 
#define NRF_CACHEDATA_WAY_INDEX_MAX   CACHEDATA_SET_WAY_MaxCount
 Max number of CACHEDATA ways.
 
#define NRF_CACHEDATA_SET_INDEX_MAX   CACHEDATA_SET_MaxCount
 Max number of CACHEDATA sets.
 
#define NRF_DCACHEDATA_DATA_WORDS_IN_UNIT_MAX   DCACHEDATA_SET_WAY_DU_DATA_MaxCount
 Max number of words in DCACHEDATA data units.
 
#define NRF_DCACHEDATA_DATA_UNITS_MAX   DCACHEDATA_SET_WAY_DU_MaxCount
 Max number of DCACHEDATA data units.
 
#define NRF_DCACHEDATA_WORD_INDEX_MAX    (NRF_DCACHEDATA_DATA_WORDS_IN_UNIT_MAX * NRF_DCACHEDATA_DATA_UNITS_MAX)
 Max number of DCACHEDATA words.
 
#define NRF_DCACHEDATA_WAY_INDEX_MAX   DCACHEDATA_SET_WAY_MaxCount
 Max number of DCACHEDATA ways.
 
#define NRF_DCACHEDATA_SET_INDEX_MAX   DCACHEDATA_SET_MaxCount
 Max number of DCACHEDATA sets.
 
#define NRF_ICACHEDATA_DATA_WORDS_IN_UNIT_MAX   CACHEDATA_SET_WAY_DU_DATA_MaxCount
 Max number of words in ICACHEDATA data units.
 
#define NRF_ICACHEDATA_DATA_UNITS_MAX   CACHEDATA_SET_WAY_DU_MaxCount
 Max number of ICACHEDATA data units.
 
#define NRF_ICACHEDATA_WORD_INDEX_MAX    (NRF_ICACHEDATA_DATA_WORDS_IN_UNIT_MAX * NRF_ICACHEDATA_DATA_UNITS_MAX)
 Max number of ICACHEDATA words.
 
#define NRF_ICACHEDATA_WAY_INDEX_MAX   CACHEDATA_SET_WAY_MaxCount
 Max number of ICACHEDATA ways.
 
#define NRF_ICACHEDATA_SET_INDEX_MAX   CACHEDATA_SET_MaxCount
 Max number of ICACHEDATA sets.
 
#define NRF_CACHEINFO_DATA_WORDS_IN_UNIT_MAX   CACHEDATA_SET_WAY_DU_DATA_MaxCount
 Max number of words in CACHEINFO data units.
 
#define NRF_CACHEINFO_DATA_UNITS_MAX   CACHEDATA_SET_WAY_DU_MaxCount
 Max number of CACHEINFO data units.
 
#define NRF_CACHEINFO_WORD_INDEX_MAX    (NRF_CACHEINFO_DATA_WORDS_IN_UNIT_MAX * NRF_CACHEINFO_DATA_UNITS_MAX)
 Max number of CACHEINFO words.
 
#define NRF_CACHEINFO_WAY_INDEX_MAX   CACHEINFO_SET_WAY_MaxCount
 Max number of CACHEINFO ways.
 
#define NRF_CACHEINFO_SET_INDEX_MAX   CACHEINFO_SET_MaxCount
 Max number of CACHEINFO sets.
 
#define NRF_DCACHEINFO_DATA_WORDS_IN_UNIT_MAX   DCACHEDATA_SET_WAY_DU_DATA_MaxCount
 Max number of words in DCACHEINFO data units.
 
#define NRF_DCACHEINFO_DATA_UNITS_MAX   DCACHEDATA_SET_WAY_DU_MaxCount
 Max number of DCACHEINFO data units.
 
#define NRF_DCACHEINFO_WORD_INDEX_MAX    (NRF_DCACHEINFO_DATA_WORDS_IN_UNIT_MAX * NRF_DCACHEINFO_DATA_UNITS_MAX)
 Max number of DCACHEINFO words.
 
#define NRF_DCACHEINFO_WAY_INDEX_MAX   DCACHEINFO_SET_WAY_MaxCount
 Max number of DCACHEINFO ways.
 
#define NRF_DCACHEINFO_SET_INDEX_MAX   DCACHEINFO_SET_MaxCount
 Max number of CACHEINFO sets.
 
#define NRF_ICACHEINFO_DATA_WORDS_IN_UNIT_MAX   CACHEDATA_SET_WAY_DU_DATA_MaxCount
 Max number of words in ICACHEINFO data units.
 
#define NRF_ICACHEINFO_DATA_UNITS_MAX   CACHEDATA_SET_WAY_DU_MaxCount
 Max number of ICACHEINFO data units.
 
#define NRF_ICACHEINFO_WORD_INDEX_MAX    (NRF_ICACHEINFO_DATA_WORDS_IN_UNIT_MAX * NRF_ICACHEINFO_DATA_UNITS_MAX)
 Max number of ICACHEINFO words.
 
#define NRF_ICACHEINFO_WAY_INDEX_MAX   CACHEINFO_SET_WAY_MaxCount
 Max number of ICACHEINFO ways.
 
#define NRF_ICACHEINFO_SET_INDEX_MAX   CACHEINFO_SET_MaxCount
 Max number of ICACHEINFO sets.
 
#define NRF_ICACHEINFO_TAG_MASK   CACHEINFO_SET_WAY_INFO_TAG_Msk
 Mask of ICACHEINFO TAG field.
 
#define NRF_ICACHEINFO_V_MASK   CACHEINFO_SET_WAY_INFO_V_Msk
 Mask of ICACHEINFO V field.
 
#define NRF_ICACHEINFO_V_POS   CACHEINFO_SET_WAY_INFO_V_Pos
 Position of ICACHEINFO V field.
 
#define NRF_ICACHEINFO_V_VALID   CACHEINFO_SET_WAY_INFO_V_Valid
 Valid value of ICACHEINFO V field.
 
#define NRF_ICACHEINFO_MRU_MASK   CACHEINFO_SET_WAY_INFO_MRU_Msk
 Mask of ICACHEINFO MRU field.
 
#define NRF_ICACHEINFO_MRU_POS   CACHEINFO_SET_WAY_INFO_MRU_Pos
 Position of ICACHEINFO MRU field.
 
#define NRF_ICACHEINFO_DUV0_MASK   CACHEINFO_SET_WAY_INFO_DUV0_Msk
 Mask of ICACHEINFO DUV0 field.
 
#define NRF_ICACHEINFO_DUV0_POS   CACHEINFO_SET_WAY_INFO_DUV0_Pos
 Position of ICACHEINFO DUV0 field.
 
#define NRF_ICACHEINFO_DUV0_VALID   CACHEINFO_SET_WAY_INFO_DUV0_Valid
 Valid value of ICACHEINFO DUV0 field.
 
#define NRF_ICACHEINFO_DUV1_MASK   CACHEINFO_SET_WAY_INFO_DUV1_Msk
 Mask of ICACHEINFO DUV1 field.
 
#define NRF_ICACHEINFO_DUV1_POS   CACHEINFO_SET_WAY_INFO_DUV1_Pos
 Position of ICACHEINFO DUV1 field.
 
#define NRF_ICACHEINFO_DUV1_VALID   CACHEINFO_SET_WAY_INFO_DUV1_Valid
 Valid value of ICACHEINFO DUV1 field.
 
#define NRF_ICACHEINFO_DUV2_MASK   CACHEINFO_SET_WAY_INFO_DUV2_Msk
 Mask of ICACHEINFO DUV2 field.
 
#define NRF_ICACHEINFO_DUV2_POS   CACHEINFO_SET_WAY_INFO_DUV2_Pos
 Position of ICACHEINFO DUV2 field.
 
#define NRF_ICACHEINFO_DUV2_VALID   CACHEINFO_SET_WAY_INFO_DUV2_Valid
 Valid value of ICACHEINFO DUV2 field.
 
#define NRF_ICACHEINFO_DUV3_MASK   CACHEINFO_SET_WAY_INFO_DUV3_Msk
 Mask of ICACHEINFO DUV3 field.
 
#define NRF_ICACHEINFO_DUV3_POS   CACHEINFO_SET_WAY_INFO_DUV3_Pos
 Position of ICACHEINFO DUV3 field.
 
#define NRF_ICACHEINFO_DUV3_VALID   CACHEINFO_SET_WAY_INFO_DUV3_Valid
 Valid value of ICACHEINFO DUV3 field.
 
#define NRF_CACHE_MODE_RAMSIZE_MAX   CACHE_MODE_RAMSIZE_Max
 Max enumerator value of RAMSIZE field.
 

Enumerations

enum  nrf_cache_task_t {
  NRF_CACHE_TASK_CLEANCACHE = offsetof(NRF_CACHE_Type, TASKS_CLEANCACHE) ,
  NRF_CACHE_TASK_CLEANLINE = offsetof(NRF_CACHE_Type, TASKS_CLEANLINE) ,
  NRF_CACHE_TASK_FLUSHCACHE = offsetof(NRF_CACHE_Type, TASKS_FLUSHCACHE) ,
  NRF_CACHE_TASK_FLUSHLINE = offsetof(NRF_CACHE_Type, TASKS_FLUSHLINE) ,
  NRF_CACHE_TASK_SAVE = offsetof(NRF_CACHE_Type, TASKS_SAVE) ,
  NRF_CACHE_TASK_RESTORE = offsetof(NRF_CACHE_Type, TASKS_RESTORE) ,
  NRF_CACHE_TASK_INVALIDATECACHE = offsetof(NRF_CACHE_Type, TASKS_INVALIDATECACHE) ,
  NRF_CACHE_TASK_INVALIDATELINE = offsetof(NRF_CACHE_Type, TASKS_INVALIDATELINE) ,
  NRF_CACHE_TASK_ERASE = offsetof(NRF_CACHE_Type, TASKS_ERASE)
}
 CACHE tasks. More...
 
enum  nrf_cache_region_t {
  NRF_CACHE_REGION_FLASH = 0 ,
  NRF_CACHE_REGION_XIP = 1
}
 Cache regions. More...
 
enum  nrf_cache_ramsize_t {
  NRF_CACHE_RAMSIZE_ALL = CACHE_MODE_RAMSIZE_All ,
  NRF_CACHE_RAMSIZE_HALF = CACHE_MODE_RAMSIZE_Half ,
  NRF_CACHE_RAMSIZE_QUARTER = CACHE_MODE_RAMSIZE_Quarter ,
  NRF_CACHE_RAMSIZE_NONE = CACHE_MODE_RAMSIZE_None
}
 Dedicated RAM size used for cache memory. More...
 

Functions

NRF_STATIC_INLINE void nrf_cache_enable (NRF_CACHE_Type *p_reg)
 Function for enabling the CACHE peripheral.
 
NRF_STATIC_INLINE void nrf_cache_disable (NRF_CACHE_Type *p_reg)
 Function for disabling the CACHE peripheral.
 
NRF_STATIC_INLINE bool nrf_cache_enable_check (NRF_CACHE_Type const *p_reg)
 Function for checking if the CACHE peripheral is enabled.
 
NRF_STATIC_INLINE void nrf_cache_invalidate (NRF_CACHE_Type *p_reg)
 Function for invalidating the cache content.
 
NRF_STATIC_INLINE void nrf_cache_erase (NRF_CACHE_Type *p_reg)
 Function for erasing the cache content.
 
NRF_STATIC_INLINE bool nrf_cache_erase_status_check (NRF_CACHE_Type const *p_reg)
 Function for checking the status of nrf_cache_erase().
 
NRF_STATIC_INLINE void nrf_cache_erase_status_clear (NRF_CACHE_Type *p_reg)
 Function for clearing the status of the cache erase.
 
NRF_STATIC_INLINE void nrf_cache_profiling_set (NRF_CACHE_Type *p_reg, bool enable)
 Function for setting the cache profiling.
 
NRF_STATIC_INLINE void nrf_cache_profiling_counters_clear (NRF_CACHE_Type *p_reg)
 Function for clearing the cache profiling counters.
 
NRF_STATIC_INLINE uint32_t nrf_cache_instruction_hit_counter_get (NRF_CACHE_Type const *p_reg, nrf_cache_region_t region)
 Function for getting the number of cache hits for instruction fetch from the specified cache region.
 
NRF_STATIC_INLINE uint32_t nrf_cache_instruction_miss_counter_get (NRF_CACHE_Type const *p_reg, nrf_cache_region_t region)
 Function for getting the number of cache misses for instruction fetch from the specified cache region.
 
NRF_STATIC_INLINE uint32_t nrf_cache_data_hit_counter_get (NRF_CACHE_Type const *p_reg, nrf_cache_region_t region)
 Function for getting the number of cache hits for data fetch from the specified cache region.
 
NRF_STATIC_INLINE uint32_t nrf_cache_data_miss_counter_get (NRF_CACHE_Type const *p_reg, nrf_cache_region_t region)
 Function for getting the number of cache misses for data fetch from the specified cache region.
 
NRF_STATIC_INLINE void nrf_cache_ram_mode_set (NRF_CACHE_Type *p_reg, bool enable)
 Function for setting the cache RAM mode.
 
NRF_STATIC_INLINE bool nrf_cache_ram_mode_check (NRF_CACHE_Type const *p_reg)
 Function for checking whether the cache is in RAM mode.
 
NRF_STATIC_INLINE void nrf_cache_ramsize_set (NRF_CACHE_Type *p_reg, nrf_cache_ramsize_t ramsize)
 Function for setting the configuration of splitting the dedicated cache RAM.
 
NRF_STATIC_INLINE nrf_cache_ramsize_t nrf_cache_ramsize_get (NRF_CACHE_Type const *p_reg)
 Function for getting the configuration of splitting the dedicated cache RAM.
 
NRF_STATIC_INLINE void nrf_cache_read_lock_enable (NRF_CACHE_Type *p_reg)
 Function for blocking the cache content access.
 
NRF_STATIC_INLINE void nrf_cache_update_lock_set (NRF_CACHE_Type *p_reg, bool enable)
 Function for blocking the cache content updates.
 
NRF_STATIC_INLINE uint32_t nrf_cache_data_get (NRF_CACHE_Type const *p_reg, uint32_t set, uint8_t way, uint8_t word)
 Function for getting the cache data word.
 
NRF_STATIC_INLINE uint32_t nrf_cache_tag_get (NRF_CACHE_Type const *p_reg, uint32_t set, uint8_t way)
 Function for getting the tag associated with the specified set and way.
 
NRF_STATIC_INLINE bool nrf_cache_line_validity_check (NRF_CACHE_Type const *p_reg, uint32_t set, uint8_t way)
 Function for checking the validity of a cache line associated with the specified set and way.
 
NRF_STATIC_INLINE uint8_t nrf_cache_mru_get (NRF_CACHE_Type const *p_reg, uint32_t set)
 Function for getting the most recently used way in the specified set.
 
NRF_STATIC_INLINE bool nrf_cache_data_unit_validity_check (NRF_CACHE_Type const *p_reg, uint32_t set, uint8_t way, uint8_t word)
 Function for checking the validity of a data unit associated with the specified set, way and word.
 
NRF_STATIC_INLINE bool nrf_cache_is_data_unit_dirty_check (NRF_CACHE_Type const *p_reg, uint32_t set, uint8_t way, uint8_t word)
 Function for checking the dirtiness of a data unit associated with the specified set, way and word.
 
NRF_STATIC_INLINE void nrf_cache_lineaddr_set (NRF_CACHE_Type *p_reg, uint32_t addr)
 Function to set the memory address covered by the line to be maintained.
 
NRF_STATIC_INLINE uint32_t nrf_cache_lineaddr_get (NRF_CACHE_Type const *p_reg)
 Function to get the memory address covered by the line to be maintained.
 
NRF_STATIC_INLINE void nrf_cache_task_trigger (NRF_CACHE_Type *p_reg, nrf_cache_task_t task)
 Function for triggering the specified CACHE task.
 
NRF_STATIC_INLINE uint32_t nrf_cache_task_address_get (NRF_CACHE_Type const *p_reg, nrf_cache_task_t task)
 Function for returning the address of the specified task register.
 
NRF_STATIC_INLINE bool nrf_cache_busy_check (NRF_CACHE_Type const *p_reg)
 Function for checking if the cache is busy or not.
 

Detailed Description

The hardware access layer for managing the CACHE peripheral.

Enumeration Type Documentation

◆ nrf_cache_ramsize_t

Dedicated RAM size used for cache memory.

Enumerator
NRF_CACHE_RAMSIZE_ALL 

All RAM is used for cache memory.

NRF_CACHE_RAMSIZE_HALF 

Half of the RAM is used for cache memory.

NRF_CACHE_RAMSIZE_QUARTER 

Quarter of the RAM is used for cache memory.

NRF_CACHE_RAMSIZE_NONE 

None of the RAM is used for cache memory.

◆ nrf_cache_region_t

Cache regions.

Enumerator
NRF_CACHE_REGION_FLASH 

Cache region related to Flash access.

NRF_CACHE_REGION_XIP 

Cache region related to XIP access.

◆ nrf_cache_task_t

CACHE tasks.

Enumerator
NRF_CACHE_TASK_CLEANCACHE 

Clean the whole cache.

NRF_CACHE_TASK_CLEANLINE 

Clean the cache line.

NRF_CACHE_TASK_FLUSHCACHE 

Flush the whole cache.

NRF_CACHE_TASK_FLUSHLINE 

Flush the cache line.

NRF_CACHE_TASK_SAVE 

Save the state to a retained memory space.

NRF_CACHE_TASK_RESTORE 

Restore the state from a retained memory space.

NRF_CACHE_TASK_INVALIDATECACHE 

Invalidate the whole cache.

NRF_CACHE_TASK_INVALIDATELINE 

Invalidate the cache line.

NRF_CACHE_TASK_ERASE 

Erase the whole cache.

Function Documentation

◆ nrf_cache_busy_check()

NRF_STATIC_INLINE bool nrf_cache_busy_check ( NRF_CACHE_Type const * p_reg)

Function for checking if the cache is busy or not.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
True if the cache is busy, false otherwise.

◆ nrf_cache_data_get()

NRF_STATIC_INLINE uint32_t nrf_cache_data_get ( NRF_CACHE_Type const * p_reg,
uint32_t set,
uint8_t way,
uint8_t word )

Function for getting the cache data word.

Note
When operating in the RAM mode, the cache data is accessible as a general purpose RAM.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]setSet that contains the data to get.
[in]wayWay that contains the data to get.
[in]wordData word index to get.
Returns
32-bit data word.

◆ nrf_cache_data_hit_counter_get()

NRF_STATIC_INLINE uint32_t nrf_cache_data_hit_counter_get ( NRF_CACHE_Type const * p_reg,
nrf_cache_region_t region )

Function for getting the number of cache hits for data fetch from the specified cache region.

Note
Separate counters are used for flash region and XIP region.
Cache profiling must be enabled first. See nrf_cache_profiling_set.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]regionCache region.
Returns
Number of data fetch cache hits.

◆ nrf_cache_data_miss_counter_get()

NRF_STATIC_INLINE uint32_t nrf_cache_data_miss_counter_get ( NRF_CACHE_Type const * p_reg,
nrf_cache_region_t region )

Function for getting the number of cache misses for data fetch from the specified cache region.

Note
Separate counters are used for flash region and XIP region.
Cache profiling must be enabled first. See nrf_cache_profiling_set.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]regionCache region.
Returns
Number of data fetch cache misses.

◆ nrf_cache_data_unit_validity_check()

NRF_STATIC_INLINE bool nrf_cache_data_unit_validity_check ( NRF_CACHE_Type const * p_reg,
uint32_t set,
uint8_t way,
uint8_t word )

Function for checking the validity of a data unit associated with the specified set, way and word.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]setSet that contains the data unit to check.
[in]wayWay that contains the data unit to check.
[in]wordData word index.
Return values
trueData unit is valid.
falseData unit is invalid.

◆ nrf_cache_disable()

NRF_STATIC_INLINE void nrf_cache_disable ( NRF_CACHE_Type * p_reg)

Function for disabling the CACHE peripheral.

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

◆ nrf_cache_enable()

NRF_STATIC_INLINE void nrf_cache_enable ( NRF_CACHE_Type * p_reg)

Function for enabling the CACHE peripheral.

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

◆ nrf_cache_enable_check()

NRF_STATIC_INLINE bool nrf_cache_enable_check ( NRF_CACHE_Type const * p_reg)

Function for checking if the CACHE peripheral is enabled.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
trueThe CACHE is enabled.
falseThe CACHE is not enabled.

◆ nrf_cache_erase()

NRF_STATIC_INLINE void nrf_cache_erase ( NRF_CACHE_Type * p_reg)

Function for erasing the cache content.

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

◆ nrf_cache_erase_status_check()

NRF_STATIC_INLINE bool nrf_cache_erase_status_check ( NRF_CACHE_Type const * p_reg)

Function for checking the status of nrf_cache_erase().

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
trueErase is finished.
falseErase is not complete or has not started.

◆ nrf_cache_erase_status_clear()

NRF_STATIC_INLINE void nrf_cache_erase_status_clear ( NRF_CACHE_Type * p_reg)

Function for clearing the status of the cache erase.

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

◆ nrf_cache_instruction_hit_counter_get()

NRF_STATIC_INLINE uint32_t nrf_cache_instruction_hit_counter_get ( NRF_CACHE_Type const * p_reg,
nrf_cache_region_t region )

Function for getting the number of cache hits for instruction fetch from the specified cache region.

Note
Separate counters are used for flash region and XIP region.
Cache profiling must be enabled first. See nrf_cache_profiling_set.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]regionCache region.
Returns
Number of instruction fetch cache hits.

◆ nrf_cache_instruction_miss_counter_get()

NRF_STATIC_INLINE uint32_t nrf_cache_instruction_miss_counter_get ( NRF_CACHE_Type const * p_reg,
nrf_cache_region_t region )

Function for getting the number of cache misses for instruction fetch from the specified cache region.

Note
Separate counters are used for flash region and XIP region.
Cache profiling must be enabled first. See nrf_cache_profiling_set.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]regionCache region.
Returns
Number of instruction fetch cache misses.

◆ nrf_cache_invalidate()

NRF_STATIC_INLINE void nrf_cache_invalidate ( NRF_CACHE_Type * p_reg)

Function for invalidating the cache content.

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

◆ nrf_cache_is_data_unit_dirty_check()

NRF_STATIC_INLINE bool nrf_cache_is_data_unit_dirty_check ( NRF_CACHE_Type const * p_reg,
uint32_t set,
uint8_t way,
uint8_t word )

Function for checking the dirtiness of a data unit associated with the specified set, way and word.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]setSet that contains the data unit to check.
[in]wayWay that contains the data unit to check.
[in]wordData word index.
Return values
trueData unit is dirty.
falseData unit is clean.

◆ nrf_cache_line_validity_check()

NRF_STATIC_INLINE bool nrf_cache_line_validity_check ( NRF_CACHE_Type const * p_reg,
uint32_t set,
uint8_t way )

Function for checking the validity of a cache line associated with the specified set and way.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]setSet that contains the cache line to check.
[in]wayWay that contains the cache line to check.
Return values
trueCache line is valid.
falseCache line is invalid.

◆ nrf_cache_lineaddr_get()

NRF_STATIC_INLINE uint32_t nrf_cache_lineaddr_get ( NRF_CACHE_Type const * p_reg)

Function to get the memory address covered by the line to be maintained.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Cache line adress.

◆ nrf_cache_lineaddr_set()

NRF_STATIC_INLINE void nrf_cache_lineaddr_set ( NRF_CACHE_Type * p_reg,
uint32_t addr )

Function to set the memory address covered by the line to be maintained.

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

◆ nrf_cache_mru_get()

NRF_STATIC_INLINE uint8_t nrf_cache_mru_get ( NRF_CACHE_Type const * p_reg,
uint32_t set )

Function for getting the most recently used way in the specified set.

The most recently used way is updated on each fetch from the cache and is used for the cache replacement policy.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]setSpecified set.
Returns
The most recently used way in the specified set.

◆ nrf_cache_profiling_counters_clear()

NRF_STATIC_INLINE void nrf_cache_profiling_counters_clear ( NRF_CACHE_Type * p_reg)

Function for clearing the cache profiling counters.

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

◆ nrf_cache_profiling_set()

NRF_STATIC_INLINE void nrf_cache_profiling_set ( NRF_CACHE_Type * p_reg,
bool enable )

Function for setting the cache profiling.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]enableTrue if cache profiling is to be enabled, false otherwise.

◆ nrf_cache_ram_mode_check()

NRF_STATIC_INLINE bool nrf_cache_ram_mode_check ( NRF_CACHE_Type const * p_reg)

Function for checking whether the cache is in RAM mode.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
True if the cache RAM mode is enabled, false otherwise.

◆ nrf_cache_ram_mode_set()

NRF_STATIC_INLINE void nrf_cache_ram_mode_set ( NRF_CACHE_Type * p_reg,
bool enable )

Function for setting the cache RAM mode.

When configured in the RAM mode, the accesses to internal or external flash will not be cached. In this mode, the cache data contents can be used as the read/write RAM. Only the data content of the cache is available as RAM.

Note
Enabling the RAM mode causes the RAM to be cleared.
Disabling the RAM mode causes the cache to be invalidated.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]enableTrue if the cache RAM mode is to be enabled, false otherwise.

◆ nrf_cache_ramsize_get()

NRF_STATIC_INLINE nrf_cache_ramsize_t nrf_cache_ramsize_get ( NRF_CACHE_Type const * p_reg)

Function for getting the configuration of splitting the dedicated cache RAM.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Configuration of dedicated cache RAM split.

◆ nrf_cache_ramsize_set()

NRF_STATIC_INLINE void nrf_cache_ramsize_set ( NRF_CACHE_Type * p_reg,
nrf_cache_ramsize_t ramsize )

Function for setting the configuration of splitting the dedicated cache RAM.

Dedicated cache RAM can be splitted into cache memory and generic memory. By default, all dedicated RAM is used for cache memory.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]ramsizeDedicated cache RAM split configuration.

◆ nrf_cache_read_lock_enable()

NRF_STATIC_INLINE void nrf_cache_read_lock_enable ( NRF_CACHE_Type * p_reg)

Function for blocking the cache content access.

To unlock the cache content access, a reset has to be performed.

Note
Blocking is ignored in the RAM mode.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrf_cache_tag_get()

NRF_STATIC_INLINE uint32_t nrf_cache_tag_get ( NRF_CACHE_Type const * p_reg,
uint32_t set,
uint8_t way )

Function for getting the tag associated with the specified set and way.

The tag is used to check if an entry in the cache matches the address that is being fetched.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]setSet that contains the tag to get.
[in]wayWay that contains the tag to get.
Returns
Tag value.

◆ nrf_cache_task_address_get()

NRF_STATIC_INLINE uint32_t nrf_cache_task_address_get ( NRF_CACHE_Type const * p_reg,
nrf_cache_task_t task )

Function for returning the address of the specified task register.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskTask.
Returns
Task address.

◆ nrf_cache_task_trigger()

NRF_STATIC_INLINE void nrf_cache_task_trigger ( NRF_CACHE_Type * p_reg,
nrf_cache_task_t task )

Function for triggering the specified CACHE task.

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

◆ nrf_cache_update_lock_set()

NRF_STATIC_INLINE void nrf_cache_update_lock_set ( NRF_CACHE_Type * p_reg,
bool enable )

Function for blocking the cache content updates.

Blocking of updates prevents updating of cache content on cache misses, but the peripheral will continue to check for instruction/data fetches in the content already present in the cache.

Note
Blocking is ignored in the RAM mode.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]enableTrue if cache content update lock is to be enabled, false otherwise.