TAMPC HAL

group nrf_tampc_hal

Hardware access layer for managing the Tamper Controller (TAMPC) peripheral.

Defines

NRF_TAMPC_KEY_MASK

Protect register write key mask.

NRF_TAMPC_HAS_EVENT_WRITE_ERROR

Symbol indicating whether TAMPC write error event is present.

NRF_TAMPC_HAS_ACTIVE_SHIELD_CHANNELS

Symbol indicating whether TAMPC active shield channels are present.

NRF_TAMPC_HAS_EXTENDED_PROTECTORS

Symbol indicating whether TAMPC extended protection is present.

NRF_TAMPC_HAS_ERASE_PROTECTOR

Symbol indicating whether TAMPC erase protector is present.

NRF_TAMPC_HAS_DETECTORS_ENABLE

Symbol indicating whether the availability to enable the TAMPC detectors feature is present.

NRF_TAMPC_HAS_CORESIGHT

Symbol indicating whether the configuration of Coresight debugger signals protection is present.

NRF_TAMPC_HAS_WARMBOOT

Symbol indicating whether the configuration of warm boot protection is present.

Enums

enum nrf_tampc_event_t

TAMPC events.

Values:

enumerator NRF_TAMPC_EVENT_TAMPER

TAMPC detected an error.

enumerator NRF_TAMPC_EVENT_WRITE_ERROR

Attempted to write a VALUE in PROTECT registers without clearing the WRITEPROTECT.

enum nrf_tapmc_int_mask_t

TAMPC interrupts.

Values:

enumerator NRF_TAMPC_INT_TAMPER_MASK

Interrupt on TAMPER event.

enumerator NRF_TAMPC_INT_WRITE_ERROR_MASK

Interrupt on WRITEERROR event.

enumerator NRF_TAMPC_ALL_INTS_MASK

All TAMPC interrupts.

enum nrf_tampc_activeshield_mask_t

Active shield channel mask.

Values:

enumerator NRF_TAMPC_ACTIVESHIELD_CHANNEL_0_MASK

Enable active shield channel 0.

enumerator NRF_TAMPC_ACTIVESHIELD_CHANNEL_1_MASK

Enable active shield channel 1.

enumerator NRF_TAMPC_ACTIVESHIELD_CHANNEL_2_MASK

Enable active shield channel 2.

enumerator NRF_TAMPC_ACTIVESHIELD_CHANNEL_3_MASK

Enable active shield channel 3.

enumerator NRF_TAMPC_ALL_ACTIVESHIELD_CHANNELS_MASK

All TAMPC active shield channels.

enum nrf_tampc_detector_t

TAMPC error detectors.

Values:

enumerator NRF_TAMPC_DETECTOR_ACTIVE_SHIELD

Active shield error detector.

enumerator NRF_TAMPC_DETECTOR_TAMPER_SWITCH

External tamper switch error detector.

enumerator NRF_TAMPC_DETECTOR_PROTECTED_SIGNAL

Protected signals error detector.

enumerator NRF_TAMPC_DETECTOR_CRACEN

CRACEN error detector.

enumerator NRF_TAMPC_DETECTOR_GLITCH_DOMAIN_SLOW

Slow domain glitch error detector.

enumerator NRF_TAMPC_DETECTOR_GLITCH_DOMAIN_FAST

Fast domain glitch error detector.

enum nrf_tampc_protect_t

Signal protector registers.

Values:

enumerator NRF_TAMPC_PROTECT_ACTIVE_SHIELD

Control register for active shield detector enable signal.

enumerator NRF_TAMPC_PROTECT_TAMPER_SWITCH

Control register for external tamper switch enable signal.

enumerator NRF_TAMPC_PROTECT_CRACEN

Control register for CRACEN tamper detector enable signal.

enumerator NRF_TAMPC_PROTECT_GLITCH_DOMAIN_SLOW

Control register for slow domain glitch detectors enable signal.

enumerator NRF_TAMPC_PROTECT_GLITCH_DOMAIN_FAST

