• 已解决 73482 个问题
  • 已帮助 5993 位优秀工程师

NVIC_Configuration(); 这个函数作用?

huihui163 2017-09-22 浏览量:10580

NVIC_Configuration(); 这个函数作用?

void NVIC_Configuration(void)
{

    NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2); 
}
具体对中断优先级设置​?

-1 0 收起

我来回答

上传资料:
选择文件 文件大小不超过15M(格式支持:doc、ppt、xls、pdf、zip、rar、txt)
最佳答案
huihui163 回复了 mr_liu:在定时器中//ÖжÏÓÅÏȼ¶NVICÉèÖà NVIC_InitStructure.NVIC_IRQChannel = TIM3_IRQn; //TIM3ÖÐ¶Ï NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; //ÏÈÕ¼ÓÅÏȼ¶0¼¶ NVIC_InitStructure.NVIC_IRQChannelSubPriority = 3; //´ÓÓÅÏȼ¶3¼¶ NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; //IRQͨµÀ±»Ê¹ÄÜ NVIC_Init(&NVIC_InitStructure); //³õʼ»¯NVIC¼Ä´æÆ÷ 回复
huihui163 回复了 mr_liu:已经配置中断了,这个函数还有啥作用 回复
mr_liu 回复了 huihui163:NVIC_PriorityGroupConfig()这个决定了有几个先占优先级和从优先级。就比如你设置的NVIC_PriorityGroup_2,先占优先级和从优先级都是2位,那么你配置中断的时候先占优先级和从优先级分别可以配制成0-3,0-3;若是第一组先占优先级1位从优先级3位那么先占优先级的设置是0-1从优先级设置为0-7;其他同理 回复
huihui163 回复了 mr_liu:明白了 回复

其他答案 数量:7
  • 作用就是设置中断管理器,设置了优先级分组。

    这样同时有中断响应的时候知道先响应哪个中断。

    • 发布于2017-09-22
    • 举报
    • 评论 0
    • 1
    • 0

  • 这个函数是配置中断优先级的,
    • 发布于2017-09-22
    • 举报
    • 评论 0
    • 0
    • 0

  • 带NVIC的一般是中断优先级的东西,Configuration就是配置的意思嘛。NVIC_PriorityGroupConfig​里面有个Group,优先级分组。优先级有不同组别,​里面可以设置中断抢占和优先级
    • 发布于2017-09-22
    • 举报
    • 评论 0
    • 0
    • 0

huihui163 回复了 lygo :谢谢您 回复
lygo 回复了 lygo :额 没事哒 我只是资料的搬运者。。 回复

  • 应该是配置中断向量的函数。要有一个表,把所有的中断者列出来。
    • 发布于2017-09-22
    • 举报
    • 评论 0
    • 0
    • 0

  • /**
      * @brief  Sets the priority grouping field (preemption priority and subpriority)
      *         using the required unlock sequence.
      * @param  PriorityGroup: The priority grouping bits length. 
      *         This parameter can be one of the following values:
      *         @arg NVIC_PRIORITYGROUP_0: 0 bits for preemption priority
      *                                    4 bits for subpriority
      *         @arg NVIC_PRIORITYGROUP_1: 1 bits for preemption priority
      *                                    3 bits for subpriority
      *         @arg NVIC_PRIORITYGROUP_2: 2 bits for preemption priority
      *                                    2 bits for subpriority
      *         @arg NVIC_PRIORITYGROUP_3: 3 bits for preemption priority
      *                                    1 bits for subpriority
      *         @arg NVIC_PRIORITYGROUP_4: 4 bits for preemption priority
      *                                    0 bits for subpriority
      * @note   When the NVIC_PriorityGroup_0 is selected, IRQ preemption is no more possible. 
      *         The pending IRQ priority will be managed only by the subpriority. 
      * @retval None
      */
    void HAL_NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
    {
      /* Check the parameters */
      assert_param(IS_NVIC_PRIORITY_GROUP(PriorityGroup));
      
      /* Set the PRIGROUP[10:8] bits according to the PriorityGroup parameter value */
      NVIC_SetPriorityGrouping(PriorityGroup);
    }
    

    主要是配置主和副的優先級總數分配,主又比副還高優先權


    • 发布于2017-09-23
    • 举报
    • 评论 0
    • 0
    • 0

相关问题

问题达人换一批

NVIC_Configuration(); 这个函数作用?