nrfx 3.3
Macros | Enumerations | Functions
KMU HAL

Hardware access layer for managing the Key Management Unit (KMU) peripheral. More...

Macros

#define NRF_KMU_HAS_INTEN   1
 Symbol indicating whether INTEN register is available.
 
#define NRF_KMU_HAS_PROVISION   1
 Symbol indicating whether KMU has PROVISION registers.
 
#define NRF_KMU_HAS_REVOKE   1
 Symbol indicating whether KMU has REVOKE registers.
 
#define NRF_KMU_HAS_READ_METADATA   1
 Symbol indicating whether KMU has READMETADATA registers.
 
#define NRF_KMU_HAS_PUSH_BLOCK   1
 Symbol indicating whether KMU has PUSHBLOCK registers.
 
#define NRF_KMU_HAS_SRC   1
 Symbol indicating whether KMU has SRC registers.
 
#define NRF_KMU_HAS_METADATA   1
 Symbol indicating whether KMU has METADATA registers.
 

Enumerations

enum  nrf_kmu_task_t {
  NRF_KMU_TASK_PROVISION_KEYSLOT = offsetof(NRF_KMU_Type, TASKS_PROVISION) ,
  NRF_KMU_TASK_PUSH_KEYSLOT = offsetof(NRF_KMU_Type, TASKS_PUSH_KEYSLOT) ,
  NRF_KMU_TASK_REVOKE_KEYSLOT = offsetof(NRF_KMU_Type, TASKS_PROVISION) ,
  NRF_KMU_TASK_READ_METADATA = offsetof(NRF_KMU_Type, TASKS_READMETADATA) ,
  NRF_KMU_TASK_PUSH_BLOCK = offsetof(NRF_KMU_Type, TASKS_PUSHBLOCK)
}
 KMU tasks. More...
 
enum  nrf_kmu_event_t {
  NRF_KMU_EVENT_EVENTS_PROVISIONED = offsetof(NRF_KMU_Type, EVENTS_PROVISIONED) ,
  NRF_KMU_EVENT_KEYSLOT_PUSHED = offsetof(NRF_KMU_Type, EVENTS_KEYSLOT_PUSHED) ,
  NRF_KMU_EVENT_KEYSLOT_REVOKED = offsetof(NRF_KMU_Type, EVENTS_KEYSLOT_REVOKED) ,
  NRF_KMU_EVENT_KEYSLOT_ERROR = offsetof(NRF_KMU_Type, EVENTS_KEYSLOT_ERROR) ,
  NRF_KMU_EVENT_EVENTS_EVENTS_METADATA_READ = offsetof(NRF_KMU_Type, EVENTS_METADATAREAD) ,
  NRF_KMU_EVENT_EVENTS_EVENTS_PUSHBLOCKED = offsetof(NRF_KMU_Type, EVENTS_PUSHBLOCKED)
}
 KMU events. More...
 
enum  nrf_kmu_int_mask_t {
  NRF_KMU_INT_PUSHED_MASK = KMU_INTEN_KEYSLOT_PUSHED_Msk ,
  NRF_KMU_INT_REVOKED_MASK = KMU_INTEN_KEYSLOT_REVOKED_Msk ,
  NRF_KMU_INT_ERROR_MASK = KMU_INTEN_KEYSLOT_ERROR_Msk
}
 KMU interrupts. More...
 
enum  nrf_kmu_status_t {
  NRF_KMU_STATUS_BLOCKED_MASK = KMU_STATUS_BLOCKED_Msk ,
  NRF_KMU_STATUS_SELECTED_MASK = KMU_STATUS_SELECTED_Msk ,
  NRF_KMU_STATUS_READY = KMU_STATUS_STATUS_Ready ,
  NRF_KMU_STATUS_BUSY = KMU_STATUS_STATUS_Busy
}
 KMU operation status. More...
 

Functions

NRF_STATIC_INLINE void nrf_kmu_task_trigger (NRF_KMU_Type *p_reg, nrf_kmu_task_t task)
 Function for activating a specific KMU task.
 
NRF_STATIC_INLINE uint32_t nrf_kmu_task_address_get (NRF_KMU_Type const *p_reg, nrf_kmu_task_t task)
 Function for getting the address of a specific KMU task register.
 
NRF_STATIC_INLINE void nrf_kmu_event_clear (NRF_KMU_Type *p_reg, nrf_kmu_event_t event)
 Function for clearing a specific KMU event.
 
