二、中断向量配置结构体 NVIC_InitTypeDef
作用: NVIC Init Structure definition.
参数成员:
uint8_t NVIC_IRQChannel
FunctionalState NVIC_IRQChannelCmd
uint8_t NVIC_IRQChannelPreemptionPriority
uint8_t NVIC_IRQChannelSubPriority
1、NVIC_IRQChannel
Specifies the IRQ channel to be enabled or disabled. This parameter can be a value of IRQn_Type
它的取值有
00170 NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
00171 MemoryManagement_IRQn = -12, /*!< 4 Cortex-M3 Memory Management Interrupt */
00172 BusFault_IRQn = -11, /*!< 5 Cortex-M3 Bus Fault Interrupt */
00173 UsageFault_IRQn = -10, /*!< 6 Cortex-M3 Usage Fault Interrupt */
00174 SVCall_IRQn = -5, /*!< 11 Cortex-M3 SV Call Interrupt */
00175 DebugMonitor_IRQn = -4, /*!< 12 Cortex-M3 Debug Monitor Interrupt */
00176 PendSV_IRQn = -2, /*!< 14 Cortex-M3 Pend SV Interrupt */
00177 SysTick_IRQn = -1, /*!< 15 Cortex-M3 System Tick Interrupt */
00178
00179 /****** STM32 specific Interrupt Numbers *********************************************************/
00180 WWDG_IRQn = 0, /*!< Window WatchDog Interrupt */
00181 PVD_IRQn = 1, /*!< PVD through EXTI Line detection Interrupt */
00182 TAMPER_IRQn = 2, /*!< Tamper Interrupt */
00183 RTC_IRQn = 3, /*!< RTC global Interrupt */
00184 FLASH_IRQn = 4, /*!< FLASH global Interrupt */
00185 RCC_IRQn = 5, /*!< RCC global Interrupt */
00186 EXTI0_IRQn = 6, /*!< EXTI Line0 Interrupt */
00187 EXTI1_IRQn = 7, /*!< EXTI Line1 Interrupt */
00188 EXTI2_IRQn = 8, /*!< EXTI Line2 Interrupt */
00189 EXTI3_IRQn = 9, /*!< EXTI Line3 Interrupt */
00190 EXTI4_IRQn = 10, /*!< EXTI Line4 Interrupt */
00191 DMA1_Channel1_IRQn = 11, /*!< DMA1 Channel 1 global Interrupt */
00192 DMA1_Channel2_IRQn = 12, /*!< DMA1 Channel 2 global Interrupt */
00193 DMA1_Channel3_IRQn = 13, /*!< DMA1 Channel 3 global Interrupt */
00194 DMA1_Channel4_IRQn = 14, /*!< DMA1 Channel 4 global Interrupt */
00195 DMA1_Channel5_IRQn = 15, /*!< DMA1 Channel 5 global Interrupt */
00196 DMA1_Channel6_IRQn = 16, /*!< DMA1 Channel 6 global Interrupt */
00197 DMA1_Channel7_IRQn = 17, /*!< DMA1 Channel 7 global Interrupt
对于我的片子还有
00297 #ifdef STM32F10X_HD
00298 ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
00299 USB_HP_CAN1_TX_IRQn = 19, /*!< USB Device High Priority or CAN1 TX Interrupts */
00300 USB_LP_CAN1_RX0_IRQn = 20, /*!< USB Device Low Priority or CAN1 RX0 Interrupts */
00301 CAN1_RX1_IRQn = 21, /*!< CAN1 RX1 Interrupt */
00302 CAN1_SCE_IRQn = 22, /*!< CAN1 SCE Interrupt */
00303 EXTI9_5_IRQn = 23, /*!< External Line[9:5] Interrupts */
00304 TIM1_BRK_IRQn = 24, /*!< TIM1 Break Interrupt */
00305 TIM1_UP_IRQn = 25, /*!< TIM1 Update Interrupt */
00306 TIM1_TRG_COM_IRQn = 26, /*!< TIM1 Trigger and Commutation Interrupt */
00307 TIM1_CC_IRQn = 27, /*!< TIM1 Capture Compare Interrupt */
00308 TIM2_IRQn = 28, /*!< TIM2 global Interrupt */
00309 TIM3_IRQn = 29, /*!< TIM3 global Interrupt */
00310 TIM4_IRQn = 30, /*!< TIM4 global Interrupt */
00311 I2C1_EV_IRQn = 31, /*!< I2C1 Event Interrupt */
00312 I2C1_ER_IRQn = 32, /*!< I2C1 Error Interrupt */
00313 I2C2_EV_IRQn = 33, /*!< I2C2 Event Interrupt */
00314 I2C2_ER_IRQn = 34, /*!< I2C2 Error Interrupt */
00315 SPI1_IRQn = 35, /*!< SPI1 global Interrupt */
00316 SPI2_IRQn = 36, /*!< SPI2 global Interrupt */
00317 USART1_IRQn = 37, /*!< USART1 global Interrupt */
00318 USART2_IRQn = 38, /*!< USART2 global Interrupt */
00319 USART3_IRQn = 39, /*!< USART3 global Interrupt */
00320 EXTI15_10_IRQn = 40, /*!< External Line[15:10] Interrupts */
00321 RTCAlarm_IRQn = 41, /*!< RTC Alarm through EXTI Line Interrupt */
00322 USBWakeUp_IRQn = 42, /*!< USB Device WakeUp from suspend through EXTI Line Interrupt */
00323 TIM8_BRK_IRQn = 43, /*!< TIM8 Break Interrupt */
00324 TIM8_UP_IRQn = 44, /*!< TIM8 Update Interrupt */
00325 TIM8_TRG_COM_IRQn = 45, /*!< TIM8 Trigger and Commutation Interrupt */
00326 TIM8_CC_IRQn = 46, /*!< TIM8 Capture Compare Interrupt */
00327 ADC3_IRQn = 47, /*!< ADC3 global Interrupt */
00328 FSMC_IRQn = 48, /*!< FSMC global Interrupt */
00329 SDIO_IRQn = 49, /*!< SDIO global Interrupt */
00330 TIM5_IRQn = 50, /*!< TIM5 global Interrupt */
00331 SPI3_IRQn = 51, /*!< SPI3 global Interrupt */
00332 UART4_IRQn = 52, /*!< UART4 global Interrupt */
00333 UART5_IRQn = 53, /*!< UART5 global Interrupt */
00334 TIM6_IRQn = 54, /*!< TIM6 global Interrupt */
00335 TIM7_IRQn = 55, /*!< TIM7 global Interrupt */
00336 DMA2_Channel1_IRQn = 56, /*!< DMA2 Channel 1 global Interrupt */
00337 DMA2_Channel2_IRQn = 57, /*!< DMA2 Channel 2 global Interrupt */
00338 DMA2_Channel3_IRQn = 58, /*!< DMA2 Channel 3 global Interrupt */
00339 DMA2_Channel4_5_IRQn = 59 /*!< DMA2 Channel 4 and Channel 5 global Interrupt */
00340 #endif /* STM32F10X_HD */
2、第二个参数NVIC_IRQChannelCmd
作用:Specifies whether the IRQ channel defined in NVIC_IRQChannel will be enabled or disabled.
This parameter can be set either to ENABLE or DISABLE
3、第三个参数 IRQChannelPreemptionPriority
Specifies the pre-emption priority for the IRQ channel specified in NVIC_IRQChannel.
This parameter can be a value between 0 and 15
4、第四个参数 uint8_t NVIC_IRQChannelSubPriority
Specifies the pre-emption priority for the IRQ channel specified in NVIC_IRQChannel.
This parameter can be a value between 0 and 15
|