Skip to content

Commit

Permalink
nrfx: hal: nrf_cache: Add nrf_cache_lineaddr_get
Browse files Browse the repository at this point in the history
Add function for getting LINEADDR register content.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
  • Loading branch information
nordic-krch committed Apr 23, 2024
1 parent 827224f commit bdef8b6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions nrfx/hal/nrf_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,15 @@ NRF_STATIC_INLINE bool nrf_cache_is_data_unit_dirty_check(NRF_CACHEINFO_Type con
*/
NRF_STATIC_INLINE void nrf_cache_lineaddr_set(NRF_CACHE_Type * p_reg, uint32_t addr);

/**
* @brief Function to get the memory address covered by the line to be maintained.
*
* @param[in] p_reg Pointer to the structure of registers of the peripheral.
*
* @return Cache line adress.
*/
NRF_STATIC_INLINE uint32_t nrf_cache_lineaddr_get(NRF_CACHE_Type const * p_reg);

/**
* @brief Function for triggering the specified CACHE task.
*
Expand Down Expand Up @@ -869,6 +878,11 @@ NRF_STATIC_INLINE void nrf_cache_lineaddr_set(NRF_CACHE_Type * p_reg, uint32_t a
p_reg->LINEADDR = addr;
}

NRF_STATIC_INLINE uint32_t nrf_cache_lineaddr_get(NRF_CACHE_Type const * p_reg)
{
return p_reg->LINEADDR;
}

NRF_STATIC_INLINE void nrf_cache_task_trigger(NRF_CACHE_Type * p_reg, nrf_cache_task_t task)
{
*((volatile uint32_t *)((uint8_t *)p_reg + (uint32_t)task)) = 0x1UL;
Expand Down

0 comments on commit bdef8b6

Please sign in to comment.