VPR CLIC HAL

group nrf_vpr_clic_hal

Hardware access layer for managing the VPR RISC-V CPU Interrupt Controller (VPR CLIC).

Defines

NRF_VPR_CLIC_IRQ_COUNT

Interrupts count.

NRF_VPR_CLIC_INT_TO_PRIO(x)

Macro for converting integer priority level to nrf_vpr_clic_priority_t.

Enums

enum nrf_vpr_clic_mode_t

Interrupt privilege modes available.

Values:

enumerator NRF_VPR_CLIC_MODE_M

All interrupts are M-mode only.

enum nrf_vpr_clic_priority_t

Interrupt priority level.

Values:

enumerator NRF_VPR_CLIC_PRIORITY_LEVEL0

Priority level 0.

enumerator NRF_VPR_CLIC_PRIORITY_LEVEL1

Priority level 1.

enumerator NRF_VPR_CLIC_PRIORITY_LEVEL2

Priority level 2.

enumerator NRF_VPR_CLIC_PRIORITY_LEVEL3

Priority level 3.

enum nrf_vpr_clic_trigger_t

Interrupt trigger and polarity types.

Values:

enumerator NRF_VPR_CLIC_TRIGGER_EDGE_POS

Interrupts are positive edge-triggered.

enum nrf_vpr_clic_priv_t

Interrupt privilege.

Values:

enumerator NRF_VPR_CLIC_PRIV_MACHINE

Machine mode.

Functions

NRF_STATIC_INLINE void nrf_vpr_clic_config_get(NRF_CLIC_Type const *p_reg, nrf_vpr_clic_config_t *p_config)

Function for getting the CLIC configuration.

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

  • p_config[out] Pointer to the VPR CLIC configuration structure.

NRF_STATIC_INLINE void nrf_vpr_clic_info_get(NRF_CLIC_Type const *p_reg, nrf_vpr_clic_info_t *p_info)

Function for getting the CLIC information.

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

  • p_info[out] Pointer to the VPR CLIC information structure.

NRF_STATIC_INLINE void nrf_vpr_clic_int_pending_set(NRF_CLIC_Type *p_reg, uint32_t irq_num)

Function for setting the specified interrupt to be pending.

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

  • irq_num[in] Number of interrupt to be triggered.

NRF_STATIC_INLINE void nrf_vpr_clic_int_pending_clear(NRF_CLIC_Type *p_reg, uint32_t irq_num)

Function for clearing the pending status for the specified interrupt.

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

  • irq_num[in] Number of interrupt to be cleared.

NRF_STATIC_INLINE bool nrf_vpr_clic_int_pending_check(NRF_CLIC_Type const *p_reg, uint32_t irq_num)

Function for checking if the specified interrupt is pending.

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

  • irq_num[in] Number of interrupt to be checked.

Return values:
  • true – Interrupt is pending.

  • false – Interrupt is not pending.

NRF_STATIC_INLINE void nrf_vpr_clic_int_enable_set(NRF_CLIC_Type *p_reg, uint32_t irq_num, bool enable)

Function for enabling or disabling the specified interrupt.

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

  • irq_num[in] Number of interrupt to be enabled or disabled.

  • enable[in] True if interrupt is to be enabled, false otherwise.

NRF_STATIC_INLINE bool nrf_vpr_clic_int_enable_check(NRF_CLIC_Type const *p_reg, uint32_t irq_num)

Function for checking if the specified interrupt is enabled.

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

  • irq_num[in] Number of interrupt to be checked.

Return values:
  • true – Interrupt is enabled.

  • false – Interrupt is disabled.

NRF_STATIC_INLINE void nrf_vpr_clic_int_priority_set(NRF_CLIC_Type *p_reg, uint32_t irq_num, nrf_vpr_clic_priority_t priority)

Function for setting the priority of the specified interrupt.

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

  • irq_num[in] Number of interrupt.

  • priority[in] Priority to be set.

NRF_STATIC_INLINE nrf_vpr_clic_priority_t nrf_vpr_clic_int_priority_get(NRF_CLIC_Type const *p_reg, uint32_t irq_num)

Function for getting the priority of the specified interrupt.

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

  • irq_num[in] Number of interrupt.

Returns:

Priority of the specified interrupt.

NRF_STATIC_INLINE void nrf_vpr_clic_int_attr_get(NRF_CLIC_Type const *p_reg, uint32_t irq_num, nrf_vpr_clic_attr_t *p_attr)

Function for getting the CLIC attributes.

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

  • irq_num[in] Number of interrupt.

  • p_attr[out] Pointer to the structure to be filled with VPR CLIC attributes.

struct nrf_vpr_clic_config_t
#include <nrf_vpr_clic.h>

VPR CLIC configuration structure.

Public Members

bool hw_vectoring

Selective interrupt hardware vectoring.

uint8_t level_encoding

Interrupt level encoding.

nrf_vpr_clic_mode_t privilege_mode

Interrupt privilege mode.

struct nrf_vpr_clic_info_t
#include <nrf_vpr_clic.h>

VPR CLIC information structure.

Public Members

uint16_t interrupt_count

Maximum number of interrupts supported.

uint8_t version

Version of CLIC.

uint8_t trigger_count

Number of maximum interrupt triggers supported.

struct nrf_vpr_clic_attr_t
#include <nrf_vpr_clic.h>

Interrupt attributes structure.

Public Members

bool hw_vectoring

Selective interrupt hardware vectoring.

nrf_vpr_clic_trigger_t trigger

Trigger type and polarity for the interrupt.

nrf_vpr_clic_priv_t privilege

Privilege mode.