NRF_STATIC_INLINE bool nrf_kmu_event_check (NRF_KMU_Type const *p_reg, nrf_kmu_event_t event)
 Function for retrieving the state of the KMU event.
 
NRF_STATIC_INLINE uint32_t nrf_kmu_event_address_get (NRF_KMU_Type const *p_reg, nrf_kmu_event_t event)
 Function for getting the address of a specific KMU event register.
 
NRF_STATIC_INLINE void nrf_kmu_int_enable (NRF_KMU_Type *p_reg, uint32_t mask)
 Function for enabling specified interrupts.
 
NRF_STATIC_INLINE void nrf_kmu_int_disable (NRF_KMU_Type *p_reg, uint32_t mask)
 Function for disabling specified interrupts.
 
NRF_STATIC_INLINE uint32_t nrf_kmu_int_enable_check (NRF_KMU_Type const *p_reg, uint32_t mask)
 Function for checking if the specified interrupts are enabled.
 
NRF_STATIC_INLINE uint32_t nrf_kmu_intpend_get (NRF_KMU_Type const *p_reg)
 Function for retrieving the state of pending interrupts.
 
NRF_STATIC_INLINE uint32_t nrf_kmu_status_get (NRF_KMU_Type const *p_reg)
 Function for getting status bits of the KMU operation.
 
NRF_STATIC_INLINE void nrf_kmu_keyslot_set (NRF_KMU_Type *p_reg, uint8_t keyslot_id)
 Function for selecting the key slot ID.
 
NRF_STATIC_INLINE uint8_t nrf_kmu_keyslot_get (NRF_KMU_Type const *p_reg)
 Function for getting the key slot ID.
 
NRF_STATIC_INLINE void nrf_kmu_src_set (NRF_KMU_Type *p_reg, uint32_t src)
 Function for setting the source address for provisioning.
 
NRF_STATIC_INLINE uint32_t nrf_kmu_src_get (NRF_KMU_Type const *p_reg)
 Function for getting the source address for provisioning.
 
NRF_STATIC_INLINE void nrf_kmu_metadata_set (NRF_KMU_Type *p_reg, uint32_t metdata)
 Function for setting the key slot metadata.
 
NRF_STATIC_INLINE uint32_t nrf_kmu_metadata_get (NRF_KMU_Type const *p_reg)
 Function for getting the key slot metadata.
 

Detailed Description

Hardware access layer for managing the Key Management Unit (KMU) peripheral.

Enumeration Type Documentation

◆ nrf_kmu_event_t

KMU events.

Enumerator
NRF_KMU_EVENT_EVENTS_PROVISIONED 

Key slot successfully provisioned.

NRF_KMU_EVENT_KEYSLOT_PUSHED 

Key successfully pushed over secure APB.

NRF_KMU_EVENT_KEYSLOT_REVOKED 

Key has been revoked and cannot be tasked for selection.

NRF_KMU_EVENT_KEYSLOT_ERROR 

No key slot selected or no destination address defined or error during push mechanism.

NRF_KMU_EVENT_EVENTS_EVENTS_METADATA_READ 

Key slot metedata has been read into METADATA register.

NRF_KMU_EVENT_EVENTS_EVENTS_PUSHBLOCKED 

The PUSHBLOCK operation was succesful.

◆ nrf_kmu_int_mask_t

KMU interrupts.

Enumerator
NRF_KMU_INT_PUSHED_MASK 

Interrupt on KEYSLOT_PUSHED event.

NRF_KMU_INT_REVOKED_MASK 

Interrupt on KEYSLOT_REVOKED event.

NRF_KMU_INT_ERROR_MASK 

Interrupt on KEYSLOT_ERROR event.

◆ nrf_kmu_status_t

KMU operation status.

Enumerator
NRF_KMU_STATUS_BLOCKED_MASK 

Access violation detected and blocked.

NRF_KMU_STATUS_SELECTED_MASK 

Key slot ID successfully selected by KMU.

NRF_KMU_STATUS_READY 

KMU is ready for a new operation.

NRF_KMU_STATUS_BUSY 

KMU is busy, an operation is in progress.

◆ nrf_kmu_task_t

KMU tasks.

Enumerator
NRF_KMU_TASK_PROVISION_KEYSLOT 

Provision key slot.

NRF_KMU_TASK_PUSH_KEYSLOT 

Push a key slot over secure APB.

NRF_KMU_TASK_REVOKE_KEYSLOT 

Revoke key slot.

NRF_KMU_TASK_READ_METADATA 

