nrfx 4.5.0
Loading...
Searching...
No Matches
CTRL-AP HAL

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

Data Structures

struct  nrf_ctrlap_info_t
 CTRLAP device information. More...
 

Macros

#define NRF_CTRLAP_HAS_INFO   1
 Symbol indicating whether the INFO register is present.
 
#define NRF_CTRLAP_HAS_BOOTMODE   1
 Symbol indicating whether the BOOTMODE register is present.
 
#define NRF_CTRLAP_HAS_READY   1
 Symbol indicating whether the READY register is present.
 
#define NRF_CTRLAP_HAS_ERASEPROTECT   1
 Symbol indicating whether the ERASEPROTECT register is present.
 
#define NRF_CTRLAP_HAS_RESET   1
 Symbol indicating whether the RESET register is present.
 

Enumerations

enum  nrf_ctrlap_event_t {
  NRF_CTRLAP_EVENT_RXREADY = offsetof(NRF_CTRLAPPERI_Type, EVENTS_RXREADY) ,
  NRF_CTRLAP_EVENT_TXDONE = offsetof(NRF_CTRLAPPERI_Type, EVENTS_TXDONE)
}
 CTRLAP events. More...
 
enum  nrf_ctrlap_int_mask_t {
  NRF_CTRLAP_INT_RXREADY_MASK = CTRLAPPERI_INTENSET_RXREADY_Msk ,
  NRF_CTRLAP_INT_TXDONE_MASK = CTRLAPPERI_INTENSET_TXDONE_Msk
}
 CTRLAP interrupts. More...
 
enum  nrf_ctrlap_bootmode_t {
  NRF_CTRLAP_MODE_NORMAL = CTRLAPPERI_MAILBOX_BOOTMODE_MODE_Normal ,
  NRF_CTRLAP_MODE_ROM_OPERATION = CTRLAPPERI_MAILBOX_BOOTMODE_MODE_ROMOperation
}
 CTRLAP secure domain boot mode. More...
 
enum  nrf_ctrlap_reset_t {
  NRF_CTRLAP_RESET_NONE = CTRLAPPERI_RESET_RESET_NoReset ,
  NRF_CTRLAP_RESET_SOFT = CTRLAPPERI_RESET_RESET_SoftReset ,
  NRF_CTRLAP_RESET_HARD = CTRLAPPERI_RESET_RESET_HardReset ,
  NRF_CTRLAP_RESET_PIN = CTRLAPPERI_RESET_RESET_PinReset
}
 CTRLAP reset types. More...
 

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.
 
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.
 
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.
 
NRF_STATIC_INLINE void nrf_ctrlap_int_enable (NRF_CTRLAPPERI_Type *p_reg, uint32_t mask)
 Function for enabling the specified interrupts.
 
NRF_STATIC_INLINE void nrf_ctrlap_int_disable (NRF_CTRLAPPERI_Type *p_reg, uint32_t mask)
 Function for disabling the specified interrupts.
 
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.
 
NRF_STATIC_INLINE uint32_t nrf_ctrlap_int_pending_get (NRF_CTRLAPPERI_Type const *p_reg)
 Function for retrieving the state of pending interrupts.
 
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.
 
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.
 
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.
 
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.
 
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.
 
NRF_STATIC_INLINE nrf_ctrlap_bootmode_t nrf_ctrlap_mailbox_bootmode_get (NRF_CTRLAPPERI_Type const *p_reg)
 Function for checking 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.
 
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.
 
NRF_STATIC_INLINE void nrf_ctrlap_erase_lock_set (NRF_CTRLAPPERI_Type *p_reg, bool enable)
 Function for locking erase operation in CTRLAP until next reset.
 
NRF_STATIC_INLINE bool nrf_ctrlap_erase_lock_get (NRF_CTRLAPPERI_Type const *p_reg)
 Function for reading lock of the CTRLAP erase protection.
 
NRF_STATIC_INLINE void nrf_ctrlap_erase_all (NRF_CTRLAPPERI_Type *p_reg, uint32_t key)
 Function for performing a secure erase of the device.
 
NRF_STATIC_INLINE void nrf_ctrlap_reset_trigger (NRF_CTRLAPPERI_Type *p_reg, nrf_ctrlap_reset_t reset)
 Function for triggering a reset of requested type.
 

Detailed Description

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

Enumeration Type Documentation

◆ nrf_ctrlap_bootmode_t

CTRLAP secure domain boot mode.

Enumerator
NRF_CTRLAP_MODE_NORMAL 

Normal mode of operation.

NRF_CTRLAP_MODE_ROM_OPERATION 

ROM operation mode.

◆ nrf_ctrlap_event_t

CTRLAP events.

Enumerator
NRF_CTRLAP_EVENT_RXREADY 

New data from the peer is available.

NRF_CTRLAP_EVENT_TXDONE 

Data has been read by the peer.

