dragoon  4383
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
SoftDevice NVIC API

APIs for the accessing NVIC when using a SoftDevice. More...

Modules

 Defines
 
 Variables
 
 SoftDevice NVIC internal functions
 
 SoftDevice NVIC public functions
 

Functions

__STATIC_INLINE int __sd_nvic_irq_disable (void)
 Disables IRQ interrupts globally, including the SoftDevice's interrupts. More...
 
__STATIC_INLINE void __sd_nvic_irq_enable (void)
 Enables IRQ interrupts globally, including the SoftDevice's interrupts.
 
__STATIC_INLINE uint32_t __sd_nvic_app_accessible_irq (IRQn_Type IRQn)
 Checks if IRQn is available to application. More...
 
__STATIC_INLINE uint32_t __sd_nvic_is_app_accessible_priority (uint32_t priority)
 Checks if priority is available to application. More...
 
__STATIC_INLINE uint32_t sd_nvic_EnableIRQ (IRQn_Type IRQn)
 Enable External Interrupt. More...
 
__STATIC_INLINE uint32_t sd_nvic_DisableIRQ (IRQn_Type IRQn)
 Disable External Interrupt. More...
 
__STATIC_INLINE uint32_t sd_nvic_GetPendingIRQ (IRQn_Type IRQn, uint32_t *p_pending_irq)
 Get Pending Interrupt. More...
 
__STATIC_INLINE uint32_t sd_nvic_SetPendingIRQ (IRQn_Type IRQn)
 Set Pending Interrupt. More...
 
__STATIC_INLINE uint32_t sd_nvic_ClearPendingIRQ (IRQn_Type IRQn)
 Clear Pending Interrupt. More...
 
__STATIC_INLINE uint32_t sd_nvic_SetPriority (IRQn_Type IRQn, uint32_t priority)
 Set Interrupt Priority. More...
 
__STATIC_INLINE uint32_t sd_nvic_GetPriority (IRQn_Type IRQn, uint32_t *p_priority)
 Get Interrupt Priority. More...
 
__STATIC_INLINE uint32_t sd_nvic_SystemReset (void)
 System Reset. More...
 
__STATIC_INLINE uint32_t sd_nvic_critical_region_enter (uint8_t *p_is_nested_critical_region)
 Enter critical region. More...
 
__STATIC_INLINE uint32_t sd_nvic_critical_region_exit (uint8_t is_nested_critical_region)
 Exit critical region. More...
 

Detailed Description

APIs for the accessing NVIC when using a SoftDevice.

Note
In order to use this module, the following code has to be added to a .c file:
Definitions and declarations starting with __ (double underscore) in this header file are not intended for direct use by the application.

Function Documentation

__STATIC_INLINE uint32_t __sd_nvic_app_accessible_irq ( IRQn_Type  IRQn)

Checks if IRQn is available to application.

Parameters
[in]IRQnIRQ to check
Return values
1(true) if the IRQ to check is available to the application

< The peripheral ID of the NVMC. IRQ numbers are used to identify peripherals, but the NVMC doesn't have an IRQ number in the MDK.

Definition at line 289 of file nrf_nvic.h.

References __NRF_NVIC_APP_IRQS_0, and __NRF_NVIC_APP_IRQS_1.

Referenced by sd_nvic_ClearPendingIRQ(), sd_nvic_DisableIRQ(), sd_nvic_EnableIRQ(), sd_nvic_GetPendingIRQ(), sd_nvic_GetPriority(), sd_nvic_SetPendingIRQ(), and sd_nvic_SetPriority().

__STATIC_INLINE int __sd_nvic_irq_disable ( void  )

Disables IRQ interrupts globally, including the SoftDevice's interrupts.

Return values
Thevalue of PRIMASK prior to disabling the interrupts.

Definition at line 277 of file nrf_nvic.h.

Referenced by sd_nvic_critical_region_enter(), and sd_nvic_critical_region_exit().

