MUTEX HAL

group nrf_mutex_hal

Hardware access layer for managing the MUTEX peripheral.

Functions

NRF_STATIC_INLINE bool nrf_mutex_lock(NRF_MUTEX_Type *p_reg, uint8_t mutex)

Function for locking the specified mutex.

If the specified mutex is already locked, its state remains unchanged.

Note

Faults are not managed by the MUTEX peripheral. One consequence is that if a mutex is locked and a fault happens, it is the responsibility of the fault handler to release the mutex. If a fault handler is not managing the mutex release, the mutex will remain locked.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mutex[in] Index of the mutex to be locked.

Return values:
  • true – Mutex is successfully locked.

  • false – Mutex was already locked.

NRF_STATIC_INLINE void nrf_mutex_unlock(NRF_MUTEX_Type *p_reg, uint8_t mutex)

Function for unlocking the specified mutex.

If the specified mutex is already unlocked, its state remains unchanged.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mutex[in] Index of the mutex to be locked.