Control register for fast domain glitch detectors enable signal.

enumerator NRF_TAMPC_PROTECT_RESETEN_EXT

Control register for external tamper reset enable signal.

enumerator NRF_TAMPC_PROTECT_RESETEN_INT

Control register for internal tamper reset enable signal.

enumerator NRF_TAMPC_PROTECT_ERASE_PROTECT

Control register for erase protection.

enum nrf_tampc_debug_type_t

Control register debug types.

Values:

enumerator NRF_TAMPC_DEBUG_TYPE_DBGEN

Invasive (halting) debug.

enumerator NRF_TAMPC_DEBUG_TYPE_NIDEN

Non-invasive debug.

enumerator NRF_TAMPC_DEBUG_TYPE_SPIDEN

Secure privileged invasive (halting) debug.

enumerator NRF_TAMPC_DEBUG_TYPE_SPNIDEN

Secure privileged non-invasive debug.

enumerator NRF_TAMPC_DEBUG_TYPE_DEVICEEN

Domain circuitry.

enum nrf_tampc_warmboot_mode_t

Warm boot control register mode types.

Values:

enumerator NRF_TAMPC_WARMBOOT_MODE_UNRET_IDLE

Unretained idle mode.

enumerator NRF_TAMPC_WARMBOOT_MODE_SYSTEMOFF

System off mode.

Functions

NRF_STATIC_INLINE void nrf_tampc_event_clear(NRF_TAMPC_Type *p_reg, nrf_tampc_event_t event)

Function for clearing the specified TAMPC event.

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

  • event[in] Event to be cleared.

NRF_STATIC_INLINE bool nrf_tampc_event_check(NRF_TAMPC_Type const *p_reg, nrf_tampc_event_t event)

Function for retrieving the state of the TAMPC event.

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

  • event[in] Event to be checked.

Return values:
  • true – The event has been generated.

  • false – The event has not been generated.

NRF_STATIC_INLINE uint32_t nrf_tampc_event_address_get(NRF_TAMPC_Type const *p_reg, nrf_tampc_event_t event)

Function for getting the address of the specified TAMPC event register.

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

  • event[in] The specified event.

Returns:

Address of the specified event register.

NRF_STATIC_INLINE void nrf_tampc_int_enable(NRF_TAMPC_Type *p_reg, uint32_t mask)

Function for enabling the specified interrupts.

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

  • mask[in] Mask of interrupts to be enabled. Use nrf_tapmc_int_mask_t values for bit masking.

NRF_STATIC_INLINE void nrf_tampc_int_disable(NRF_TAMPC_Type *p_reg, uint32_t mask)

Function for disabling the specified interrupts.

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

  • mask[in] Mask of interrupts to be disabled. Use nrf_tapmc_int_mask_t values for bit masking.

NRF_STATIC_INLINE uint32_t nrf_tampc_int_enable_check(NRF_TAMPC_Type const *p_reg, uint32_t mask)

Function for checking if the specified interrupts are enabled.

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

  • mask[in] Mask of interrupts to be checked. Use nrf_tapmc_int_mask_t values for bit masking.

Returns:

Mask of enabled interrupts.

NRF_STATIC_INLINE uint32_t nrf_tampc_int_pending_get(NRF_TAMPC_Type const *p_reg)

Function for retrieving the state of pending interrupts.

Note

States of pending interrupt are saved as a bitmask. One set at particular position means that interrupt for event is pending.

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

Returns:

Bitmask with information about pending interrupts. Use nrf_tapmc_int_mask_t values for bit masking.

NRF_STATIC_INLINE bool nrf_tampc_detector_status_check(NRF_TAMPC_Type const *p_reg, nrf_tampc_detector_t detector)

Function for getting the error detection status for given error detector.

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

  • detector[in] Error detector for which the error status is to be retrieved.

Return values:
  • true – Error detected.

  • false – No error detected.

NRF_STATIC_INLINE void nrf_tampc_detector_status_clear(NRF_TAMPC_Type *p_reg, nrf_tampc_detector_t detector)