__STATIC_INLINE uint32_t __sd_nvic_is_app_accessible_priority ( uint32_t  priority)

Checks if priority is available to application.

Parameters
[in]prioritypriority to check
Return values
1(true) if the priority to check is available to the application

Definition at line 305 of file nrf_nvic.h.

Referenced by sd_nvic_EnableIRQ(), and sd_nvic_SetPriority().

__STATIC_INLINE uint32_t sd_nvic_ClearPendingIRQ ( IRQn_Type  IRQn)

Clear Pending Interrupt.

Note
Corresponds to NVIC_ClearPendingIRQ in CMSIS.
Precondition
IRQn is valid and not reserved by the stack.
Parameters
[in]IRQnSee the NVIC_ClearPendingIRQ documentation in CMSIS.
Return values
NRF_SUCCESSThe interrupt pending flag is cleared.
NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLEIRQn is not available for the application.

Definition at line 389 of file nrf_nvic.h.

References __sd_nvic_app_accessible_irq(), NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE, and NRF_SUCCESS.

__STATIC_INLINE uint32_t sd_nvic_critical_region_enter ( uint8_t *  p_is_nested_critical_region)

Enter critical region.

Postcondition
Application interrupts will be disabled.
Note
sd_nvic_critical_region_enter() and sd_nvic_critical_region_exit() must be called in matching pairs inside each execution context
See Also
sd_nvic_critical_region_exit
Parameters
[out]p_is_nested_critical_regionIf 1, the application is now in a nested critical region.
Return values
NRF_SUCCESS

< The peripheral ID of the NVMC. IRQ numbers are used to identify peripherals, but the NVMC doesn't have an IRQ number in the MDK.

< The peripheral ID of the NVMC. IRQ numbers are used to identify peripherals, but the NVMC doesn't have an IRQ number in the MDK.

Definition at line 437 of file nrf_nvic.h.

References nrf_nvic_state_t::__cr_flag, nrf_nvic_state_t::__irq_masks, __NRF_NVIC_APP_IRQS_0, __NRF_NVIC_APP_IRQS_1, __sd_nvic_irq_disable(), __sd_nvic_irq_enable(), and NRF_SUCCESS.

__STATIC_INLINE uint32_t sd_nvic_critical_region_exit ( uint8_t  is_nested_critical_region)

Exit critical region.

Precondition
Application has entered a critical region using sd_nvic_critical_region_enter.
Postcondition
If not in a nested critical region, the application interrupts will restored to the state before sd_nvic_critical_region_enter was called.
Parameters
[in]is_nested_critical_regionIf this is set to 1, the critical region won't be exited.
See Also
sd_nvic_critical_region_enter.
Return values
NRF_SUCCESS

Definition at line 460 of file nrf_nvic.h.

References nrf_nvic_state_t::__cr_flag, nrf_nvic_state_t::__irq_masks, __sd_nvic_irq_disable(), __sd_nvic_irq_enable(), and NRF_SUCCESS.

__STATIC_INLINE uint32_t sd_nvic_DisableIRQ ( IRQn_Type  IRQn)

Disable External Interrupt.

Note
Corresponds to NVIC_DisableIRQ in CMSIS.
Precondition
IRQn is valid and not reserved by the stack.
Parameters
[in]IRQnSee the NVIC_DisableIRQ documentation in CMSIS.
Return values
NRF_SUCCESSThe interrupt was disabled.
NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLEThe interrupt is not available for the application.

Definition at line 344 of file nrf_nvic.h.

References nrf_nvic_state_t::__cr_flag, nrf_nvic_state_t::__irq_masks, __sd_nvic_app_accessible_irq(), NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE, and NRF_SUCCESS.

__STATIC_INLINE uint32_t sd_nvic_EnableIRQ ( IRQn_Type  IRQn)

Enable External Interrupt.

