Functions that manage interrupts and exceptions via the NVIC.
More...
Functions that manage interrupts and exceptions via the NVIC.
◆ NVIC_SetPriorityGrouping
◆ NVIC_GetPriorityGrouping
◆ NVIC_EnableIRQ
◆ NVIC_GetEnableIRQ
◆ NVIC_DisableIRQ
◆ NVIC_GetPendingIRQ
◆ NVIC_SetPendingIRQ
◆ NVIC_ClearPendingIRQ
◆ NVIC_GetActive
◆ NVIC_SetPriority
◆ NVIC_GetPriority
◆ NVIC_SystemReset
◆ NVIC_SetVector
◆ NVIC_GetVector
◆ NVIC_USER_IRQ_OFFSET
| #define NVIC_USER_IRQ_OFFSET 16 |
◆ EXC_RETURN_HANDLER
| #define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */ |
◆ EXC_RETURN_THREAD_MSP
| #define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */ |
◆ EXC_RETURN_THREAD_PSP
| #define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */ |
◆ EXC_RETURN_HANDLER_FPU
| #define EXC_RETURN_HANDLER_FPU (0xFFFFFFE1UL) /* return to Handler mode, uses MSP after return, restore floating-point state */ |
◆ EXC_RETURN_THREAD_MSP_FPU
| #define EXC_RETURN_THREAD_MSP_FPU (0xFFFFFFE9UL) /* return to Thread mode, uses MSP after return, restore floating-point state */ |
◆ EXC_RETURN_THREAD_PSP_FPU
| #define EXC_RETURN_THREAD_PSP_FPU (0xFFFFFFEDUL) /* return to Thread mode, uses PSP after return, restore floating-point state */ |
◆ __NVIC_SetPriorityGrouping()
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] | PriorityGroup | Priority grouping field. |
◆ __NVIC_GetPriorityGrouping()
Get Priority Grouping.
Reads the priority grouping field from the NVIC Interrupt Controller.
- Returns
- Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field).
◆ __NVIC_EnableIRQ()
Enable Interrupt.
Enables a device specific interrupt in the NVIC interrupt controller.
- Parameters
-
| [in] | IRQn | Device specific interrupt number. |
- Note
- IRQn must not be negative.
◆ __NVIC_GetEnableIRQ()
Get Interrupt Enable status.
Returns a device specific interrupt enable status from the NVIC interrupt controller.
- Parameters
-
| [in] | IRQn | Device specific interrupt number. |
- Returns
- 0 Interrupt is not enabled.
-
1 Interrupt is enabled.
- Note
- IRQn must not be negative.
◆ __NVIC_DisableIRQ()
Disable Interrupt.
Disables a device specific interrupt in the NVIC interrupt controller.
- Parameters
-
| [in] | IRQn | Device specific interrupt number. |
- Note
- IRQn must not be negative.
◆ __NVIC_GetPendingIRQ()
Get Pending Interrupt.
Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt.
- Parameters
-
| [in] | IRQn | Device specific interrupt number. |
- Returns
- 0 Interrupt status is not pending.
-
1 Interrupt status is pending.
- Note
- IRQn must not be negative.
◆ __NVIC_SetPendingIRQ()
Set Pending Interrupt.
Sets the pending bit of a device specific interrupt in the NVIC pending register.
- Parameters
-
| [in] | IRQn | Device specific interrupt number. |
- Note
- IRQn must not be negative.
◆ __NVIC_ClearPendingIRQ()
Clear Pending Interrupt.
Clears the pending bit of a device specific interrupt in the NVIC pending register.
- Parameters
-
| [in] | IRQn | Device specific interrupt number. |
- Note
- IRQn must not be negative.
◆ __NVIC_GetActive()
Get Active Interrupt.
Reads the active register in the NVIC and returns the active bit for the device specific interrupt.
- Parameters
-
| [in] | IRQn | Device specific interrupt number. |
- Returns
- 0 Interrupt status is not active.
-
1 Interrupt status is active.
- Note
- IRQn must not be negative.
◆ __NVIC_SetPriority()
Set Interrupt Priority.
Sets the priority of a device specific interrupt or a processor exception. The interrupt number can be positive to specify a device specific interrupt, or negative to specify a processor exception.
- Parameters
-
| [in] | IRQn | Interrupt number. |
| [in] | priority | Priority to set. |
- Note
- The priority cannot be set for every processor exception.
◆ __NVIC_GetPriority()
Get Interrupt Priority.
Reads the priority of a device specific interrupt or a processor exception. The interrupt number can be positive to specify a device specific interrupt, or negative to specify a processor exception.
- Parameters
-
| [in] | IRQn | Interrupt number. |
- Returns
- Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller.
◆ NVIC_EncodePriority()
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] | PriorityGroup | Used priority group. |
| [in] | PreemptPriority | Preemptive priority value (starting from 0). |
| [in] | SubPriority | Subpriority value (starting from 0). |
- Returns
- Encoded priority. Value can be used in the function NVIC_SetPriority().
◆ NVIC_DecodePriority()
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] | Priority | Priority value, which can be retrieved with the function NVIC_GetPriority(). |
| [in] | PriorityGroup | Used priority group. |
| [out] | pPreemptPriority | Preemptive priority value (starting from 0). |
| [out] | pSubPriority | Subpriority value (starting from 0). |
◆ __NVIC_SetVector()
Set Interrupt Vector.
Sets an interrupt vector in SRAM based interrupt vector table. The interrupt number can be positive to specify a device specific interrupt, or negative to specify a processor exception. VTOR must been relocated to SRAM before.
- Parameters
-
| [in] | IRQn | Interrupt number |
| [in] | vector | Address of interrupt handler function |
◆ __NVIC_GetVector()
Get Interrupt Vector.
Reads an interrupt vector from interrupt vector table. The interrupt number can be positive to specify a device specific interrupt, or negative to specify a processor exception.
- Parameters
-
| [in] | IRQn | Interrupt number. |
- Returns
- Address of interrupt handler function
◆ __NVIC_SystemReset()
System Reset.
Initiates a system reset request to reset the MCU.