1 /*
2  * Copyright (c) 2023 Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Note that the function prototypes are taken from the NRFx HAL
7  */
8 #include "hal/nrf_mutex.h"
9 #include "bs_tracing.h"
10 #include "NHW_MUTEX.h"
11 
nrf_mutex_lock(NRF_MUTEX_Type * p_reg,uint8_t mutex)12 bool nrf_mutex_lock(NRF_MUTEX_Type * p_reg, uint8_t mutex)
13 {
14     return (nhw_MUTEX_regr_sideeffects_MUTEX(mutex) == MUTEX_MUTEX_MUTEX_Unlocked);
15 }
16 
nrf_mutex_unlock(NRF_MUTEX_Type * p_reg,uint8_t mutex)17 void nrf_mutex_unlock(NRF_MUTEX_Type * p_reg, uint8_t mutex)
18 {
19     nhw_MUTEX_regw_sideeffects_MUTEX(mutex);
20 }
21