Function for clearing the error detection status for given error detector.

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

  • detector[in] Error detector for which the error status is to be cleared.

NRF_STATIC_INLINE void nrf_tampc_activeshield_channel_enable(NRF_TAMPC_Type *p_reg, uint32_t mask)

Function for enabling the specified active shield detector channels.

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

  • mask[in] Mask of active shield detector channels to be enabled, constructed from nrf_tampc_activeshield_mask_t enumerator values.

NRF_STATIC_INLINE void nrf_tampc_activeshield_channel_disable(NRF_TAMPC_Type *p_reg, uint32_t mask)

Function for disabling the specified active shield detector channels.

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

  • mask[in] Mask of active shield detector channels to be disabled, constructed from nrf_tampc_activeshield_mask_t enumerator values.

NRF_STATIC_INLINE uint32_t nrf_tampc_activeshield_channel_enable_check(NRF_TAMPC_Type const *p_reg, uint32_t mask)

Function for checking if the specified active shield detector channels are enabled.

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

  • mask[in] Mask of active shield detector channels to be checked, constructed from nrf_tampc_activeshield_mask_t enumerator values.

Returns:

Mask of enabled active shield detector channels.

NRF_STATIC_INLINE void nrf_tampc_domain_ctrl_value_set(NRF_TAMPC_Type *p_reg, nrf_tampc_debug_type_t type, nrf_domain_t domain, bool enable)

Function for setting signal value of the domain control register for given debug type and domain.

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

  • type[in] Debug type to be modified.

  • domain[in] Domain for which the value is to be modified.

  • enable[in] True if signal is to be logic 1, false if logic 0.

NRF_STATIC_INLINE bool nrf_tampc_domain_ctrl_value_get(NRF_TAMPC_Type const *p_reg, nrf_tampc_debug_type_t type, nrf_domain_t domain)

Function for getting the signal value of the domain control register for given debug type and domain.

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

  • type[in] Debug type to be retrieved.

  • domain[in] Domain for which the value is to be retrieved.

Return values:
  • true – Signal is logic 1.

  • false – Signal is logic 0.

NRF_STATIC_INLINE void nrf_tampc_domain_ctrl_lock_set(NRF_TAMPC_Type *p_reg, nrf_tampc_debug_type_t type, nrf_domain_t domain, bool enable)

Function for setting lock value of the domain control register for given debug type and domain.

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

  • type[in] Debug type to be modified.

  • domain[in] Domain for which the value is to be modified.

  • enable[in] True if register is to be locked, false otherwise.

NRF_STATIC_INLINE bool nrf_tampc_domain_ctrl_lock_get(NRF_TAMPC_Type const *p_reg, nrf_tampc_debug_type_t type, nrf_domain_t domain)

Function for getting the lock value of the domain control register for given debug type and domain.

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

  • type[in] Debug type to be retrieved.

  • domain[in] Domain for which the value is to be retrieved.

Return values:
  • true – Register is locked.

  • false – Register is unlocked.

NRF_STATIC_INLINE void nrf_tampc_ap_ctrl_value_set(NRF_TAMPC_Type *p_reg, nrf_tampc_debug_type_t type, nrf_domain_t domain, bool enable)

Function for setting signal value of the access port control register for given debug type and domain.

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

  • type[in] Debug type to be modified.

  • domain[in] Domain for which the value is to be modified.

  • enable[in] True if signal is to be logic 1, false if logic 0.

NRF_STATIC_INLINE bool nrf_tampc_ap_ctrl_value_get(NRF_TAMPC_Type const *p_reg, nrf_tampc_debug_type_t type, nrf_domain_t domain)

Function for getting the signal value of the access port control register for given debug type and domain.

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

  • type[in] Debug type to be retrieved.

  • domain[in] Domain for which the value is to be retrieved.

Return values:
  • true – Signal is logic 1.

  • false – Signal is logic 0.

NRF_STATIC_INLINE void nrf_tampc_ap_ctrl_lock_set(NRF_TAMPC_Type *p_reg, nrf_tampc_debug_type_t type, nrf_domain_t domain, bool enable)

