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

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

?? interrupt.c

?? KEIL驅動 各方面各 你的看法女士的煩惱 方看到你
?? C
?? 第 1 頁 / 共 2 頁
字號:
//*****************************************************************************
//
// interrupt.c - Driver for the NVIC Interrupt Controller.
//
// Copyright (c) 2005-2008 Luminary Micro, Inc.  All rights reserved.
// 
// Software License Agreement
// 
// Luminary Micro, Inc. (LMI) is supplying this software for use solely and
// exclusively on LMI's microcontroller products.
// 
// The software is owned by LMI and/or its suppliers, and is protected under
// applicable copyright laws.  All rights are reserved.  You may not combine
// this software with "viral" open-source software in order to form a larger
// program.  Any use in violation of the foregoing restrictions may subject
// the user to criminal sanctions under applicable laws, as well as to civil
// liability for the breach of the terms and conditions of this license.
// 
// THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
// 
// This is part of revision 3223 of the Stellaris Peripheral Driver Library.
//
//*****************************************************************************

//*****************************************************************************
//
//! \addtogroup interrupt_api
//! @{
//
//*****************************************************************************

#include "../hw_ints.h"
#include "../hw_nvic.h"
#include "../hw_types.h"
#include "cpu.h"
#include "debug.h"
#include "interrupt.h"

//*****************************************************************************
//
// This is a mapping between priority grouping encodings and the number of
// preemption priority bits.
//
//*****************************************************************************
static const unsigned long g_pulPriority[] =
{
    NVIC_APINT_PRIGROUP_0_8, NVIC_APINT_PRIGROUP_1_7, NVIC_APINT_PRIGROUP_2_6,
    NVIC_APINT_PRIGROUP_3_5, NVIC_APINT_PRIGROUP_4_4, NVIC_APINT_PRIGROUP_5_3,
    NVIC_APINT_PRIGROUP_6_2, NVIC_APINT_PRIGROUP_7_1
};

//*****************************************************************************
//
// This is a mapping between interrupt number and the register that contains
// the priority encoding for that interrupt.
//
//*****************************************************************************
static const unsigned long g_pulRegs[] =
{
    0, NVIC_SYS_PRI1, NVIC_SYS_PRI2, NVIC_SYS_PRI3, NVIC_PRI0, NVIC_PRI1,
    NVIC_PRI2, NVIC_PRI3, NVIC_PRI4, NVIC_PRI5, NVIC_PRI6, NVIC_PRI7,
    NVIC_PRI8, NVIC_PRI9, NVIC_PRI10, NVIC_PRI11
};

//*****************************************************************************
//
//! \internal
//! The default interrupt handler.
//!
//! This is the default interrupt handler for all interrupts.  It simply loops
//! forever so that the system state is preserved for observation by a
//! debugger.  Since interrupts should be disabled before unregistering the
//! corresponding handler, this should never be called.
//!
//! \return None.
//
//*****************************************************************************
static void
IntDefaultHandler(void)
{
    //
    // Go into an infinite loop.
    //
    while(1)
    {
    }
}

//*****************************************************************************
//
// The processor vector table.
//
// This contains a list of the handlers for the various interrupt sources in
// the system.  The layout of this list is defined by the hardware; assertion
// of an interrupt causes the processor to start executing directly at the
// address given in the corresponding location in this list.
//
//*****************************************************************************
#if defined(ewarm)
static __no_init void (*g_pfnRAMVectors[NUM_INTERRUPTS])(void) @ "VTABLE";
#elif defined(sourcerygxx)
static __attribute__((section(".cs3.region-head.ram")))
void (*g_pfnRAMVectors[NUM_INTERRUPTS])(void);
#else
static __attribute__((section("vtable")))
void (*g_pfnRAMVectors[NUM_INTERRUPTS])(void);
#endif

