PM0215
4.2.8
NVIC design hints and tips
Ensure software uses correctly aligned register accesses. The processor does not support
unaligned accesses to NVIC registers. See the individual register descriptions for the
supported access sizes.
An interrupt can enter pending state even it is disabled. Disabling an interrupt only prevents
the processor from taking that interrupt.
NVIC programming hints
Software uses the CPSIE I and CPSID I instructions to enable and disable interrupts. The
CMSIS provides the following intrinsic functions for these instructions:
void __disable_irq(void) // Disable Interrupts
void __enable_irq(void) // Enable Interrupts
In addition, the CMSIS provides a number of functions for NVIC control, including:
Table 28.
void NVIC_EnableIRQ(IRQn_t IRQn)
void NVIC_DisableIRQ(IRQn_t IRQn)
uint32_t NVIC_GetPendingIRQ (IRQn_t IRQn)
void NVIC_SetPendingIRQ (IRQn_t IRQn)
void NVIC_ClearPendingIRQ (IRQn_t IRQn)
void NVIC_SetPriority (IRQn_t IRQn, uint32_t priority)
uint32_t NVIC_GetPriority (IRQn_t IRQn)
void NVIC_SystemReset (void)
The input parameter IRQn is the IRQ number, see
exception types on page
documentation.
CMSIS functions for NVIC control
CMSIS interrupt control function
23. For more information about these functions see the CMSIS
Doc ID 022979 Rev 1
Description
Enable IRQn
Disable IRQn
Return true (1) if IRQn is pending
Set IRQn pending
Clear IRQn pending status
Set priority for IRQn
Read priority of IRQn
Reset the system
Table 12: Properties of the different
Core peripherals
75/91
Need help?
Do you have a question about the STM32F0 Series and is the answer not in the manual?
Questions and answers