◆ nrf_ctrlap_int_mask_t

CTRLAP interrupts.

Enumerator
NRF_CTRLAP_INT_RXREADY_MASK 

Interrupt on RXREADY event.

NRF_CTRLAP_INT_TXDONE_MASK 

Interrupt on TXDONE event.

◆ nrf_ctrlap_reset_t

CTRLAP reset types.

Enumerator
NRF_CTRLAP_RESET_NONE 

No reset is performed.

NRF_CTRLAP_RESET_SOFT 

Soft reset is performed.

NRF_CTRLAP_RESET_HARD 

Hard reset is performed.

NRF_CTRLAP_RESET_PIN 

Pin reset is performed.

Function Documentation

◆ nrf_ctrlap_erase_all()

NRF_STATIC_INLINE void nrf_ctrlap_erase_all ( NRF_CTRLAPPERI_Type * p_reg,
uint32_t key )

Function for performing a secure erase of the device.

Note
To perform a secure erase, the value of key needs to be non-zero and match with the key on the debugger side.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]keyKey for performing a secure erase.

◆ nrf_ctrlap_erase_lock_get()

NRF_STATIC_INLINE bool nrf_ctrlap_erase_lock_get ( NRF_CTRLAPPERI_Type const * p_reg)

Function for reading lock of the CTRLAP erase protection.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
true Erase is locked.
false Erase is unlocked.

◆ nrf_ctrlap_erase_lock_set()

NRF_STATIC_INLINE void nrf_ctrlap_erase_lock_set ( NRF_CTRLAPPERI_Type * p_reg,
bool enable )

Function for locking erase operation in CTRLAP until next reset.

Note
Some devices do not support erase operation unlocking. Refer to the Product Specification for more information.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]enableTrue if erase is to be locked, false otherwise.

◆ nrf_ctrlap_event_address_get()

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
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventRequested event.
Return values
Addressof the specified event register.

◆ nrf_ctrlap_event_check()

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
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent to be checked.
Return values
trueThe event has been generated.
falseThe event has not been generated.

◆ nrf_ctrlap_event_clear()

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
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent to clear.

◆ nrf_ctrlap_info_get()

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
[in]p_regPointer to the structure of registers of the peripheral.
[out]p_dataPointer to the data structure to be filled with device information.

◆ nrf_ctrlap_info_set()

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
[in]p_regPointer to the structure of registers of the peripheral.
[in]p_dataPointer to the device information structure.

◆ nrf_ctrlap_int_disable()

NRF_STATIC_INLINE void nrf_ctrlap_int_disable ( NRF_CTRLAPPERI_Type * p_reg,
uint32_t mask )

Function for disabling the specified interrupts.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be disabled. Use nrf_ctrlap_int_mask_t values for bit masking.

◆ nrf_ctrlap_int_enable()

NRF_STATIC_INLINE void nrf_ctrlap_int_enable ( NRF_CTRLAPPERI_Type * p_reg,
uint32_t mask )

Function for enabling the specified interrupts.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be enabled. Use nrf_ctrlap_int_mask_t values for bit masking.

◆ nrf_ctrlap_int_enable_check()

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
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be checked. Use nrf_ctrlap_int_mask_t values for bit masking.
Return values
Maskof enabled interrupts.

◆ nrf_ctrlap_int_pending_get()

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
[in]p_regPointer to the structure of registers of the peripheral.
Return values
Bitmaskwith information about pending interrupts. Use nrf_ctrlap_int_mask_t values for bit masking.

◆ nrf_ctrlap_mailbox_bootmode_get()

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
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Boot mode.

◆ nrf_ctrlap_mailbox_rxdata_get()

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
[in]p_regPointer to the structure of registers of the peripheral.
Return values
Datasent from the debugger to the CPU.

◆ nrf_ctrlap_mailbox_rxstatus_pending_check()

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
[in]p_regPointer to the structure of registers of the peripheral.
Return values
trueData pending in register RXDATA.
falseNo data pending in register RXDATA.

◆ nrf_ctrlap_mailbox_txdata_get()

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
[in]p_regPointer to the structure of registers of the peripheral.
Return values
Datasent from the CPU to the debugger.

◆ nrf_ctrlap_mailbox_txdata_set()

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
[in]p_regPointer to the structure of registers of the peripheral.
[in]dataData to send.

◆ nrf_ctrlap_mailbox_txstatus_pending_check()

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
[in]p_regPointer to the structure of registers of the peripheral.
Return values
trueData pending in register TXDATA.
falseNo data pending in register TXDATA.

◆ nrf_ctrlap_reset_trigger()

NRF_STATIC_INLINE void nrf_ctrlap_reset_trigger ( NRF_CTRLAPPERI_Type * p_reg,
nrf_ctrlap_reset_t reset )

Function for triggering a reset of requested type.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]resetRequested reset type.