亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? stm32f10x_nvic.c

?? 基于STM32的 模擬時序
?? C
?? 第 1 頁 / 共 2 頁
字號:
/******************** (C) COPYRIGHT 2008 STMicroelectronics ********************
* File Name          : stm32f10x_nvic.c
* Author             : MCD Application Team
* Version            : V2.0.2
* Date               : 07/11/2008
* Description        : This file provides all the NVIC firmware functions.
********************************************************************************
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
* CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*******************************************************************************/

/* Includes ------------------------------------------------------------------*/
#include "stm32f10x_nvic.h"

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
#define AIRCR_VECTKEY_MASK    ((u32)0x05FA0000)

/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/

/*******************************************************************************
* Function Name  : NVIC_DeInit
* Description    : Deinitializes the NVIC peripheral registers to their default
*                  reset values.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
void NVIC_DeInit(void)
{
  u32 index = 0;
  
  NVIC->ICER[0] = 0xFFFFFFFF;
  NVIC->ICER[1] = 0x0FFFFFFF;
  NVIC->ICPR[0] = 0xFFFFFFFF;
  NVIC->ICPR[1] = 0x0FFFFFFF;
  
  for(index = 0; index < 0x0F; index++)
  {
     NVIC->IPR[index] = 0x00000000;
  } 
}

/*******************************************************************************
* Function Name  : NVIC_SCBDeInit
* Description    : Deinitializes the SCB peripheral registers to their default 
*                  reset values.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
void NVIC_SCBDeInit(void)
{
  u32 index = 0x00;
  
  SCB->ICSR = 0x0A000000;
  SCB->VTOR = 0x00000000;
  SCB->AIRCR = AIRCR_VECTKEY_MASK;
  SCB->SCR = 0x00000000;
  SCB->CCR = 0x00000000;
  for(index = 0; index < 0x03; index++)
  {
     SCB->SHPR[index] = 0;
  }
  SCB->SHCSR = 0x00000000;
  SCB->CFSR = 0xFFFFFFFF;
  SCB->HFSR = 0xFFFFFFFF;
  SCB->DFSR = 0xFFFFFFFF;
}

/*******************************************************************************
* Function Name  : NVIC_PriorityGroupConfig
* Description    : Configures the priority grouping: pre-emption priority
*                  and subpriority.
* Input          : - NVIC_PriorityGroup: specifies the priority grouping bits
*                    length. This parameter can be one of the following values:
*                       - NVIC_PriorityGroup_0: 0 bits for pre-emption priority
*                         4 bits for subpriority
*                       - NVIC_PriorityGroup_1: 1 bits for pre-emption priority
*                         3 bits for subpriority
*                       - NVIC_PriorityGroup_2: 2 bits for pre-emption priority
*                         2 bits for subpriority
*                       - NVIC_PriorityGroup_3: 3 bits for pre-emption priority
*                         1 bits for subpriority
*                       - NVIC_PriorityGroup_4: 4 bits for pre-emption priority
*                         0 bits for subpriority
* Output         : None
* Return         : None
*******************************************************************************/
void NVIC_PriorityGroupConfig(u32 NVIC_PriorityGroup)
{
  /* Check the parameters */
  assert_param(IS_NVIC_PRIORITY_GROUP(NVIC_PriorityGroup));
  
  /* Set the PRIGROUP[10:8] bits according to NVIC_PriorityGroup value */
  SCB->AIRCR = AIRCR_VECTKEY_MASK | NVIC_PriorityGroup;
}

