RESETINFO HAL

group nrf_resetinfo_hal

Hardware access layer for managing the Reset information peripheral (RESETINFO).

Defines

NRF_RESETINFO_HAS_RESETREAS_STRUCT

Symbol indicating whether intermediate RESETREAS structure is present.

NRF_RESETINFO_HAS_MULTIPLE_SECWDT

Symbol indicating whether multiple secure domain watchdog resets are present.

NRF_RESETINFO_HAS_MASKLOCKUP

Symbol indicating whether CPU lockup signal masking is present.

NRF_RESETINFO_ERROR_STATUS_MAX

Maximum value of error status.

Enums

enum nrf_resetinfo_resetreas_global_mask_t

Global reset reason mask.

Values:

enumerator NRF_RESETINFO_RESETREAS_GLOBAL_POR_MASK

Reset from power on reset.

enumerator NRF_RESETINFO_RESETREAS_GLOBAL_PIN_MASK

Reset from pin reset.

enumerator NRF_RESETINFO_RESETREAS_GLOBAL_DOG_MASK

Reset from the SysCtrl watchdog timer.

enumerator NRF_RESETINFO_RESETREAS_GLOBAL_CTRLAP_MASK

Reset from CTRL-AP.

enumerator NRF_RESETINFO_RESETREAS_GLOBAL_SECSREQ_MASK

Reset due to secure domain system reset request.

enumerator NRF_RESETINFO_RESETREAS_GLOBAL_SECWDT0_MASK

Reset due to secure domain watchdog 0 timer.

enumerator NRF_RESETINFO_RESETREAS_GLOBAL_SECWDT1_MASK

Reset due to secure domain watchdog 1 timer.

enumerator NRF_RESETINFO_RESETREAS_GLOBAL_SECLOCKUP_MASK

Reset due to secure domain lockup.

enumerator NRF_RESETINFO_RESETREAS_GLOBAL_SECTAMPER_MASK

Reset due to secure domain tamper detected.

enumerator NRF_RESETINFO_RESETREAS_GLOBAL_GPIO_MASK

Reset due to wakeup from System OFF triggered by DETECT signal from GPIO.

enumerator NRF_RESETINFO_RESETREAS_GLOBAL_LPCOMP_MASK

Reset due to wakeup from System OFF triggered by LPCOMP.

enumerator NRF_RESETINFO_RESETREAS_GLOBAL_DIF_MASK

Reset due to wakeup from System OFF triggered by entering debug interface mode.

enumerator NRF_RESETINFO_RESETREAS_GLOBAL_GRTC_MASK

Reset due to wakeup from System OFF triggered by GRTC interrupt.

enumerator NRF_RESETINFO_RESETREAS_GLOBAL_NFC_MASK

Reset due to wakeup from System OFF triggered by NRF field detection in sense mode.

enumerator NRF_RESETINFO_RESETREAS_GLOBAL_VUSB_MASK

Reset due to wakeup from System OFF triggered by VBUS rising into valid range.

enum nrf_resetinfo_resetreas_local_mask_t

Local reset reason mask.

Values:

enumerator NRF_RESETINFO_RESETREAS_LOCAL_DOG_MASK

Reset from the local watchdog timer.

enumerator NRF_RESETINFO_RESETREAS_LOCAL_DOGNS_MASK

Reset from the local non-secure watchdog timer.

enumerator NRF_RESETINFO_RESETREAS_LOCAL_SREQ_MASK

Reset from the local soft reset request.

enumerator NRF_RESETINFO_RESETREAS_LOCAL_LOCKUP_MASK

Reset from local CPU lockup.

enumerator NRF_RESETINFO_RESETREAS_LOCAL_CROSSDOMAIN_MASK

Reset due to cross domain reset source.

enumerator NRF_RESETINFO_RESETREAS_LOCAL_UNRETAINED_MASK

Reset due to wake from unretained state.

Functions

NRF_STATIC_INLINE void nrf_resetinfo_resetreas_global_set(NRF_RESETINFO_Type *p_reg, uint32_t mask)

Function for setting the global reset reason.

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

  • mask[in] Mask of reasons to be set, constructed from nrf_resetinfo_resetreas_global_mask_t enumerator values.

NRF_STATIC_INLINE uint32_t nrf_resetinfo_resetreas_global_get(NRF_RESETINFO_Type const *p_reg)

Function for getting the global reset reason.

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

Returns:

Mask of detected global reset reasons constructed with nrf_resetinfo_resetreas_global_mask_t.

NRF_STATIC_INLINE void nrf_resetinfo_resetreas_local_set(NRF_RESETINFO_Type *p_reg, uint32_t mask)

Function for setting the local reset reason.

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

  • mask[in] Mask of reasons to be set, constructed from nrf_resetinfo_resetreas_local_mask_t enumerator values.

NRF_STATIC_INLINE uint32_t nrf_resetinfo_resetreas_local_get(NRF_RESETINFO_Type const *p_reg)

Function for getting the local reset reason.

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

Returns:

Mask of detected local reset reasons constructed with nrf_resetinfo_resetreas_local_mask_t.

NRF_STATIC_INLINE void nrf_resetinfo_error_status_set(NRF_RESETINFO_Type *p_reg, uint8_t status)

Function for setting the reset error status.

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

  • status[in] Reset error status to be set.

NRF_STATIC_INLINE uint8_t nrf_resetinfo_error_status_get(NRF_RESETINFO_Type const *p_reg)

Function for getting the reset error status.

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

Returns:

Reset error status.

NRF_STATIC_INLINE void nrf_resetinfo_error_address_set(NRF_RESETINFO_Type *p_reg, uint32_t address)

Function for setting the reset error address.

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

  • address[in] Reset error address to be set.

NRF_STATIC_INLINE uint32_t nrf_resetinfo_error_address_get(NRF_RESETINFO_Type const *p_reg)

Function for getting the reset error address.

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

Returns:

Reset error address.

NRF_STATIC_INLINE void nrf_resetinfo_restore_valid_set(NRF_RESETINFO_Type *p_reg, bool enable)

Function for setting the flag indicating presence of valid restore image in RAM.

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

  • enable[in] True if valid restore image is present in RAM, false otherwise.

NRF_STATIC_INLINE bool nrf_resetinfo_restore_valid_check(NRF_RESETINFO_Type const *p_reg)

Function for getting the flag indicating presence of valid restore image in RAM.

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

Return values:
  • true – Valid restore image is present in RAM.

  • false – Valid restore image is not present in RAM.

NRF_STATIC_INLINE void nrf_resetinfo_mask_lockup_set(NRF_RESETINFO_Type *p_reg, bool enable)

Function for setting the flag indicating if CPU lockup signal is to be masked.

Note

Prevents the CPU lockup signal from triggering a local reset. Needed to be able to start debug session.

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

  • enable[in] True if lockup signal is to be masked, false otherwise.

NRF_STATIC_INLINE bool nrf_resetinfo_mask_lockup_check(NRF_RESETINFO_Type const *p_reg)

Function for getting the flag indicating if CPU lockup signal is to be masked.

Note

Prevents the CPU lockup signal from triggering a local reset. Needed to be able to start debug session.

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

Return values:
  • true – CPU lockup signal is to be masked.

  • false – CPU lockup signal is not to be masked.