//*****************************************************************************
//
//! Enables the processor interrupt.
//!
//! Allows the processor to respond to interrupts.  This does not affect the
//! set of interrupts enabled in the interrupt controller; it just gates the
//! single interrupt from the controller to the processor.
//!
//! \note Previously, this function had no return value.  As such, it was
//! possible to include <tt>interrupt.h</tt> and call this function without
//! having included <tt>hw_types.h</tt>.  Now that the return is a
//! <tt>tBoolean</tt>, a compiler error will occur in this case.  The solution
//! is to include <tt>hw_types.h</tt> before including <tt>interrupt.h</tt>.
//!
//! \return Returns \b true if interrupts were disabled when the function was
//! called or \b false if they were initially enabled.
//
//*****************************************************************************
tBoolean
IntMasterEnable(void)
{
    //
    // Enable processor interrupts.
    //
    return(CPUcpsie());
}

//*****************************************************************************
//
//! Disables the processor interrupt.
//!
//! Prevents the processor from receiving interrupts.  This does not affect the
//! set of interrupts enabled in the interrupt controller; it just gates the
//! single interrupt from the controller to the processor.
//!
//! \note Previously, this function had no return value.  As such, it was
//! possible to include <tt>interrupt.h</tt> and call this function without
//! having included <tt>hw_types.h</tt>.  Now that the return is a
//! <tt>tBoolean</tt>, a compiler error will occur in this case.  The solution
//! is to include <tt>hw_types.h</tt> before including <tt>interrupt.h</tt>.
//!
//! \return Returns \b true if interrupts were already disabled when the
//! function was called or \b false if they were initially enabled.
//
//*****************************************************************************
tBoolean
IntMasterDisable(void)
{
    //
    // Disable processor interrupts.
    //
    return(CPUcpsid());
}

//*****************************************************************************
//
//! Registers a function to be called when an interrupt occurs.
//!
//! \param ulInterrupt specifies the interrupt in question.
//! \param pfnHandler is a pointer to the function to be called.
//!
//! This function is used to specify the handler function to be called when the
//! given interrupt is asserted to the processor.  When the interrupt occurs,
//! if it is enabled (via IntEnable()), the handler function will be called in
//! interrupt context.  Since the handler function can preempt other code, care
//! must be taken to protect memory or peripherals that are accessed by the
//! handler and other non-handler code.
//!
//! \note The use of this function (directly or indirectly via a peripheral
//! driver interrupt register function) moves the interrupt vector table from
//! flash to SRAM.  Therefore, care must be taken when linking the application
//! to ensure that the SRAM vector table is located at the beginning of SRAM;
//! otherwise NVIC will not look in the correct portion of memory for the
//! vector table (it requires the vector table be on a 1 kB memory alignment).
//! Normally, the SRAM vector table is so placed via the use of linker scripts;
//! some tool chains, such as the evaluation version of RV-MDK, do not support
//! linker scripts and therefore will not produce a valid executable.  See the
//! discussion of compile-time versus run-time interrupt handler registration
//! in the introduction to this chapter.
//!
//! \return None.
//
//*****************************************************************************
void
IntRegister(unsigned long ulInterrupt, void (*pfnHandler)(void))
{
    unsigned long ulIdx;

    //
    // Check the arguments.
    //
    ASSERT(ulInterrupt < NUM_INTERRUPTS);

    //
    // Make sure that the RAM vector table is correctly aligned.
    //
    ASSERT(((unsigned long)g_pfnRAMVectors & 0x000003ff) == 0);

    //
    // See if the RAM vector table has been initialized.
    //
    if(HWREG(NVIC_VTABLE) != (unsigned long)g_pfnRAMVectors)
    {
        //
        // Copy the vector table from the beginning of FLASH to the RAM vector
        // table.
        //
        for(ulIdx = 0; ulIdx < NUM_INTERRUPTS; ulIdx++)
        {
            g_pfnRAMVectors[ulIdx] = (void (*)(void))HWREG(ulIdx * 4);
        }

        //
        // Point NVIC at the RAM vector table.
        //
        HWREG(NVIC_VTABLE) = (unsigned long)g_pfnRAMVectors;
    }

    //
    // Save the interrupt handler.
    //
    g_pfnRAMVectors[ulInterrupt] = pfnHandler;
}

