zoukankan      html  css  js  c++  java
  • 2018-7-18 STM32 开发基础

    2018-7-18 STM32 开发基础

    NVIC中断优先级管理

    首先给出MDK中与NVIC有关的寄存器定义的结构体:

    typedef struct
    {
      __IO uint32_t ISER[8]; //中断使能寄存器组,8*24=256个中断—》对应256个内核。对于stm32只需要使用ISER[0]与ISER[1]控制那60个中断即可                     /*!< Offset: 0x000  Interrupt Set Enable Register           */
           uint32_t RESERVED0[24];                                   
      __IO uint32_t ICER[8];//中断除能寄存器组,与ISER想反,清楚中断的使能。/*!< Offset: 0x080  Interrupt Clear Enable Register         */
           uint32_t RSERVED1[24];                                    
      __IO uint32_t ISPR[8];//中断挂起寄存器组,通过置1将正在进行的中断挂起,实现同级或更高级的中断 
      /*!< Offset: 0x100  Interrupt Set Pending Register          */
           uint32_t RESERVED2[24];                                   
      __IO uint32_t ICPR[8];  //中断解挂寄存器组                    /*!< Offset: 0x180  Interrupt Clear Pending Register        */
           uint32_t RESERVED3[24];                                   
      __IO uint32_t IABR[8]; //中断激活标志位寄存器组,只读寄存器,为1表示中断正在被执行 
      /*!< Offset: 0x200  Interrupt Active bit Register           */
           uint32_t RESERVED4[56];                                   
      __IO uint8_t  IP[240];//中断优先级控制寄存器组                      /*!< Offset: 0x300  Interrupt Priority Register (8Bit wide) */
           uint32_t RESERVED5[644];                                  
      __O  uint32_t STIR;                         /*!< Offset: 0xE00  Software Trigger Interrupt Register     */
    }  NVIC_Type; 

    对NVIC的优先级的说明

    优先级分为两类,抢占优先级和响应优先级。其中抢占优先级比响应优先级优先。优先级中数字较小的优先。
    且抢占优先级高的可以打断比之低的抢占优先级的中断,但是对于响应优先级却不能如此。
    enter description here

  • 相关阅读:
    Using X++ code Hided to Main Content Panel Frame
    Call a method on caller form
    Infolog in the Dynamics AX 2009
    Using X++ code Customizations to statusLine
    Using X++ Code force Synchronisation DataBase
    英语口语精选100句(转)
    OpenPrinter_1: rc:0 lastError:1801(0x709) The printer name is invalid
    30岁前不要去在乎的29件事(转)
    安全措施挡出黑客攻击
    接口的实便
  • 原文地址:https://www.cnblogs.com/liangzid/p/10910051.html
Copyright © 2011-2022 走看看