/*******************************************************************************
* Function Name  : NVIC_Init
* Description    : Initializes the NVIC peripheral according to the specified
*                  parameters in the NVIC_InitStruct.
* Input          : - NVIC_InitStruct: pointer to a NVIC_InitTypeDef structure
*                    that contains the configuration information for the
*                    specified NVIC peripheral.
* Output         : None
* Return         : None
*******************************************************************************/
void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct)
{
  u32 tmppriority = 0x00, tmpreg = 0x00, tmpmask = 0x00;
  u32 tmppre = 0, tmpsub = 0x0F;

  /* Check the parameters */
  assert_param(IS_FUNCTIONAL_STATE(NVIC_InitStruct->NVIC_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 != DISABLE)
  {
    /* Compute the Corresponding IRQ Priority --------------------------------*/    
    tmppriority = (0x700 - (SCB->AIRCR & (u32)0x700))>> 0x08;
    tmppre = (0x4 - tmppriority);
    tmpsub = tmpsub >> tmppriority;
    
    tmppriority = (u32)NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority << tmppre;
    tmppriority |=  NVIC_InitStruct->NVIC_IRQChannelSubPriority & tmpsub;

    tmppriority = tmppriority << 0x04;
    tmppriority = ((u32)tmppriority) << ((NVIC_InitStruct->NVIC_IRQChannel & (u8)0x03) * 0x08);
    
    tmpreg = NVIC->IPR[(NVIC_InitStruct->NVIC_IRQChannel >> 0x02)];
    tmpmask = (u32)0xFF << ((NVIC_InitStruct->NVIC_IRQChannel & (u8)0x03) * 0x08);
    tmpreg &= ~tmpmask;
    tmppriority &= tmpmask;  
    tmpreg |= tmppriority;

    NVIC->IPR[(NVIC_InitStruct->NVIC_IRQChannel >> 0x02)] = tmpreg;
    
    /* Enable the Selected IRQ Channels --------------------------------------*/
    NVIC->ISER[(NVIC_InitStruct->NVIC_IRQChannel >> 0x05)] =
      (u32)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (u8)0x1F);
  }
  else
  {
    /* Disable the Selected IRQ Channels -------------------------------------*/
    NVIC->ICER[(NVIC_InitStruct->NVIC_IRQChannel >> 0x05)] =
      (u32)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (u8)0x1F);
  }
}

/*******************************************************************************
* Function Name  : NVIC_StructInit
* Description    : Fills each NVIC_InitStruct member with its default value.
* Input          : - NVIC_InitStruct: pointer to a NVIC_InitTypeDef structure which
*                    will be initialized.
* Output         : None
* Return         : None
*******************************************************************************/
void NVIC_StructInit(NVIC_InitTypeDef* NVIC_InitStruct)
{
  /* NVIC_InitStruct members default value */
  NVIC_InitStruct->NVIC_IRQChannel = 0x00;
  NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority = 0x00;
  NVIC_InitStruct->NVIC_IRQChannelSubPriority = 0x00;
  NVIC_InitStruct->NVIC_IRQChannelCmd = DISABLE;
}

/*******************************************************************************
* Function Name  : NVIC_SETPRIMASK
* Description    : Enables the PRIMASK priority: Raises the execution priority to 0.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
void NVIC_SETPRIMASK(void)
{
  __SETPRIMASK();
}

/*******************************************************************************
* Function Name  : NVIC_RESETPRIMASK
* Description    : Disables the PRIMASK priority.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
void NVIC_RESETPRIMASK(void)
{
  __RESETPRIMASK();
}

/*******************************************************************************
* Function Name  : NVIC_SETFAULTMASK
* Description    : Enables the FAULTMASK priority: Raises the execution priority to -1.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
void NVIC_SETFAULTMASK(void)
{
  __SETFAULTMASK();
}

/*******************************************************************************
* Function Name  : NVIC_RESETFAULTMASK
* Description    : Disables the FAULTMASK priority.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
void NVIC_RESETFAULTMASK(void)
{
  __RESETFAULTMASK();
}

/*******************************************************************************
* Function Name  : NVIC_BASEPRICONFIG
* Description    : The execution priority can be changed from 15 (lowest 
                   configurable priority) to 1. Writing a zero  value will disable 
*                  the mask of execution priority.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
void NVIC_BASEPRICONFIG(u32 NewPriority)
{
  /* Check the parameters */
  assert_param(IS_NVIC_BASE_PRI(NewPriority));
  
  __BASEPRICONFIG(NewPriority << 0x04);
}