Note
Corresponds to NVIC_EnableIRQ in CMSIS.
Precondition
IRQn is valid and not reserved by the stack.
Parameters
[in]IRQnSee the NVIC_EnableIRQ documentation in CMSIS.
Return values
NRF_SUCCESSThe interrupt was enabled.
NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLEThe interrupt is not available for the application.
NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWEDThe interrupt has a priority not available for the application.

Definition at line 322 of file nrf_nvic.h.

References nrf_nvic_state_t::__cr_flag, nrf_nvic_state_t::__irq_masks, __sd_nvic_app_accessible_irq(), __sd_nvic_is_app_accessible_priority(), NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE, NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED, and NRF_SUCCESS.

__STATIC_INLINE uint32_t sd_nvic_GetPendingIRQ ( IRQn_Type  IRQn,
uint32_t *  p_pending_irq 
)

Get Pending Interrupt.

Note
Corresponds to NVIC_GetPendingIRQ in CMSIS.
Precondition
IRQn is valid and not reserved by the stack.
Parameters
[in]IRQnSee the NVIC_GetPendingIRQ documentation in CMSIS.
[out]p_pending_irqReturn value from NVIC_GetPendingIRQ.
Return values
NRF_SUCCESSThe interrupt is available for the application.
NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLEIRQn is not available for the application.

Definition at line 363 of file nrf_nvic.h.

References __sd_nvic_app_accessible_irq(), NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE, and NRF_SUCCESS.

__STATIC_INLINE uint32_t sd_nvic_GetPriority ( IRQn_Type  IRQn,
uint32_t *  p_priority 
)

Get Interrupt Priority.

Note
Corresponds to NVIC_GetPriority in CMSIS.
Precondition
IRQn is valid and not reserved by the stack.
Parameters
[in]IRQnSee the NVIC_GetPriority documentation in CMSIS.
[out]p_priorityReturn value from NVIC_GetPriority.
Return values
NRF_SUCCESSThe interrupt priority is returned in p_priority.
NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE- IRQn is not available for the application.

Definition at line 418 of file nrf_nvic.h.

References __sd_nvic_app_accessible_irq(), NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE, and NRF_SUCCESS.

__STATIC_INLINE uint32_t sd_nvic_SetPendingIRQ ( IRQn_Type  IRQn)

Set Pending Interrupt.

Note
Corresponds to NVIC_SetPendingIRQ in CMSIS.
Precondition
IRQn is valid and not reserved by the stack.
Parameters
[in]IRQnSee the NVIC_SetPendingIRQ documentation in CMSIS.
Return values
NRF_SUCCESSThe interrupt is set pending.
NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLEIRQn is not available for the application.

Definition at line 376 of file nrf_nvic.h.

References __sd_nvic_app_accessible_irq(), NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE, and NRF_SUCCESS.

__STATIC_INLINE uint32_t sd_nvic_SetPriority ( IRQn_Type  IRQn,
uint32_t  priority 
)

Set Interrupt Priority.

Note
Corresponds to NVIC_SetPriority in CMSIS.
Precondition
IRQn is valid and not reserved by the stack.
Priority is valid and not reserved by the stack.
Parameters
[in]IRQnSee the NVIC_SetPriority documentation in CMSIS.
[in]priorityA valid IRQ priority for use by the application.
Return values
NRF_SUCCESSThe interrupt and priority level is available for the application.
NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLEIRQn is not available for the application.
NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWEDThe interrupt priority is not available for the application.

Definition at line 402 of file nrf_nvic.h.

References __sd_nvic_app_accessible_irq(), __sd_nvic_is_app_accessible_priority(), NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE, NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED, and NRF_SUCCESS.

__STATIC_INLINE uint32_t sd_nvic_SystemReset ( void  )

System Reset.

Note
Corresponds to NVIC_SystemReset in CMSIS.
Return values
NRF_ERROR_SOC_NVIC_SHOULD_NOT_RETURN

Definition at line 431 of file nrf_nvic.h.

References NRF_ERROR_SOC_NVIC_SHOULD_NOT_RETURN.