//*****************************************************************************
//
//! Unregisters the function to be called when an interrupt occurs.
//!
//! \param ulInterrupt specifies the interrupt in question.
//!
//! This function is used to indicate that no handler should be called when the
//! given interrupt is asserted to the processor.  The interrupt source will be
//! automatically disabled (via IntDisable()) if necessary.
//!
//! \sa IntRegister() for important information about registering interrupt
//! handlers.
//!
//! \return None.
//
//*****************************************************************************
void
IntUnregister(unsigned long ulInterrupt)
{
    //
    // Check the arguments.
    //
    ASSERT(ulInterrupt < NUM_INTERRUPTS);

    //
    // Reset the interrupt handler.
    //
    g_pfnRAMVectors[ulInterrupt] = IntDefaultHandler;
}

//*****************************************************************************
//
//! Sets the priority grouping of the interrupt controller.
//!
//! \param ulBits specifies the number of bits of preemptable priority.
//!
//! This function specifies the split between preemptable priority levels and
//! subpriority levels in the interrupt priority specification.  The range of
//! the grouping values are dependent upon the hardware implementation; on

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美在线观看视频一区二区| 久久国产福利国产秒拍| 久久影院午夜片一区| 欧美一区日韩一区| 在线免费亚洲电影| 欧美性感一区二区三区| 欧美一区二区视频在线观看| 欧美日韩卡一卡二| 91九色最新地址| 精品1区2区3区| 在线播放一区二区三区| 欧美日韩一级黄| 91精品中文字幕一区二区三区| 777欧美精品| 91精品国产乱码久久蜜臀| 777亚洲妇女| 精品噜噜噜噜久久久久久久久试看 | 色综合天天综合在线视频| 99视频精品在线| 色综合中文综合网| 国产精品三级在线观看| 国产精品久久久久久久久果冻传媒| 国产精品久久久久永久免费观看| 亚洲美女区一区| 亚洲成人综合视频| 国产在线观看免费一区| 欧美巨大另类极品videosbest| 欧美久久久久久蜜桃| 日韩写真欧美这视频| 久久精品一区蜜桃臀影院| 亚洲欧洲色图综合| 日韩高清在线观看| 国产精品1区2区| 91啪亚洲精品| 精品蜜桃在线看| 中文字幕欧美一| 日韩成人av影视| av资源网一区| 717成人午夜免费福利电影| 国产偷国产偷亚洲高清人白洁| 亚洲综合久久久久| 国产福利视频一区二区三区| 91福利在线导航| 久久欧美一区二区| 亚洲不卡一区二区三区| 国产精品亚洲一区二区三区妖精| 欧洲另类一二三四区| 久久久久综合网| 五月激情综合婷婷| 成人免费电影视频| 日韩视频国产视频| 亚洲伦理在线免费看| 国产成人免费视频精品含羞草妖精| 欧美亚洲国产bt| 国产精品初高中害羞小美女文| 免费看欧美女人艹b| 色激情天天射综合网| 国产夜色精品一区二区av| 日本美女一区二区三区| 91福利在线播放| 中文字幕在线播放不卡一区| 狠狠色狠狠色综合日日91app| 欧美日韩国产一级二级| 亚洲人成人一区二区在线观看| 国产乱码精品一区二区三区av | 欧美一区二区三区喷汁尤物| 一区二区三区在线播| 成人黄动漫网站免费app| 欧美大片一区二区三区| 日本欧美加勒比视频| 欧美色成人综合| 亚洲影视在线观看| 色噜噜狠狠一区二区三区果冻| 亚洲欧洲国产日韩| 成人黄色免费短视频| 国产日韩高清在线| 国产成人综合网站| 久久久久88色偷偷免费| 国产精品亚洲第一区在线暖暖韩国| 日韩欧美第一区| 久久er精品视频| 精品久久人人做人人爰| 老司机精品视频在线| 日韩欧美一区二区不卡| 国产a级毛片一区| 欧美高清在线精品一区| 成人a区在线观看| 国产精品久久久久久久久免费桃花| 粉嫩av一区二区三区在线播放| 久久久久国产精品免费免费搜索| 国产成人精品一区二区三区网站观看| 久久久精品一品道一区| 成人一区二区三区视频在线观看| 国产精品人妖ts系列视频| jiyouzz国产精品久久| 一区二区三区在线视频观看58| 91福利在线导航| 日本不卡视频在线| 久久久久久久久久电影| 97精品国产露脸对白| 亚洲自拍偷拍网站| 日韩一卡二卡三卡国产欧美| 黄色资源网久久资源365| 欧美极品少妇xxxxⅹ高跟鞋 | 日本最新不卡在线| 精品国产电影一区二区| 成人免费毛片高清视频| 亚洲一区二区偷拍精品| 日韩免费福利电影在线观看| 成人午夜私人影院| 亚洲v精品v日韩v欧美v专区 | av在线一区二区三区| 亚洲自拍偷拍综合| 久久青草欧美一区二区三区| 91麻豆免费看| 麻豆一区二区在线| 亚洲日本一区二区三区| 日韩欧美国产三级| 91在线观看免费视频| 伦理电影国产精品| 亚洲三级免费观看| 久久青草欧美一区二区三区| 欧美色图片你懂的| 国产成人午夜精品5599| 亚洲高清久久久| 欧美国产成人在线| 日韩女优av电影在线观看| 91美女片黄在线观看| 国产精品亚洲一区二区三区妖精 | 欧美日韩在线播| 成人午夜免费av| 久久99精品视频| 亚洲一区中文在线| 中文字幕亚洲一区二区av在线| 日韩欧美国产高清| 欧美午夜精品久久久久久孕妇| 成人在线视频一区二区| 精品一区二区影视| 香蕉加勒比综合久久| 亚洲欧美日韩系列| 国产精品国产三级国产普通话蜜臀| 日韩精品一区二区三区蜜臀 | 亚洲一线二线三线视频| 中文字幕av一区二区三区| 欧美xxxxx牲另类人与| 欧美一级在线免费| 欧美丰满一区二区免费视频| 在线观看视频一区二区| 99这里都是精品| 成人免费毛片嘿嘿连载视频| 国产精品白丝jk黑袜喷水| 日韩不卡一区二区| 日本成人在线不卡视频| 免费在线看一区| 麻豆成人免费电影| 久久国产精品99久久久久久老狼 | 欧美激情资源网| 国产午夜精品一区二区| 久久久国产综合精品女国产盗摄| 精品不卡在线视频| 国产欧美一区二区三区在线看蜜臀| 精品国产伦理网| 国产性做久久久久久| 国产精品美女久久久久av爽李琼| 国产性色一区二区| 自拍偷拍亚洲激情| 亚洲综合激情网| 青青草精品视频| 国产乱国产乱300精品| 成人在线视频一区| 在线精品视频免费观看| 在线观看精品一区| 日韩网站在线看片你懂的| 亚洲图片欧美色图| 亚洲18影院在线观看| 蜜臀av一区二区三区| 国产精品亚洲午夜一区二区三区 | 国产精品久久久久7777按摩 | 欧美一区二区高清| 久久日韩精品一区二区五区| 欧美激情一区二区三区全黄| 亚洲欧美国产三级| 日本网站在线观看一区二区三区| 韩国三级在线一区| 91免费看片在线观看| 欧美一级理论片| 国产精品人成在线观看免费| 一区二区三区在线影院| 久久99蜜桃精品| 99九九99九九九视频精品| 91精品久久久久久蜜臀| 欧美国产精品一区二区| 天使萌一区二区三区免费观看| 激情文学综合网| 91国偷自产一区二区开放时间| 日韩欧美国产三级| 日韩理论片网站| 精彩视频一区二区三区| 色香色香欲天天天影视综合网| 欧美va天堂va视频va在线|