/*******************************************************************************
* Function Name  : NVIC_GetBASEPRI
* Description    : Returns the BASEPRI mask value.
* Input          : None
* Output         : None
* Return         : BASEPRI register value
*******************************************************************************/
u32 NVIC_GetBASEPRI(void)
{
  return (__GetBASEPRI());
}

/*******************************************************************************
* Function Name  : NVIC_GetCurrentPendingIRQChannel
* Description    : Returns the current pending IRQ channel identifier.
* Input          : None
* Output         : None
* Return         : Pending IRQ Channel Identifier.
*******************************************************************************/
u16 NVIC_GetCurrentPendingIRQChannel(void)
{
  return ((u16)((SCB->ICSR & (u32)0x003FF000) >> 0x0C));
}

/*******************************************************************************
* Function Name  : NVIC_GetIRQChannelPendingBitStatus
* Description    : Checks whether the specified IRQ Channel pending bit is set
*                  or not.
* Input          : - NVIC_IRQChannel: specifies the interrupt pending bit to check.
* Output         : None
* Return         : The new state of IRQ Channel pending bit(SET or RESET).
*******************************************************************************/
ITStatus NVIC_GetIRQChannelPendingBitStatus(u8 NVIC_IRQChannel)
{
  ITStatus pendingirqstatus = RESET;
  u32 tmp = 0x00;
  
  /* Check the parameters */
  assert_param(IS_NVIC_IRQ_CHANNEL(NVIC_IRQChannel));
  
  tmp = ((u32)0x01 << (NVIC_IRQChannel & (u32)0x1F));

  if (((NVIC->ISPR[(NVIC_IRQChannel >> 0x05)]) & tmp) == tmp)
  {
    pendingirqstatus = SET;
  }
  else
  {
    pendingirqstatus = RESET;
  }
  return pendingirqstatus;
}

/*******************************************************************************
* Function Name  : NVIC_SetIRQChannelPendingBit
* Description    : Sets the NVIC抯 interrupt pending bit.
* Input          : - NVIC_IRQChannel: specifies the interrupt pending bit to Set.
* Output         : None
* Return         : None
*******************************************************************************/
void NVIC_SetIRQChannelPendingBit(u8 NVIC_IRQChannel)
{
  /* Check the parameters */
  assert_param(IS_NVIC_IRQ_CHANNEL(NVIC_IRQChannel));
  
  *(vu32*) 0xE000EF00 = (u32)NVIC_IRQChannel;
}

/*******************************************************************************
* Function Name  : NVIC_ClearIRQChannelPendingBit
* Description    : Clears the NVIC抯 interrupt pending bit.
* Input          : - NVIC_IRQChannel: specifies the interrupt pending bit to clear.
* Output         : None
* Return         : None
*******************************************************************************/
void NVIC_ClearIRQChannelPendingBit(u8 NVIC_IRQChannel)
{
  /* Check the parameters */
  assert_param(IS_NVIC_IRQ_CHANNEL(NVIC_IRQChannel));
  
  NVIC->ICPR[(NVIC_IRQChannel >> 0x05)] = (u32)0x01 << (NVIC_IRQChannel & (u32)0x1F);
}

/*******************************************************************************
* Function Name  : NVIC_GetCurrentActiveHandler
* Description    : Returns the current active Handler (IRQ Channel and
*                  SystemHandler) identifier.
* Input          : None
* Output         : None
* Return         : Active Handler Identifier.
*******************************************************************************/
u16 NVIC_GetCurrentActiveHandler(void)
{
  return ((u16)(SCB->ICSR & (u32)0x3FF));
}

