Contiki-NG
Functions

Functions that manage interrupts and exceptions via the NVIC. More...

Functions

__STATIC_INLINE uint32_t NVIC_IsIRQEnabled (IRQn_Type IRQn)
 Get External Interrupt Enable State. More...
 
__STATIC_INLINE void NVIC_EnableIRQ (IRQn_Type IRQn)
 Enable External Interrupt. More...
 
__STATIC_INLINE void NVIC_DisableIRQ (IRQn_Type IRQn)
 Disable External Interrupt. More...
 
__STATIC_INLINE uint32_t NVIC_GetPendingIRQ (IRQn_Type IRQn)
 Get Pending Interrupt. More...
 
__STATIC_INLINE void NVIC_SetPendingIRQ (IRQn_Type IRQn)
 Set Pending Interrupt. More...
 
__STATIC_INLINE void NVIC_ClearPendingIRQ (IRQn_Type IRQn)
 Clear Pending Interrupt. More...
 
__STATIC_INLINE void NVIC_SetPriority (IRQn_Type IRQn, uint32_t priority)
 Set Interrupt Priority. More...
 
__STATIC_INLINE uint32_t NVIC_GetPriority (IRQn_Type IRQn)
 Get Interrupt Priority. More...
 
__STATIC_INLINE void NVIC_SystemReset (void)
 System Reset. More...
 
__STATIC_INLINE void NVIC_SetPriorityGrouping (uint32_t PriorityGroup)
 Set Priority Grouping. More...
 
__STATIC_INLINE uint32_t NVIC_GetPriorityGrouping (void)
 Get Priority Grouping. More...
 
__STATIC_INLINE uint32_t NVIC_GetActive (IRQn_Type IRQn)
 Get Active Interrupt. More...
 
__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
 Encode Priority. More...
 
__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t *const pPreemptPriority, uint32_t *const pSubPriority)
 Decode Priority. More...
 

Detailed Description

Functions that manage interrupts and exceptions via the NVIC.

Function Documentation

◆ NVIC_ClearPendingIRQ()

__STATIC_INLINE void NVIC_ClearPendingIRQ ( IRQn_Type  IRQn)

Clear Pending Interrupt.

Clears the pending bit of an external interrupt.

Parameters
[in]IRQnExternal interrupt number. Value cannot be negative.

Definition at line 688 of file core_cm0.h.

References NVIC.

Referenced by crypto_isr(), NVIC_GetPriorityGrouping(), and pka_isr().

◆ NVIC_DecodePriority()

__STATIC_INLINE void NVIC_DecodePriority ( uint32_t  Priority,
uint32_t  PriorityGroup,
uint32_t *const  pPreemptPriority,
uint32_t *const  pSubPriority 
)

Decode Priority.

Decodes an interrupt priority value with a given priority group to preemptive priority value and subpriority value. In case of a conflict between priority grouping and available priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.

Parameters
[in]PriorityPriority value, which can be retrieved with the function NVIC_GetPriority().
[in]PriorityGroupUsed priority group.
[out]pPreemptPriorityPreemptive priority value (starting from 0).
[out]pSubPrioritySubpriority value (starting from 0).

Definition at line 1611 of file core_cm3.h.

References __DSB(), __NOP(), __NVIC_PRIO_BITS, NVIC_SystemReset(), SCB, SCB_AIRCR_PRIGROUP_Msk, SCB_AIRCR_SYSRESETREQ_Msk, SCB_AIRCR_VECTKEY_Pos, and SysTick_Config().

◆ NVIC_DisableIRQ()

__STATIC_INLINE void NVIC_DisableIRQ ( IRQn_Type  IRQn)

Disable External Interrupt.

Disables a device-specific interrupt in the NVIC interrupt controller.

Parameters
[in]IRQnExternal interrupt number. Value cannot be negative.

Definition at line 653 of file core_cm0.h.

References NVIC.

Referenced by crypto_isr(), NVIC_GetPriorityGrouping(), and pka_isr().

◆ NVIC_EnableIRQ()

__STATIC_INLINE void NVIC_EnableIRQ ( IRQn_Type  IRQn)

Enable External Interrupt.

Enables a device-specific interrupt in the NVIC interrupt controller.

Parameters
[in]IRQnExternal interrupt number. Value cannot be negative.

Definition at line 642 of file core_cm0.h.

References NVIC.

Referenced by NVIC_GetPriorityGrouping().

◆ NVIC_EncodePriority()

__STATIC_INLINE uint32_t NVIC_EncodePriority ( uint32_t  PriorityGroup,
uint32_t  PreemptPriority,
uint32_t  SubPriority 
)

Encode Priority.

Encodes the priority for an interrupt with the given priority group, preemptive priority value, and subpriority value. In case of a conflict between priority grouping and available priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.