Function for setting lock value of the access port control register for given debug type and domain.

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

  • type[in] Debug type to be modified.

  • domain[in] Domain for which the value is to be modified.

  • enable[in] True if register is to be locked, false otherwise.

NRF_STATIC_INLINE bool nrf_tampc_ap_ctrl_lock_get(NRF_TAMPC_Type const *p_reg, nrf_tampc_debug_type_t type, nrf_domain_t domain)

Function for getting the lock value of the access port control register for given debug type and domain.

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

  • type[in] Debug type to be retrieved.

  • domain[in] Domain for which the value is to be retrieved.

Return values:
  • true – Register is locked.

  • false – Register is unlocked.

NRF_STATIC_INLINE void nrf_tampc_coresight_ctrl_value_set(NRF_TAMPC_Type *p_reg, nrf_tampc_debug_type_t type, bool enable)

Function for setting signal value of the Coresight register for given debug type.

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

  • type[in] Debug type to be modified.

  • enable[in] True if signal is to be logic 1, false if logic 0.

NRF_STATIC_INLINE bool nrf_tampc_coresight_ctrl_value_get(NRF_TAMPC_Type const *p_reg, nrf_tampc_debug_type_t type)

Function for getting the signal value of the Coresight register for given debug type.

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

  • type[in] Debug type to be retrieved.

Return values:
  • true – Signal is logic 1.

  • false – Signal is logic 0.

NRF_STATIC_INLINE void nrf_tampc_coresight_ctrl_lock_set(NRF_TAMPC_Type *p_reg, nrf_tampc_debug_type_t type, bool enable)

Function for setting lock value of the Coresight register for given debug type.

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

  • type[in] Debug type to be modified.

  • enable[in] True if register is to be locked, false otherwise.

NRF_STATIC_INLINE bool nrf_tampc_coresight_ctrl_lock_get(NRF_TAMPC_Type const *p_reg, nrf_tampc_debug_type_t type)

Function for getting the lock value of the Coresight register for given debug type.

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

  • type[in] Debug type to be retrieved.

Return values:
  • true – Register is locked.

  • false – Register is unlocked.

NRF_STATIC_INLINE void nrf_tampc_coresight_ctrl_fault_set(NRF_TAMPC_Type *p_reg, nrf_tampc_debug_type_t type, bool enable)

Function for setting fault injection of the Coresight register for given debug type.

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

  • type[in] Debug type to be modified.

  • enable[in] True if fault is to be injected, false otherwise.

NRF_STATIC_INLINE bool nrf_tampc_coresight_ctrl_fault_get(NRF_TAMPC_Type const *p_reg, nrf_tampc_debug_type_t type)

Function for getting the fault injection of the Coresight register for given debug type.

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

  • type[in] Debug type to be retrieved.

Return values:
  • true – Fault is to be injected.

  • false – No operation.

NRF_STATIC_INLINE void nrf_tampc_warmboot_ctrl_value_set(NRF_TAMPC_Type *p_reg, nrf_tampc_warmboot_mode_t mode, bool enable)

Function for setting signal value of the warm boot register for given warm boot mode.

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

  • mode[in] Warm boot mode to be modified.

  • enable[in] True if signal is to be logic 1, false if logic 0.

NRF_STATIC_INLINE bool nrf_tampc_warmboot_ctrl_value_get(NRF_TAMPC_Type const *p_reg, nrf_tampc_warmboot_mode_t mode)

Function for getting the signal value of the warm boot register for given warm boot mode.

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

  • mode[in] Warm boot mode to be retrieved.

Return values:
  • true – Signal is logic 1.

  • false – Signal is logic 0.

NRF_STATIC_INLINE void nrf_tampc_warmboot_ctrl_lock_set(NRF_TAMPC_Type *p_reg, nrf_tampc_warmboot_mode_t mode, bool enable)

Function for setting lock value of the warm boot register for given warm boot mode.

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

  • mode[in] Warm boot mode to be modified.

  • enable[in] True if register is to be locked, false otherwise.

