你的理解相当正确,这个就是中断使能位。你可以在头文件里面看见ENABLE和DISABLE分别都是有define的
4.NVIC_IRQChannelCmd:中断使能/失能设置,使能配置为 ENABLE,失能配置为 DISABLE。2021-11-25 10:54...
u8 subPriority){// 1.这里是配置允许定时器中断NVIC_InitTypeDef NVIC_Initstructure;//第一个参数指定具体是那种中断,定时器3(TIM3就是) TIM3_TRQn,例如串口1是USART1_IRQnNVIC_Initstructure.NVIC_IRQChannel=TIM3_IRQn;//设置为定时器3中断NVIC_Initstructure.NVIC_IRQChannelCmd=ENABLE;//中断使能/...
NVIC_InitTypeDef NVIC_InitStructure;NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQn;// 37 串口1中断NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority=1;// 抢占优先级为1NVIC_InitStructure.NVIC_IRQChannelSubPriority = 2;//响应优先级为2NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;//IRQ通道使能NVIC_In...
in NVIC_IRQChannel. This parameter can be a value between 0 and 15 as described in the table @ref NVIC_Priority_Table */ FunctionalState NVIC_IRQChannelCmd;/*!< Specifies whether the IRQ channel defined in NVIC_IRQChannel will be enabled or disabled. ...
(2)选择,配置,并使能中断 NVIC_InitStructure.NVIC_IRQChannel = EXTI2_IRQn; //选择EXTI2中断 NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x02; //抢占优先级为2 NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x02; //响应优先级为2 NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; //使能EXTI...
NVIC_IRQChannel = USART1_IRQn;NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority=3 ;//抢占优先级3 NVIC_InitStructure.NVIC_IRQChannelSubPriority = 3;//子优先级3 NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;//IRQ通道使能 NVIC_Init(&NVIC_InitStructure);//根据指定的参数初始化VIC寄存器 ...
NVIC_IRQChannel = EXTI0_IRQn表示中断源为EXTI0 // NVIC_IRQChannelPreemptionPriority = 0x0F表示抢占优先级最低 // NVIC_IRQChannelSubPriority = 0x0F表示子优先级最低 // NVIC_IRQChannelCmd = ENABLE表示使能该中断 NVIC_InitTypeDef NVIC_InitStructure; NVIC_InitStructure.NVIC_IRQChannel = EXTI0_IRQn; ...
_IRQChannelCmd));assert_param(IS_NVIC_IRQ_CHANNEL(NVIC_InitStruct->NVIC_IRQChannel));assert_param(IS_NVIC_PREEMPTION_PRIORITY(NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority));assert_param(IS_NVIC_SUB_PRIORITY(NVIC_InitStruct->NVIC_IRQChannelSubPriority));if(NVIC_InitStruct->NVIC_IRQChannelCmd!=...