Parameters
[in]PriorityGroupUsed priority group.
[in]PreemptPriorityPreemptive priority value (starting from 0).
[in]SubPrioritySubpriority value (starting from 0).
Returns
Encoded priority. Value can be used in the function NVIC_SetPriority().

Definition at line 1584 of file core_cm3.h.

References __NVIC_PRIO_BITS.

◆ NVIC_GetActive()

__STATIC_INLINE uint32_t NVIC_GetActive ( IRQn_Type  IRQn)

Get Active Interrupt.

Reads the active register in NVIC and returns the active bit.

Parameters
[in]IRQnInterrupt number.
Returns
0 Interrupt status is not active.
1 Interrupt status is active.

Definition at line 1524 of file core_cm3.h.

References __NVIC_PRIO_BITS, NVIC, NVIC_GetPriority(), NVIC_SetPriority(), and SCB.

◆ NVIC_GetPendingIRQ()

__STATIC_INLINE uint32_t NVIC_GetPendingIRQ ( IRQn_Type  IRQn)

Get Pending Interrupt.

Reads the pending register in the NVIC and returns the pending bit for the specified interrupt.

Parameters
[in]IRQnInterrupt number.
Returns
0 Interrupt status is not pending.
1 Interrupt status is pending.

Definition at line 666 of file core_cm0.h.

References NVIC.

Referenced by NVIC_GetPriorityGrouping().

◆ NVIC_GetPriority()

__STATIC_INLINE uint32_t NVIC_GetPriority ( IRQn_Type  IRQn)

Get Interrupt Priority.

Reads the priority of an interrupt. The interrupt number can be positive to specify an external (device specific) interrupt, or negative to specify an internal (core) interrupt.

Parameters
[in]IRQnInterrupt number.
Returns
Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller.

Definition at line 725 of file core_cm0.h.

References SCB.

Referenced by NVIC_GetActive().

◆ NVIC_GetPriorityGrouping()

__STATIC_INLINE uint32_t NVIC_GetPriorityGrouping ( void  )

Get Priority Grouping.

Reads the priority grouping field from the NVIC Interrupt Controller.

Returns
Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field).

Definition at line 1441 of file core_cm3.h.

References NVIC, NVIC_ClearPendingIRQ(), NVIC_DisableIRQ(), NVIC_EnableIRQ(), NVIC_GetPendingIRQ(), NVIC_IsIRQEnabled(), NVIC_SetPendingIRQ(), SCB, SCB_AIRCR_PRIGROUP_Msk, and SCB_AIRCR_PRIGROUP_Pos.

◆ NVIC_IsIRQEnabled()

__STATIC_INLINE uint32_t NVIC_IsIRQEnabled ( IRQn_Type  IRQn)

Get External Interrupt Enable State.

Returns whether a device-specific interrupt is enabled in the NVIC interrupt controller.

Parameters
[in]IRQnExternal interrupt number. Value cannot be negative.
Returns
0 Interrupt is disabled.
1 Interrupt is enabled.

Definition at line 631 of file core_cm0.h.

References NVIC.

Referenced by NVIC_GetPriorityGrouping().

◆ NVIC_SetPendingIRQ()

__STATIC_INLINE void NVIC_SetPendingIRQ ( IRQn_Type  IRQn)

Set Pending Interrupt.

Sets the pending bit of an external interrupt.

Parameters
[in]IRQnInterrupt number. Value cannot be negative.

Definition at line 677 of file core_cm0.h.

References NVIC.

Referenced by NVIC_GetPriorityGrouping().

◆ NVIC_SetPriority()

__STATIC_INLINE void NVIC_SetPriority ( IRQn_Type  IRQn,
uint32_t  priority 
)

Set Interrupt Priority.

Sets the priority of an interrupt.

Note
The priority cannot be set for every core interrupt.
Parameters
[in]IRQnInterrupt number.
[in]priorityPriority to set.

Definition at line 701 of file core_cm0.h.

References SCB.

Referenced by NVIC_GetActive().

◆ NVIC_SetPriorityGrouping()

__STATIC_INLINE void NVIC_SetPriorityGrouping ( uint32_t  PriorityGroup)

Set Priority Grouping.

Sets the priority grouping field using the required unlock sequence. The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. Only values from 0..7 are used. In case of a conflict between priority grouping and available priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.

Parameters
[in]PriorityGroupPriority grouping field.

Definition at line 1422 of file core_cm3.h.

References SCB, SCB_AIRCR_PRIGROUP_Msk, SCB_AIRCR_VECTKEY_Msk, and SCB_AIRCR_VECTKEY_Pos.

◆ NVIC_SystemReset()

__STATIC_INLINE void NVIC_SystemReset ( void  )

System Reset.

Initiates a system reset request to reset the MCU.

Definition at line 743 of file core_cm0.h.

References __DSB(), __NOP(), SCB, SCB_AIRCR_SYSRESETREQ_Msk, and SCB_AIRCR_VECTKEY_Pos.

Referenced by NVIC_DecodePriority(), and watchdog_reboot().