CTRL-AP HAL

group nrf_ctrlap_hal

Hardware access layer for managing the Control Access Port (CTRL-AP) peripheral.

Enums

enum nrf_ctrlap_event_t

CTRLAP events.

Values:

enumerator NRF_CTRLAP_EVENT_RXREADY

New data from the peer is available.

enumerator NRF_CTRLAP_EVENT_TXDONE

Data has been read by the peer.

enum nrf_ctrlap_int_mask_t

CTRLAP interrupts.

Values:

enumerator NRF_CTRLAP_INT_RXREADY_MASK

Interrupt on RXREADY event.

enumerator NRF_CTRLAP_INT_TXDONE_MASK

Interrupt on TXDONE event.

enum nrf_ctrlap_bootmode_t

CTRLAP secure domain boot mode.

Values:

enumerator NRF_CTRLAP_MODE_NORMAL

Normal mode of operation.

enumerator NRF_CTRLAP_MODE_ROM_OPERATION

ROM operation mode.

Functions

NRF_STATIC_INLINE void nrf_ctrlap_event_clear(NRF_CTRLAPPERI_Type *p_reg, nrf_ctrlap_event_t event)

Function for clearing the specified CTRLAP event.

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

  • event[in] Event to clear.

NRF_STATIC_INLINE bool nrf_ctrlap_event_check(NRF_CTRLAPPERI_Type const *p_reg, nrf_ctrlap_event_t event)

Function for retrieving the state of the CTRLAP 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_ctrlap_event_address_get(NRF_CTRLAPPERI_Type const *p_reg, nrf_ctrlap_event_t event)

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

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

  • event[in] Requested event.

Return values:

Address – of the specified event register.

NRF_STATIC_INLINE void nrf_ctrlap_int_enable(NRF_CTRLAPPERI_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_ctrlap_int_mask_t values for bit masking.

NRF_STATIC_INLINE void nrf_ctrlap_int_disable(NRF_CTRLAPPERI_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_ctrlap_int_mask_t values for bit masking.

NRF_STATIC_INLINE uint32_t nrf_ctrlap_int_enable_check(NRF_CTRLAPPERI_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_ctrlap_int_mask_t values for bit masking.

Return values:

Mask – of enabled interrupts.

NRF_STATIC_INLINE uint32_t nrf_ctrlap_int_pending_get(NRF_CTRLAPPERI_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.

Return values:

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

NRF_STATIC_INLINE uint32_t nrf_ctrlap_mailbox_rxdata_get(NRF_CTRLAPPERI_Type const *p_reg)

Function for reading data sent from the debugger to the CPU.

Note

Reading from this register will clear pending status of RX.

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

Return values:

Data – sent from the debugger to the CPU.

NRF_STATIC_INLINE bool nrf_ctrlap_mailbox_rxstatus_pending_check(NRF_CTRLAPPERI_Type const *p_reg)

Function for checking if data sent from the debugger to the CPU has been read.

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

Return values:
  • true – Data pending in register RXDATA.

  • false – No data pending in register RXDATA.

NRF_STATIC_INLINE uint32_t nrf_ctrlap_mailbox_txdata_get(NRF_CTRLAPPERI_Type const *p_reg)

Function for reading data sent from CPU to debugger.

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

Return values:

Data – sent from the CPU to the debugger.

NRF_STATIC_INLINE void nrf_ctrlap_mailbox_txdata_set(NRF_CTRLAPPERI_Type *p_reg, uint32_t data)

Function for writing data sent from CPU to debugger.

Writing to this register will automatically set field DataPending in register TXSTATUS.

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

  • data[in] Data to send.

NRF_STATIC_INLINE bool nrf_ctrlap_mailbox_txstatus_pending_check(NRF_CTRLAPPERI_Type const *p_reg)

Function for checking if data sent from the CPU to the debugger has been read.

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

Return values:
  • true – Data pending in register TXDATA.

  • false – No data pending in register TXDATA.

NRF_STATIC_INLINE nrf_ctrlap_bootmode_t nrf_ctrlap_mailbox_bootmode_get(NRF_CTRLAPPERI_Type const *p_reg)

Function for checking boot mode.

Note

If ROM operation mode is set the MAILBOX is used to communicate the secure ROM operations.

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

Returns:

Boot mode.

NRF_STATIC_INLINE void nrf_ctrlap_info_set(NRF_CTRLAPPERI_Type *p_reg, nrf_ctrlap_info_t const *p_data)

Function for setting the CTRLAP device information.

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

  • p_data[in] Pointer to the device information structure.

NRF_STATIC_INLINE void nrf_ctrlap_info_get(NRF_CTRLAPPERI_Type const *p_reg, nrf_ctrlap_info_t *p_data)

Function for getting the CTRLAP device information.

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

  • p_data[out] Pointer to the data structure to be filled with device information.

struct nrf_ctrlap_info_t
#include <nrf_ctrlap.h>

CTRLAP device information.

Public Members

uint32_t partno

Part number of the device, this information is retained on system on idle.

uint32_t hw_revision

Hardware Revision of the device, this information is retained on system on idle.

bool ready

Set when INFO registers update is completed.