/*******************************************************************************
* Function Name  : NVIC_GetIRQChannelActiveBitStatus
* Description    : Checks whether the specified IRQ Channel active bit is set
*                  or not.
* Input          : - NVIC_IRQChannel: specifies the interrupt active bit to check.
* Output         : None
* Return         : The new state of IRQ Channel active bit(SET or RESET).
*******************************************************************************/
ITStatus NVIC_GetIRQChannelActiveBitStatus(u8 NVIC_IRQChannel)
{
  ITStatus activeirqstatus = RESET;
  u32 tmp = 0x00;

  /* Check the parameters */
  assert_param(IS_NVIC_IRQ_CHANNEL(NVIC_IRQChannel));
  
  tmp = ((u32)0x01 << (NVIC_IRQChannel & (u32)0x1F));

  if (((NVIC->IABR[(NVIC_IRQChannel >> 0x05)]) & tmp) == tmp )
  {
    activeirqstatus = SET;
  }
  else
  {
    activeirqstatus = RESET;
  }
  return activeirqstatus;
}

/*******************************************************************************
* Function Name  : NVIC_GetCPUID
* Description    : Returns the ID number, the version number and the implementation
*                  details of the Cortex-M3 core.
* Input          : None
* Output         : None
* Return         : CPU ID.
*******************************************************************************/
u32 NVIC_GetCPUID(void)
{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成人福利片| 色婷婷综合久久久| 蜜臀久久99精品久久久久宅男| 亚洲综合男人的天堂| 中文字幕一区二区不卡| 国产精品国产成人国产三级| 欧美国产97人人爽人人喊| 中文字幕乱码一区二区免费| 国产精品久久久久久久第一福利 | 色拍拍在线精品视频8848| 99久久免费视频.com| jlzzjlzz亚洲女人18| 99久久久精品| 欧美综合视频在线观看| 欧美精品一级二级| 日韩精品一区二区三区视频| 国产亚洲污的网站| 国产精品久久久久9999吃药| 亚洲精品伦理在线| 日韩经典一区二区| 国产不卡在线视频| 91碰在线视频| 欧美一级二级三级蜜桃| 久久亚洲综合色一区二区三区 | 亚洲色图视频网站| 亚洲自拍都市欧美小说| 美女在线视频一区| 成人动漫视频在线| 欧美日韩国产在线观看| 久久九九99视频| 亚洲国产婷婷综合在线精品| 久久机这里只有精品| 99久久免费精品高清特色大片| 欧美人牲a欧美精品| 国产日韩欧美激情| 午夜电影网亚洲视频| 国产mv日韩mv欧美| 欧美一级免费大片| 亚洲人成电影网站色mp4| 精品一区二区三区不卡 | 天天色综合天天| 成人晚上爱看视频| 在线播放亚洲一区| 亚洲欧美另类在线| 精品一区二区在线视频| 日本精品免费观看高清观看| 久久久久久亚洲综合| 亚洲一区二区三区视频在线| 国产成人精品一区二区三区四区 | 麻豆国产欧美一区二区三区| 99久久精品国产观看| 日韩欧美中文字幕精品| 亚洲精品欧美在线| av亚洲精华国产精华精华| 精品伦理精品一区| 欧美aa在线视频| 色999日韩国产欧美一区二区| 久久久久久久综合日本| 九九视频精品免费| 91精品久久久久久久久99蜜臂| 亚洲欧洲三级电影| 成人国产精品免费观看动漫| 精品蜜桃在线看| 麻豆精品一区二区三区| 678五月天丁香亚洲综合网| 亚洲永久精品国产| 欧美综合亚洲图片综合区| 亚洲人午夜精品天堂一二香蕉| 国产成人精品一区二区三区四区| 精品国产一区二区三区av性色| 日韩二区在线观看| 欧美日韩大陆一区二区| 亚洲国产精品影院| 欧美乱妇20p| 天天综合色天天综合色h| 欧美午夜理伦三级在线观看| 亚洲激情欧美激情| 欧美午夜精品久久久久久超碰| 夜夜嗨av一区二区三区 | 美国三级日本三级久久99| 欧美精品 国产精品| 日韩1区2区3区| 精品国产一区二区亚洲人成毛片| 国产在线一区二区| 精品毛片乱码1区2区3区| 国产成人午夜电影网| 国产精品网友自拍| 色欲综合视频天天天| 亚洲成人黄色影院| 精品少妇一区二区三区视频免付费| 美女脱光内衣内裤视频久久网站 | www欧美成人18+| 东方欧美亚洲色图在线| 亚洲特黄一级片| 欧美在线你懂的| 日韩av在线发布| 久久只精品国产| 不卡的av网站| 日韩影院精彩在线| 精品国产成人系列| 成人国产亚洲欧美成人综合网| 亚洲精品国产成人久久av盗摄| 91精品国产综合久久蜜臀| 国产高清不卡一区二区| 亚洲一区免费在线观看| 欧美成人a视频| www.在线成人| 免费观看日韩av| 亚洲欧美在线观看| 制服丝袜亚洲播放| av一区二区三区| 免费人成在线不卡| 国产精品第一页第二页第三页| 欧美亚洲自拍偷拍| 国产在线乱码一区二区三区| 亚洲精品视频在线观看免费| 亚洲成人av一区二区三区| 久久久三级国产网站| 欧美日本国产一区| 波多野结衣精品在线| 日韩制服丝袜先锋影音| 亚洲狼人国产精品| 久久久.com| 日韩欧美二区三区| 91黄色免费版| 成人av在线网站| 国内精品国产成人| 日韩精品高清不卡| 亚洲综合视频在线| 亚洲人成网站色在线观看| 久久五月婷婷丁香社区| 国产欧美一区二区精品久导航 | 中文字幕人成不卡一区| 欧美一卡二卡在线| 91老师片黄在线观看| 高清国产午夜精品久久久久久| 麻豆91免费观看| 亚洲成人动漫在线免费观看| 亚洲精品视频在线观看免费| 国产欧美一区二区精品秋霞影院| 日韩欧美另类在线| 91精品一区二区三区在线观看| 不卡的电视剧免费网站有什么| 国产成人av自拍| 精品一区二区免费| 久久国产精品72免费观看| 日韩精品电影在线| 美女性感视频久久| 青青草国产精品亚洲专区无| 天使萌一区二区三区免费观看| 亚洲一区精品在线| 视频精品一区二区| 一区二区高清免费观看影视大全| 日韩一区在线看| 亚洲女人小视频在线观看| 中文字幕一区二区三中文字幕| 国产精品久久久久精k8| 国产精品久久久久久久久久免费看 | 欧美乱妇23p| 欧美一区二视频| 日韩免费性生活视频播放| 欧美成人一区二区三区片免费| 精品国产免费一区二区三区四区| 欧美电视剧在线观看完整版| 精品国产sm最大网站免费看| 久久免费的精品国产v∧| 中文字幕高清不卡| 亚洲蜜臀av乱码久久精品| 亚洲一区二区视频| 日本欧美一区二区三区乱码| 久久9热精品视频| 高清在线成人网| 色婷婷综合久久久久中文一区二区| 欧美午夜影院一区| 精品久久免费看| 中文字幕一区二区三| 亚洲观看高清完整版在线观看| 美女视频一区二区| www.亚洲人| 日韩欧美资源站| 亚洲免费av在线| 九九热在线视频观看这里只有精品 | 男女视频一区二区| 成人综合在线视频| 欧美色网站导航| 久久久久久一二三区| 亚洲一区自拍偷拍| 国产成人午夜电影网| 色素色在线综合| 欧美一级欧美一级在线播放| 国产精品丝袜91| 日本不卡一区二区三区| 顶级嫩模精品视频在线看| 欧美日本不卡视频| 欧美激情综合在线| 日日夜夜免费精品| 99久久综合99久久综合网站| 欧美一级午夜免费电影| 亚洲色欲色欲www| 热久久久久久久|