NRF_STATIC_INLINE bool nrf_tampc_warmboot_ctrl_lock_get(NRF_TAMPC_Type const *p_reg, nrf_tampc_warmboot_mode_t mode)

Function for getting the lock value of the warm boot register for given warm boot mode.

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

  • mode[in] Warm boot mode to be retrieved.

Return values:
  • true – Register is locked.

  • false – Register is unlocked.

NRF_STATIC_INLINE void nrf_tampc_warmboot_ctrl_fault_set(NRF_TAMPC_Type *p_reg, nrf_tampc_warmboot_mode_t mode, bool enable)

Function for setting fault injection of the warm boot register for given warm boot mode.

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

  • mode[in] Warm boot mode to be modified.

  • enable[in] True if fault is to be injected, false otherwise.

NRF_STATIC_INLINE bool nrf_tampc_warmboot_ctrl_fault_get(NRF_TAMPC_Type const *p_reg, nrf_tampc_warmboot_mode_t mode)

Function for getting the fault injection of the warm boot register for given warm boot mode.

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

  • mode[in] Warm boot mode to be retrieved.

Return values:
  • true – Fault is to be injected.

  • false – No operation.

NRF_STATIC_INLINE bool nrf_tampc_warmboot_status_check(NRF_TAMPC_Type const *p_reg, nrf_tampc_warmboot_mode_t mode)

Function for checking the error detection status for given warm boot mode.

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

  • mode[in] Warm boot mode for which to retrieve the error status.

Return values:
  • true – Error detected.

  • false – No error detected.

NRF_STATIC_INLINE void nrf_tampc_warmboot_status_clear(NRF_TAMPC_Type *p_reg, nrf_tampc_warmboot_mode_t mode)

Function for clearing the error detection status for given warm boot mode.

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

  • mode[in] Warm boot mode for which the error status is to be cleared.

NRF_STATIC_INLINE void nrf_tampc_protector_ctrl_value_set(NRF_TAMPC_Type *p_reg, nrf_tampc_protect_t ctrl, bool enable)

Function for setting signal value of the given signal protector register.

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

  • ctrl[in] Signal protector control register to be modified.

  • enable[in] True if signal is to be logic 1, false if logic 0.

NRF_STATIC_INLINE bool nrf_tampc_protector_ctrl_value_get(NRF_TAMPC_Type const *p_reg, nrf_tampc_protect_t ctrl)

Function for getting the signal value of the given signal protector register.

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

  • ctrl[in] Signal protector control register to be retrieved.

Return values:
  • true – Signal is logic 1.

  • false – Signal is logic 0.

NRF_STATIC_INLINE void nrf_tampc_protector_ctrl_lock_set(NRF_TAMPC_Type *p_reg, nrf_tampc_protect_t ctrl, bool enable)

Function for setting lock value of the given signal protector register.

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

  • ctrl[in] Signal protector control register to be modified.

  • enable[in] True if register is to be locked, false otherwise.

NRF_STATIC_INLINE bool nrf_tampc_protector_ctrl_lock_get(NRF_TAMPC_Type const *p_reg, nrf_tampc_protect_t ctrl)

Function for getting the lock value of the given signal protector register.

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

  • ctrl[in] Signal protector control register to be retrieved.

Return values:
  • true – Register is locked.

  • false – Register is unlocked.

NRF_STATIC_INLINE bool nrf_tampc_protector_status_check(NRF_TAMPC_Type const *p_reg, nrf_tampc_protect_t status)

Function for checking the error detection status for given signal protector status register.

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

  • status[in] Signal protector status register for which to retrieve the error status.

Return values:
  • true – Error detected.

  • false – No error detected.

NRF_STATIC_INLINE void nrf_tampc_protector_status_clear(NRF_TAMPC_Type *p_reg, nrf_tampc_protect_t status)

Function for clearing the error detection status for given signal protector status register.

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

  • status[in] Signal protector status register for which the error status is to be cleared.