Read key slot metedata into METADATA register.

NRF_KMU_TASK_PUSH_BLOCK 

Block the PUSH operation of key slot, preventing the key slot being PUSH until next reset.

Function Documentation

◆ nrf_kmu_event_address_get()

NRF_STATIC_INLINE uint32_t nrf_kmu_event_address_get ( NRF_KMU_Type const *  p_reg,
nrf_kmu_event_t  event 
)

Function for getting the address of a specific KMU event register.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventRequested event.
Returns
Address of the specified event register.

◆ nrf_kmu_event_check()

NRF_STATIC_INLINE bool nrf_kmu_event_check ( NRF_KMU_Type const *  p_reg,
nrf_kmu_event_t  event 
)

Function for retrieving the state of the KMU 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_kmu_event_clear()

NRF_STATIC_INLINE void nrf_kmu_event_clear ( NRF_KMU_Type *  p_reg,
nrf_kmu_event_t  event 
)

Function for clearing a specific KMU event.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent to clear.

◆ nrf_kmu_int_disable()

NRF_STATIC_INLINE void nrf_kmu_int_disable ( NRF_KMU_Type *  p_reg,
uint32_t  mask 
)

Function for disabling specified interrupts.

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

◆ nrf_kmu_int_enable()

NRF_STATIC_INLINE void nrf_kmu_int_enable ( NRF_KMU_Type *  p_reg,
uint32_t  mask 
)

Function for enabling specified interrupts.

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

◆ nrf_kmu_int_enable_check()

NRF_STATIC_INLINE uint32_t nrf_kmu_int_enable_check ( NRF_KMU_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_kmu_int_mask_t values for bit masking.
Returns
Mask of enabled interrupts.

◆ nrf_kmu_intpend_get()

NRF_STATIC_INLINE uint32_t nrf_kmu_intpend_get ( NRF_KMU_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.
Returns
Bitmask with information about pending interrupts. Use nrf_kmu_int_mask_t values for bit masking.

◆ nrf_kmu_keyslot_get()

NRF_STATIC_INLINE uint8_t nrf_kmu_keyslot_get ( NRF_KMU_Type const *  p_reg)

Function for getting the key slot ID.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Key slot ID.

◆ nrf_kmu_keyslot_set()

NRF_STATIC_INLINE void nrf_kmu_keyslot_set ( NRF_KMU_Type *  p_reg,
uint8_t  keyslot_id 
)

Function for selecting the key slot ID.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]keyslot_idKey slot ID to be read over AHB or pushed over secure APB when TASKS_PUSH_KEYSLOT is started.

◆ nrf_kmu_metadata_get()

NRF_STATIC_INLINE uint32_t nrf_kmu_metadata_get ( NRF_KMU_Type const *  p_reg)

Function for getting the key slot metadata.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Key slot metadata.

◆ nrf_kmu_metadata_set()

NRF_STATIC_INLINE void nrf_kmu_metadata_set ( NRF_KMU_Type *  p_reg,
uint32_t  metdata 
)

Function for setting the key slot metadata.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]metdataKey slot metadata.

◆ nrf_kmu_src_get()

NRF_STATIC_INLINE uint32_t nrf_kmu_src_get ( NRF_KMU_Type const *  p_reg)

Function for getting the source address for provisioning.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Source address.

◆ nrf_kmu_src_set()

NRF_STATIC_INLINE void nrf_kmu_src_set ( NRF_KMU_Type *  p_reg,
uint32_t  src 
)

Function for setting the source address for provisioning.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]srcSource address to be set.

◆ nrf_kmu_status_get()

NRF_STATIC_INLINE uint32_t nrf_kmu_status_get ( NRF_KMU_Type const *  p_reg)

Function for getting status bits of the KMU operation.

Please use nrf_kmu_status_t to check operations status.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Operation status.

◆ nrf_kmu_task_address_get()

NRF_STATIC_INLINE uint32_t nrf_kmu_task_address_get ( NRF_KMU_Type const *  p_reg,
nrf_kmu_task_t  task 
)

Function for getting the address of a specific KMU task register.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskRequested task.
Returns
Address of the specified task register.

◆ nrf_kmu_task_trigger()

NRF_STATIC_INLINE void nrf_kmu_task_trigger ( NRF_KMU_Type *  p_reg,
nrf_kmu_task_t  task 
)

Function for activating a specific KMU task.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskTask to be activated.

Documentation feedback | Developer Zone | Subscribe | Updated